common/repositories/TranslationRepository.php
/**
    * @param data Object
    * @return Create new CategoryMessage,if true => create new message for translation
    */
@param data Object
@return Create new CategoryMessage,if true => create new message for translation
@param data Object @return Create new CategoryMessage if true = > create new message for translation
public function createCategory($data){
        $this->source_message->category = $data['category'];
        $this->source_message->message= $data['message'];
        if($this->source_message->save()){
            $this->message->id = \Yii::$app->db->getLastInsertId();
            $this->message->language = $data['language'];
            $this->message->translation = $data['translation'];
            if($this->message->save()){
                return true;
            }
        }else{
            return false;
        }
    }
public function createCategory ( $ data ) { $ this -> source_message -> category = $ data [ 'category' ] ; $ this -> source_message -> message = $ data [ 'message' ] ; if ( $ this -> source_message -> save ( ) ) { $ this -> message -> id = \ Yii :: $ app -> db -> getLastInsertId ( ) ; $ this -> message -> language = $ data [ 'language' ] ; $ this -> message -> translation = $ data [ 'translation' ] ; if ( $ this -> message -> save ( ) ) { return true ; } } else { return false ; } }
@param data Object
 @return Create new CategoryMessage,if true => create new message for translation
@param data Object @return Create new CategoryMessage if true = > create new message for translation