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' => 'Title', 'creation_date' => 'Creation Date', 'code' => 'Code', 'genre' => 'Genre', 'registration_date' => 'Registration Date', 'contract' => 'Contract', 'type' => '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']); } }