255], [['user_id'], 'exist', 'skipOnError' => true, 'targetClass' => User::className(), 'targetAttribute' => ['user_id' => 'id']], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'user_id' => 'User ID', 'title' => 'Назва', 'creation_date' => 'Дата створення', 'code' => 'Шифр', 'genre' => 'Жанр', 'registration_date' => 'Дата реєстрації', 'contract' => 'Договір', 'type' => 'Тип', ]; } /** * @return \yii\db\ActiveQuery */ public function getCreativeRoles() { return $this->hasMany(CreativeRole::className(), ['intellectual_property_id' => 'id']); } /** * @return \yii\db\ActiveQuery */ public function getUser() { return $this->hasOne(User::className(), ['id' => 'user_id']); } /** * @return \yii\db\ActiveQuery */ public function getReports() { return $this->hasMany(Report::className(), ['intellectual_property_id' => 'id']); } }