本文整理汇总了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');
}
示例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;
}
示例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');
}
}
示例4: getAttributeType
/**
* Returns an attribute type object
*/
public function getAttributeType()
{
return AttributeType::getByID($this->atID);
}
示例5: getAttributeTypeObject
public function getAttributeTypeObject()
{
$ato = AttributeType::getByID($this->atID);
return $ato;
}
示例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);
}
}
示例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');
}
}
}
示例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');
}
}
}
示例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');
}
}