コード例 #1
0
ファイル: option.php プロジェクト: rajtrivedi2001/shopify_app
 public function getByProduct($product)
 {
     $this->db->select();
     $this->db->from('thing');
     $this->db->where('thing_id', $product->getThing()->getId());
     $query = $this->db->get();
     $thingOptions = array();
     foreach ($query->result() as $row) {
         $thingOptions[] = Thing::loadFromRow($row);
     }
     //get options
     $options = array();
     foreach ($thingOptions as $thingOptions) {
         $options[] = Option::load($thingOptions);
     }
     return $options;
 }
コード例 #2
0
ファイル: thing.php プロジェクト: rajtrivedi2001/shopify_app
 public function getChildThings($thingName)
 {
     $this->db->select();
     $this->db->from('thing');
     $this->db->where('name', $thingName);
     $this->db->where('thing_id', $this->getId());
     $query = $this->db->get();
     $children = array();
     foreach ($query->result() as $row) {
         $children[] = Thing::loadFromRow($row);
     }
     return $children;
 }