/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['customer'] = $this->getCustomer()->getJson(); $array['fromEntity'] = $this->getFromEntity() instanceof BaseEntityAbstract ? $this->getFromEntity()->getJson() : array(); $array['technician'] = $this->getTechnician() instanceof UserAccount ? $this->getTechnician()->getJson() : array(); $array['status'] = $this->getStatus() instanceof TaskStatus ? $this->getStatus()->getJson() : array(); $array['createdBy'] = $this->getCreatedBy() instanceof UserAccount ? $this->getCreatedBy()->getJson() : array(); $array['noOfKits'] = Kit::countByCriteria('taskId = ?', array($this->getId())); } return parent::getJson($array, $reset); }