/** * Returns an attribute value list of attributes and values (duh) which a collection version can store * against its object. * @return AttributeValueList */ public static function getAttributes($cID, $cvID, $method = 'getValue') { $db = Loader::db(); $values = $db->GetAll("select akID, avID from CollectionAttributeValues where cID = ? and cvID = ?", array($cID, $cvID)); $avl = new AttributeValueList(); foreach ($values as $val) { $ak = static::getByID($val['akID']); if (is_object($ak)) { $value = $ak->getAttributeValue($val['avID'], $method); $avl->addAttributeValue($ak, $value); } } return $avl; }
public function getAttributes($pID, $method = 'getValue') { $db = Database::get(); $values = $db->GetAll("select akID, avID from VividStoreProductAttributeValues where pID = ?", array($pID)); $avl = new AttributeValueList(); foreach ($values as $val) { $ak = StoreProductKey::getByID($val['akID']); if (is_object($ak)) { $value = $ak->getAttributeValue($val['avID'], $method); $avl->addAttributeValue($ak, $value); } } return $avl; }
/** * Returns an attribute value list of attributes and values (duh) which a *** version can store * against its object. * @return AttributeValueList */ public static function getAttributes($afID, $method = 'getValue') { $db = Database::connection(); $values = $db->GetAll("select akID, avID from AttributeFormsAttributeValues where afID = ?", array($afID)); $avl = new AttributeValueList(); foreach ($values as $val) { $ak = static::getByID($val['akID']); if (is_object($ak)) { $value = $ak->getAttributeValue($val['avID'], $method); $avl->addAttributeValue($ak, $value); } } return $avl; }