public static function loadTagForObject(DatabaseObject $product, $seller_type) { $select = $product->getDb()->select(); if ($seller_type == 'storeSeller') { $select->from('products_tags', '*')->where('product_id = ?', $product->getId()); } elseif ($seller_type == 'generalSeller') { $select->from('user_products_tag', '*')->where('product_id = ?', $product->getId()); } return $product->getDb()->fetchAll($select); }
public function setDatabaseObject(DatabaseObject $object) { $this->_dbObject = $object; $this->_db = $object->getDb(); $this->_table = $object->getTable(); return $this; }