예제 #1
0
 public static function handleBrowseRequest($options = array(), $conditions = array(), $responseID = null, $responseData = array())
 {
     if (!empty($_GET['competency'])) {
         if (ctype_digit($_GET['competency'])) {
             $Competency = Competency::getByID($_GET['competency']);
         } else {
             $Competency = Competency::getByCode($_GET['competency']);
         }
         if (!$Competency) {
             return static::throwNotFoundError('Competency not found');
         }
         $conditions['CompetencyID'] = $Competency->ID;
     }
     return parent::handleBrowseRequest($options, $conditions, $responseID, $responseData);
 }
예제 #2
0
 public function save($deep = true)
 {
     $wasCompetencyDirty = $this->isFieldDirty('CompetencyID');
     $wasDemonstrationsRequiredDirty = $this->isFieldDirty('DemonstrationsRequired');
     parent::save($deep);
     if ($wasCompetencyDirty) {
         if ($this->Competency) {
             $this->Competency->getSkillIds(true);
             // true to force refresh of cached value
         }
         if ($oldCompetencyId = $this->getOriginalValue('CompetencyID')) {
             Competency::getByID($oldCompetencyId)->getSkillIds(true);
             // true to force refresh of cached value
         }
     }
     if ($wasDemonstrationsRequiredDirty) {
         $this->Competency->getTotalDemonstrationsRequired(true);
         // true to force refresh of cached value
     }
 }