/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['courier'] = $this->getCourier()->getJson(); } return parent::getJson($array, $reset); }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['address']['shipping'] = $this->getShippingAddress() instanceof Address ? $this->getShippingAddress()->getJson() : array(); $array['address']['billing'] = $this->getBillingAddress() instanceof Address ? $this->getBillingAddress()->getJson() : array(); } return parent::getJson($array, $reset); }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false, $getItems = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['product'] = $this->getProduct() instanceof Product ? $this->getProduct()->getJson() : array(); } return parent::getJson($array, $reset); }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $entityClass = get_class($this); $array['breadCrumbs'] = array('ids' => $this->getPaths(), 'names' => $this->getNamePaths($reset)); $array['parent'] = $this->getParent() instanceof $entityClass ? $this->getParent()->getJson(array(), $reset) : array(); $array['root'] = $this->getRoot() instanceof $entityClass && $this->getRoot()->getId() !== $this->getId() ? $this->getRoot()->getJson(array(), $reset) : $array; } return parent::getJson($array, $reset); }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['person'] = $this->getPerson()->getJson(); $array['roles'] = array(); foreach ($this->getRoles() as $role) { $array['roles'][] = $role->getJson(); } } $array = parent::getJson($array, $reset); unset($array['password']); return $array; }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['order'] = $this->getOrder() instanceof Order ? $this->order->getJson() : array(); } return parent::getJson($array, $reset); }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['product'] = $this->getProduct() instanceof Product ? array('id' => $this->getProduct()->getId(), 'name' => $this->getProduct()->getName()) : null; $array['category'] = $this->getCategory() instanceof ProductCategory ? array('id' => $this->getCategory()->getId(), 'name' => $this->getCategory()->getName()) : null; } return parent::getJson($array, $reset); }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $class = __CLASS__; $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['parent'] = $this->getParent() instanceof $class ? array('id' => $this->getParent()->getId()) : null; $array['root'] = array('id' => $this->getRoot()->getId()); $array['namePath'] = $this->getNamePath(); $array['noOfChildren'] = self::countByCriteria('parentId = ? and active = 1', array($this->getId())); $array['noOfProducts'] = Product_Category::countByCriteria('categoryId = ? and active = 1', array($this->getId())); $array['productAttributeSet'] = $this->getProductAttributeSet() instanceof ProductAttributeSet ? $this->getProductAttributeSet()->getJson() : null; } return parent::getJson($array, $reset); }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['kit'] = $this->getKit() instanceof Kit ? $this->getKit()->getJson() : array(); } return parent::getJson($array, $reset); }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $a = $extra; if (!$this->isJsonLoaded($reset)) { $a['url'] = $this->getUrl(); $a['content'] = self::readAssetFile($this->getPath()); } $array = parent::getJson($a, $reset); unset($array['path']); return $array; }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['full'] = trim($this); } return parent::getJson($array, $reset); }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['supplier'] = $this->getSupplier() instanceof Supplier ? $this->getSupplier()->getJson() : ''; $array['manufacturer'] = $this->getManufacturer() instanceof Manufacturer ? $this->getManufacturer()->getJson() : ''; $array['category'] = $this->getCategory() instanceof ProductCategory ? $this->getCategory()->getJson() : ''; $array['priceMatchRule'] = $this->getPriceMatchRule() instanceof ProductPriceMatchRule ? $this->getPriceMatchRule()->getJson() : ''; } return parent::getJson($array, $reset); }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['product'] = $this->getProduct() instanceof Product ? $this->getProduct()->getJson() : null; $array['order'] = $this->getOrder() instanceof Order ? $this->getOrder()->getJson() : null; $array['sellingitems'] = array_map(create_function('$a', 'return $a->getJson();'), $this->getSellingItems()); } return parent::getJson($array, $reset); }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['component'] = $this->getComponent() instanceof Product ? $this->getComponent()->getJson() : null; $array['product'] = $array['component']; } return parent::getJson($array, $reset); }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['createdBy'] = array('id' => $this->getCreatedBy()->getId(), 'person' => $this->getCreatedBy()->getPerson()->getJson()); $array['updatedBy'] = array('id' => $this->getUpdatedBy()->getId(), 'person' => $this->getUpdatedBy()->getPerson()->getJson()); } return parent::getJson($array, $reset); }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['task'] = $this->getTask() instanceof Task ? $this->getTask()->getJson() : null; $array['product'] = $this->getProduct() instanceof Product ? $this->getProduct()->getJson() : null; $array['soldToCustomer'] = $this->getSoldToCustomer() instanceof Customer ? $this->getSoldToCustomer()->getJson() : null; $array['soldOnOrder'] = $this->getSoldOnOrder() instanceof Order ? $this->getSoldOnOrder()->getJson() : null; $array['shippment'] = $this->getShippment() instanceof Shippment ? $this->getShippment()->getJson() : null; $array['components'] = array_map(create_function('$a', 'return $a->getJson();'), KitComponent::getAllByCriteria('kitId = ?', array($this->getId()))); } return parent::getJson($array, $reset); }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['address'] = $this->getAddress() instanceof Address ? $this->getAddress()->getJson() : null; } return parent::getJson($array, $reset); }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['createdBy'] = $this->getCreatedBy() instanceof UserAccount ? $this->getCreatedBy()->getJson() : array(); $array['product'] = $this->getProduct() instanceof Product ? $this->getProduct()->getJson() : array(); $array['purchaseOrder'] = $this->getPurchaseOrder() instanceof PurchaseOrder ? $this->getPurchaseOrder()->getJson() : array(); } return parent::getJson($array, $reset); }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['asset'] = ($asset = Asset::getAsset($this->getImageAssetId())) instanceof Asset ? $asset->getJson() : null; } return parent::getJson($array, $reset); }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false, $getItems = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['supplier'] = $this->getSupplier() instanceof Supplier ? $this->getSupplier()->getJson() : array(); $array['totalProductCount'] = $this->getTotalProductCount(); $array['totalReceivedCount'] = $this->getTotalReceivedCount(); $array['totalReceivedValue'] = $this->getTotalRecievedValue(); $array['supplierInvoices'] = $this->getSupplierInvoices(); if ($getItems === true) { $array['purchaseOrderItems'] = array_map(create_function('$a', 'return $a->getJson();'), $this->getPurchaseOrderItems()); } } return parent::getJson($array, $reset); }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['product'] = $this->getProduct() instanceof Product ? array('id' => $this->getProduct()->getId()) : null; $array['supplier'] = $this->getSupplier() instanceof Supplier ? $this->getSupplier()->getJson() : null; } return parent::getJson($array, $reset); }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['method'] = $this->getMethod()->getJson(); $array['createdBy'] = $this->getCreatedBy()->getJson(); } return parent::getJson($array, $reset); }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['productId'] = $this->getProduct()->getId(); $array['priceMatchCompany'] = $this->getCompany()->getJson(); } return parent::getJson($array, $reset); }
/** * (non-PHPdoc) * @see BaseEntityAbstract::getJson() */ public function getJson($extra = array(), $reset = false) { $array = $extra; if (!$this->isJsonLoaded($reset)) { $array['value'] = $this->getLocation()->getName(); $array['type'] = $this->getType()->getJson(); } return parent::getJson($array, $reset); }
/** * (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); }