コード例 #1
0
ファイル: Controller.php プロジェクト: larryu/magento-b2b
 /**
  *
  * @return string
  */
 public function showComponents()
 {
     $html = '';
     foreach (KitComponent::getAllByCriteria('kitId=?', array($this->kit->getId())) as $index => $kitComponent) {
         $html .= $this->getRow($kitComponent->getQty(), $kitComponent->getComponent()->getSku(), $kitComponent->getComponent()->getName(), 'itemRow');
     }
     return $html;
 }
コード例 #2
0
ファイル: Kit.php プロジェクト: larryu/magento-b2b
 /**
  * (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);
 }