true, 'targetClass' => Accesses::className(), 'targetAttribute' => ['accesses_id' => 'id']], [['project_id'], 'exist', 'skipOnError' => true, 'targetClass' => Project::className(), 'targetAttribute' => ['project_id' => 'id']], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'accesses_id' => 'Accesses ID', 'project_id' => 'Project ID', ]; } /** * @return \yii\db\ActiveQuery */ public function getAccesses() { return $this->hasOne(Accesses::className(), ['id' => 'accesses_id']); } /** * @return \yii\db\ActiveQuery */ public function getProject() { return $this->hasOne(Project::className(), ['id' => 'project_id']); } }