示例#1
0
 public function preExecute()
 {
     //setup response format
     $this->setResponseFormat();
     $this->relationship = RelationshipApi::get($this->getRequest()->getParameter('id'));
     $this->setLastModified($this->relationship);
     $this->checkExistence($this->relationship, 'Relationship');
 }
示例#2
0
 public function executeView($request)
 {
     $this->relationship = RelationshipApi::get($request->getParameter('id'));
     $this->forward404Unless($this->relationship);
     $this->relationship = array_merge($this->relationship, RelationshipApi::getDetails($this->relationship['id'], $this->relationship['category_id']));
     $this->current = null;
     if ($this->relationship['is_current'] == '1') {
         $this->current = 1;
     } else {
         if ($this->relationship['is_current'] == '0' || !$this->relationship['is_current'] && $this->relationship['end_date']) {
             $this->current = 0;
         }
     }
     $this->relationship['Entity1'] = EntityApi::get($this->relationship['entity1_id']);
     $this->relationship['Entity2'] = EntityApi::get($this->relationship['entity2_id']);
 }