当前位置: 首页>>代码示例>>PHP>>正文


PHP Type::getByID方法代码示例

本文整理汇总了PHP中Concrete\Core\Attribute\Type::getByID方法的典型用法代码示例。如果您正苦于以下问题:PHP Type::getByID方法的具体用法?PHP Type::getByID怎么用?PHP Type::getByID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Concrete\Core\Attribute\Type的用法示例。


在下文中一共展示了Type::getByID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: add

 public function add($id = null, $type = null)
 {
     $this->select_type($id, $type);
     $type = Type::getByID($type);
     $entity = $this->getEntity($id);
     $this->set('entity', $entity);
     $this->executeAdd($type, \URL::to('/dashboard/system/express/entities/attributes', 'view', $id));
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:8,代码来源:attributes.php

示例2: getItemsFromRequest

 public function getItemsFromRequest($array)
 {
     $items = array();
     foreach ($array as $id) {
         $item = Type::getByID($id);
         if (is_object($item)) {
             $attributeType = new \PortlandLabs\Concrete5\MigrationTool\Entity\Export\AttributeType();
             $attributeType->setItemId($item->getAttributeTypeID());
             $items[] = $attributeType;
         }
     }
     return $items;
 }
开发者ID:motoki1199,项目名称:addon_migration_tool,代码行数:13,代码来源:AttributeType.php

示例3: save_attribute_type_associations

 public function save_attribute_type_associations()
 {
     $list = Category::getList();
     foreach ($list as $cat) {
         $cat->clearAttributeKeyCategoryTypes();
         if (is_array($this->post($cat->getAttributeKeyCategoryHandle()))) {
             foreach ($this->post($cat->getAttributeKeyCategoryHandle()) as $id) {
                 $type = Type::getByID($id);
                 $cat->associateAttributeKeyType($type);
             }
         }
     }
     $this->redirect('dashboard/system/attributes/types', 'saved', 'associations_updated');
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:14,代码来源:types.php

示例4: 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'));
         StoreProductKey::add($type, $this->post());
         $this->redirect('/dashboard/store/products/attributes/', 'success');
     }
 }
开发者ID:vividweb,项目名称:vivid_store,代码行数:14,代码来源:attributes.php

示例5: dispatch

 public function dispatch($action)
 {
     $arguments = explode('/', trim($action, '/'));
     if (count($arguments) > 2) {
         // there must at last be three arguments here
         if (isset($arguments[0])) {
             switch ($arguments[0]) {
                 case 'key':
                     if (isset($arguments[1])) {
                         $key = Key::getByID($arguments[1]);
                         if (is_object($key)) {
                             $controller = $key->getController();
                         }
                     }
                     break;
                 case 'type':
                     if (isset($arguments[1])) {
                         $type = Type::getByID($arguments[1]);
                         if (is_object($type)) {
                             $controller = $type->getController();
                         }
                     }
                     break;
             }
         }
         if (isset($controller)) {
             $action = $arguments[2];
             $arguments = array_slice($arguments, 3);
             if (method_exists($controller, 'action_' . $action)) {
                 //make sure the controller has the right method
                 $response = call_user_func_array(array($controller, 'action_' . $action), $arguments);
                 if ($response instanceof Response) {
                     return $response;
                 } else {
                     print $response;
                     $this->app->shutdown();
                 }
             }
         }
     }
     $response = new Response(t('Access Denied'));
     return $response;
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:43,代码来源:action.php

示例6: update

 public function update()
 {
     $akID = $this->post('akID');
     $key = AttributeFormKey::getByID($akID);
     if (!is_object($key) || $key->isAttributeKeyInternal()) {
         $this->redirect('/dashboard/forms/attributes/');
     }
     $type = $key->getAttributeType();
     $cnt = $type->getController();
     $cnt->setAttributeKey($key);
     $e = $cnt->validateKey($this->post());
     if ($e->has()) {
         $this->set('error', $e);
     } else {
         AttributeType::getByID($this->post('atID'));
         $key->update($this->post());
         $this->redirect('/dashboard/forms/attributes/', 'attribute_updated');
     }
 }
开发者ID:ExchangeCore,项目名称:concrete5-attribute-forms,代码行数:19,代码来源:attributes.php

示例7: save_attribute_type_associations

 public function save_attribute_type_associations()
 {
     if (!$this->token->validate('save_attribute_type_associations')) {
         $this->error->add(t('Invalid CSRF token. Please refresh and try again.'));
         return;
     }
     $manager = \ORM::entityManager();
     $list = Category::getList();
     foreach ($list as $cat) {
         $cat->clearAttributeKeyCategoryTypes();
         if (is_array($this->post($cat->getAttributeKeyCategoryHandle()))) {
             foreach ($this->post($cat->getAttributeKeyCategoryHandle()) as $id) {
                 $type = Type::getByID($id);
                 $cat->getAttributeTypes()->add($type);
             }
         }
         $this->entityManager->persist($cat);
     }
     $this->entityManager->flush();
     $this->redirect('dashboard/system/attributes/types', 'saved', 'associations_updated');
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:21,代码来源:types.php

示例8: die

<?php

defined('C5_EXECUTE') or die("Access Denied.");
use Concrete\Core\Attribute\Key\Key as AttributeKey;
use Concrete\Core\Attribute\Type as AttributeType;
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:yakamoz-fang,项目名称:concrete,代码行数:22,代码来源:attribute_type_actions.php

示例9: action_get_type_form

 public function action_get_type_form()
 {
     $field = explode('|', $this->request->request->get('id'));
     if ($field[0] == 'attribute_key') {
         $type = Type::getByID($field[1]);
         if (is_object($type)) {
             ob_start();
             echo $type->render(new AttributeTypeSettingsContext());
             $html = ob_get_contents();
             ob_end_clean();
             $obj = new \stdClass();
             $obj->content = $html;
             $obj->showControlRequired = true;
             $obj->showControlName = true;
             $obj->assets = $this->getAssetsDefinedDuringOutput();
         }
     } else {
         if ($field[0] == 'entity_property') {
             $obj = new \stdClass();
             switch ($field[1]) {
                 case 'text':
                     $controller = new TextOptions();
                     ob_start();
                     echo $controller->render();
                     $html = ob_get_contents();
                     ob_end_clean();
                     $obj = new \stdClass();
                     $obj->content = $html;
                     $obj->showControlRequired = false;
                     $obj->showControlName = false;
                     $obj->assets = $this->getAssetsDefinedDuringOutput();
                     break;
             }
         }
     }
     if (isset($obj)) {
         return new JsonResponse($obj);
     }
     \Core::make('app')->shutdown();
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:40,代码来源:controller.php

示例10: getAttributeType

 /**
  * Returns an attribute type object
  */
 public function getAttributeType()
 {
     return AttributeType::getByID($this->atID);
 }
开发者ID:jkoudys,项目名称:concrete5,代码行数:7,代码来源:Key.php

示例11: add

 public function add($type = null)
 {
     $this->select_type($type);
     $type = Type::getByID($type);
     $this->executeAdd($type, \URL::to('/dashboard/users/attributes', 'view'));
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:6,代码来源:attributes.php

示例12: add

 public function add()
 {
     $this->select_type();
     $type = $this->get('type');
     $cnt = $type->getController();
     $e = $cnt->validateKey($this->post());
     if ($e->has()) {
         $this->error = $e;
     } else {
         $type = AttributeType::getByID($this->post('atID'));
         $ak = UserAttributeKey::add($type, $this->post());
         $this->redirect('/dashboard/users/attributes/', 'attribute_created');
     }
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:14,代码来源:attributes.php

示例13: edit

 public function edit($akID = 0)
 {
     if ($this->post('akID')) {
         $akID = $this->post('akID');
     }
     $key = StoreProductKey::getByID($akID);
     $type = $key->getAttributeType();
     $this->set('key', $key);
     $this->set('type', $type);
     $this->set('category', AttributeKeyCategory::getByHandle('store_product'));
     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/store/products/attributes', 'updated');
         }
     }
 }
开发者ID:Janoinen,项目名称:vivid_store,代码行数:24,代码来源:attributes.php

示例14: getAttributeTypeObject

 public function getAttributeTypeObject()
 {
     $ato = \Concrete\Core\Attribute\Type::getByID($this->atID);
     return $ato;
 }
开发者ID:meixelsberger,项目名称:concrete5-5.7.0,代码行数:5,代码来源:Value.php

示例15: 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->error = $e;
         } else {
             $type = AttributeType::getByID($this->post('atID'));
             $key->update($this->post());
             $this->redirect('/dashboard/pages/attributes/', 'attribute_updated');
         }
     }
 }
开发者ID:digideskio,项目名称:concrete5,代码行数:25,代码来源:attributes.php


注:本文中的Concrete\Core\Attribute\Type::getByID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。