/** * Get the object of a category of issues using a slug. * @param String $issueCategorySlug - the unique slug of the category of the issue * @return an expetcted object of a category of issues */ private function getIssueCategoryObjectUsingSlug($issueCategorySlug) { $issueCategory = IssueCategory::findFirst(array('conditions' => 'issue_category_slug = ?1', 'bind' => array(1 => $issueCategorySlug))); return $issueCategory; }
/** * @return \yii\db\ActiveQuery */ public function getIssueCategories() { return $this->hasMany(IssueCategory::className(), ['project_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getIssueCategory() { return $this->hasOne(IssueCategory::className(), ['id' => 'issue_category_id']); }
/** * The setter of the field issue_category_id. * @param IssueCategory $issueCategory - the category of the issue */ public function setIssueCategory(IssueCategory $issueCategory) { if ($issueCategory == NULL) { throw new InvalidArgumentException('[Model\\Issue] Invalid Model\\IssueCategory.'); } $this->issue_category_id = $issueCategory->getIssueCategoryId(); }