當前位置: 首頁>>代碼示例>>PHP>>正文


PHP AttributeType::getByID方法代碼示例

本文整理匯總了PHP中AttributeType::getByID方法的典型用法代碼示例。如果您正苦於以下問題:PHP AttributeType::getByID方法的具體用法?PHP AttributeType::getByID怎麽用?PHP AttributeType::getByID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AttributeType的用法示例。


在下文中一共展示了AttributeType::getByID方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: save_attribute_type_associations

 public function save_attribute_type_associations()
 {
     $list = AttributeKeyCategory::getList();
     foreach ($list as $cat) {
         $cat->clearAttributeKeyCategoryTypes();
         if (is_array($this->post($cat->getAttributeKeyCategoryHandle()))) {
             foreach ($this->post($cat->getAttributeKeyCategoryHandle()) as $id) {
                 $type = AttributeType::getByID($id);
                 $cat->associateAttributeKeyType($type);
             }
         }
     }
     $this->redirect('dashboard/system/attributes/types', 'saved', 'associations_updated');
 }
開發者ID:ricardomccerqueira,項目名稱:rcerqueira.portfolio,代碼行數:14,代碼來源:types.php

示例2: add

	public static function add($atHandle, $atName, $pkg = false) {
		$pkgID = 0;
		if (is_object($pkg)) {
			$pkgID = $pkg->getPackageID();
		}
		$db = Loader::db();
		$db->Execute('insert into AttributeTypes (atHandle, atName, pkgID) values (?, ?, ?)', array($atHandle, $atName, $pkgID));
		$id = $db->Insert_ID();
		$est = AttributeType::getByID($id);
		
		$path = $est->getAttributeTypeFilePath(FILENAME_ATTRIBUTE_DB);
		if ($path) {
			Package::installDB($path);
		}
		return $est;
	}
開發者ID:nbourguig,項目名稱:concrete5,代碼行數:16,代碼來源:type.php

示例3: add

 public function add()
 {
     $this->select_type();
     $type = $this->get('type');
     $cnt = $type->getController();
     $e = $cnt->validateKey($this->post());
     if ($e->has()) {
         $this->set('error', $e);
     } else {
         $type = AttributeType::getByID($this->post('atID'));
         $ak = UserAttributeKey::add($type, $this->post());
         $this->redirect('/dashboard/users/attributes/', 'attribute_created');
     }
 }
開發者ID:nveid,項目名稱:concrete5,代碼行數:14,代碼來源:attributes.php

示例4: getAttributeType

 /** 
  * Returns an attribute type object 
  */
 public function getAttributeType()
 {
     return AttributeType::getByID($this->atID);
 }
開發者ID:ojalehto,項目名稱:concrete5-legacy,代碼行數:7,代碼來源:key.php

示例5: getAttributeTypeObject

 public function getAttributeTypeObject()
 {
     $ato = AttributeType::getByID($this->atID);
     return $ato;
 }
開發者ID:homer6,項目名稱:concrete5-mirror,代碼行數:5,代碼來源:value.php

示例6: defined

<?php

defined('C5_EXECUTE') or die("Access Denied.");
if (isset($_REQUEST['akID'])) {
    $at = AttributeKey::getInstanceByID($_REQUEST['akID']);
} else {
    $at = AttributeType::getByID($_REQUEST['atID']);
}
if (is_object($at)) {
    $cnt = $at->getController();
    if (isset($_REQUEST['args']) && is_array($_REQUEST['args'])) {
        $args = $_REQUEST['args'];
    } else {
        $args = array();
    }
    if (method_exists($cnt, 'action_' . $_REQUEST['action'])) {
        //make sure the controller has the right method
        call_user_func_array(array($cnt, 'action_' . $_REQUEST['action']), $args);
    }
}
開發者ID:ojalehto,項目名稱:concrete5-legacy,代碼行數:20,代碼來源:attribute_type_actions.php

示例7: edit

 public function edit($akID = 0)
 {
     if ($this->post('akID')) {
         $akID = $this->post('akID');
     }
     $key = CollectionAttributeKey::getByID($akID);
     if (!is_object($key) || $key->isAttributeKeyInternal()) {
         $this->redirect('/dashboard/pages/attributes');
     }
     $type = $key->getAttributeType();
     $this->set('key', $key);
     $this->set('type', $type);
     if ($this->isPost()) {
         $cnt = $type->getController();
         $cnt->setAttributeKey($key);
         $e = $cnt->validateKey($this->post());
         if ($e->has()) {
             $this->set('error', $e);
         } else {
             $type = AttributeType::getByID($this->post('atID'));
             $key->update($this->post());
             $this->redirect('/dashboard/pages/attributes/', 'attribute_updated');
         }
     }
 }
開發者ID:nveid,項目名稱:concrete5,代碼行數:25,代碼來源:attributes.php

示例8: edit

 public function edit($akID = 0)
 {
     if ($this->post('akID')) {
         $akID = $this->post('akID');
     }
     $key = CollectionAttributeKey::getByID($akID);
     $type = $key->getAttributeType();
     $this->set('key', $key);
     $this->set('type', $type);
     if ($this->isPost()) {
         $cnt = $type->getController();
         $cnt->setAttributeKey($key);
         $e = $cnt->validateKey($this->post());
         if ($e->has()) {
             $this->set('error', $e);
         } else {
             $type = AttributeType::getByID($this->post('atID'));
             $args = array('akHandle' => $this->post('akHandle'), 'akName' => $this->post('akName'), 'akIsSearchable' => $this->post('akIsSearchable'), 'akIsSearchableIndexed' => $this->post('akIsSearchableIndexed'), 'akIsAutoCreated' => 0, 'akIsEditable' => 1);
             $key->update($this->post());
             $this->redirect('/dashboard/pages/attributes/', 'attribute_updated');
         }
     }
 }
開發者ID:VonUniGE,項目名稱:concrete5-1,代碼行數:23,代碼來源:attributes.php

示例9: add

	public function add() {
		$this->select_type();
		$type = $this->get('type');
		$cnt = $type->getController();
		$e = $cnt->validateKey($this->post());
		if ($e->has()) {
			$this->set('error', $e);
		} else {
			$type = AttributeType::getByID($this->post('atID'));
			$args = array(
				'akHandle' => $this->post('akHandle'),
				'akName' => $this->post('akName'),
				'akIsSearchable' => $this->post('akIsSearchable'),
				'akIsSearchableIndexed' => $this->post('akIsSearchableIndexed'),
				'uakProfileDisplay' => $this->post('uakProfileDisplay'),
				'uakMemberListDisplay' => $this->post('uakMemberListDisplay'),
				'uakProfileEdit' => $this->post('uakProfileEdit'),
				'uakProfileEditRequired' => $this->post('uakProfileEditRequired'),
				'uakRegisterEdit' => $this->post('uakRegisterEdit'),
				'uakRegisterEditRequired' => $this->post('uakRegisterEditRequired'),				
				'akIsAutoCreated' => 0,
				'akIsEditable' => 1
			);
			$ak = UserAttributeKey::add($type, $this->post());
			$this->redirect('/dashboard/users/attributes/', 'attribute_created');
		}
	}
開發者ID:rii-J,項目名稱:concrete5-de,代碼行數:27,代碼來源:attributes.php


注:本文中的AttributeType::getByID方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。