コード例 #1
0
ファイル: Candidate.php プロジェクト: davenorthcreek/stratum
 public function loadReferences()
 {
     $references = $this->get("references");
     if ($references) {
         return $references;
     }
     $references = [];
     //initialize
     //so there is nothing in that empty array
     foreach ($this->expose_set() as $attr => $value) {
         //now we filter based on what we have vs. what Bullhorn knows
         if (preg_match("/(recommender\\d)_(.*)/", $attr, $m)) {
             $ref = null;
             if (array_key_exists($m[1], $references)) {
                 $ref = $references[$m[1]];
             } else {
                 $ref = new \Stratum\Model\CandidateReference();
                 $ref->setLogger($this->_logger);
                 $references[$m[1]] = $ref;
                 $this->log_debug("Creating " . $m[1]);
             }
             $ref->set($m[2], $value);
         }
     }
     $this->set("references", $references);
     return $references;
 }