コード例 #1
0
ファイル: file.php プロジェクト: nbourguig/concrete5
	/** 
	 * Returns an attribute value list of attributes and values (duh) which a collection version can store 
	 * against its object.
	 * @return AttributeValueList
	 */
	public function getAttributes($fID, $fvID, $method = 'getValue') {
		$db = Loader::db();
		$values = $db->GetAll("select akID, avID from FileAttributeValues where fID = ? and fvID = ?", array($fID, $fvID));
		$avl = new AttributeValueList();
		foreach($values as $val) {
			$ak = FileAttributeKey::getByID($val['akID']);
			if (is_object($ak)) {
				$value = $ak->getAttributeValue($val['avID'], $method);
				$avl->addAttributeValue($ak, $value);
			}
		}		
		return $avl;
	}
コード例 #2
0
ファイル: form_key.php プロジェクト: sixeightmedia/formify
 /** 
  * Returns an attribute value list of attributes and values (duh) which a collection version can store 
  * against its object.
  * @return AttributeValueList
  */
 public function getAttributes($fID, $method = 'getValue')
 {
     $db = Loader::db();
     $values = $db->GetAll("SELECT akID, avID FROM FormifyAttributeValues WHERE fID = ?", array($fID));
     $avl = new AttributeValueList();
     foreach ($values as $val) {
         $ak = FormKey::getByID($val['akID']);
         if (is_object($ak)) {
             $value = $ak->getAttributeValue($val['avID'], $method);
             $avl->addAttributeValue($ak, $value);
         }
     }
     return $avl;
 }
コード例 #3
0
 public static function Create($attribute)
 {
     AttributeValueList::create(array('product_id' => $attribute->product_id, 'attribute_id' => $attribute->attribute_id, 'value' => $attribute->value));
 }