本文整理汇总了PHP中Concrete\Core\Attribute\Key\Category::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP Category::getList方法的具体用法?PHP Category::getList怎么用?PHP Category::getList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Concrete\Core\Attribute\Key\Category
的用法示例。
在下文中一共展示了Category::getList方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getResults
public function getResults(Request $request)
{
$list = Category::getList();
$items = array();
foreach ($list as $t) {
$item = new \PortlandLabs\Concrete5\MigrationTool\Entity\Export\AttributeKeyCategory();
$item->setItemId($t->getAttributeKeyCategoryID());
$items[] = $item;
}
return $items;
}
示例2: 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');
}
示例3: 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');
}
示例4: t
<?php
defined('C5_EXECUTE') or die("Access Denied.");
use Concrete\Core\Attribute\Type as AttributeType;
use Concrete\Core\Attribute\Key\Category as AttributeKeyCategory;
use Concrete\Core\Attribute\PendingType as PendingAttributeType;
$types = AttributeType::getList();
$categories = AttributeKeyCategory::getList();
$txt = Loader::helper('text');
$form = Loader::helper('form');
$interface = Loader::helper('concrete/ui');
echo Loader::helper('concrete/dashboard')->getDashboardPaneHeaderWrapper(t('Attribute Type Associations'), false, 'span10 offset1');
?>
<form method="post" class="" id="attribute_type_associations_form" action="<?php
echo $view->action('save_attribute_type_associations');
?>
">
<table border="0" cellspacing="1" cellpadding="0" border="0" class="table">
<tr>
<th><?php
echo t('Name');
?>
</th>
<?php
foreach ($categories as $cat) {
?>
<th><?php
echo $txt->unhandle($cat->getAttributeKeyCategoryHandle());
?>
</th>
<?php
示例5: exportList
public static function exportList($xml)
{
$categories = AttributeKeyCategory::getList();
$axml = $xml->addChild('attributekeys');
foreach ($categories as $cat) {
$attributes = static::getList($cat->getAttributeKeyCategoryHandle());
foreach ($attributes as $at) {
$at->export($axml);
}
}
}
示例6: die
<?php
defined('C5_EXECUTE') or die('Access Denied.');
use Concrete\Core\Attribute\Key\Category as AttributeCategory;
$valt = Loader::helper('validation/token');
$ci = Loader::helper('concrete/urls');
$ch = Loader::helper('concrete/ui');
$tp = new TaskPermission();
if ($tp->canInstallPackages()) {
$mi = Marketplace::getInstance();
}
$pkgArray = Package::getInstalledList();
$ci = \Core::make('helper/concrete/urls');
$txt = \Core::make('helper/text');
$nav = \Core::make('helper/navigation');
$catList = AttributeCategory::getList();
if (is_object($pkg)) {
$pkgID = $pkg->getPackageID();
}
if ($this->controller->getTask() == 'install_package' && $showInstallOptionsScreen && $tp->canInstallPackages()) {
?>
<form method="post" action="<?php
echo $this->action('install_package', $pkg->getPackageHandle());
?>
">
<?php
echo Loader::helper('validation/token')->output('install_options_selected');
?>
<?php
echo Loader::packageElement('dashboard/install', $pkg->getPackageHandle());
?>
示例7: delete
/**
* Removes a file, including all of its versions.
*/
public function delete($removeNode = true)
{
// first, we remove all files from the drive
$db = Loader::db();
$em = $db->getEntityManager();
// fire an on_page_delete event
$fve = new \Concrete\Core\File\Event\DeleteFile($this);
$fve = Events::dispatch('on_file_delete', $fve);
if (!$fve->proceed()) {
return false;
}
// Delete the tree node for the file.
if ($removeNode) {
$nodeID = $db->fetchColumn('select treeNodeID from TreeFileNodes where fID = ?', [$this->getFileID()]);
if ($nodeID) {
$node = Node::getByID($nodeID);
$node->delete();
}
}
$versions = $this->getVersionList();
foreach ($versions as $fv) {
$fv->delete(true);
}
$db->Execute("delete from FileSetFiles where fID = ?", [$this->fID]);
$db->Execute("delete from FileSearchIndexAttributes where fID = ?", [$this->fID]);
$db->Execute("delete from DownloadStatistics where fID = ?", [$this->fID]);
$db->Execute("delete from FilePermissionAssignments where fID = ?", [$this->fID]);
$query = $em->createQuery('select fav from Concrete\\Core\\Entity\\Attribute\\Value\\Value\\ImageFileValue fav inner join fav.file f where f.fID = :fID');
$query->setParameter('fID', $this->getFileID());
$values = $query->getResult();
foreach ($values as $genericValue) {
foreach (Category::getList() as $category) {
$category = $category->getController();
/**
* @var $category AbstractCategory
*/
$values = $category->getAttributeValueRepository()->findBy(['generic_value' => $genericValue]);
foreach ($values as $attributeValue) {
$category->deleteValue($attributeValue);
}
}
}
$db->Execute("delete from Files where fID = ?", [$this->fID]);
}
示例8: view
public function view()
{
$this->set('categories', AttributeKeyCategory::getList());
}
示例9: defined
<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
$form = Core::make('helper/form');
$categories = array();
$list = \Concrete\Core\Attribute\Key\Category::getList();
foreach ($list as $category) {
$categories[$category->getAttributeKeyCategoryID()] = $category->getAttributeKeyCategoryHandle();
}
?>
<div class="form-group">
<?php
echo $form->label('category', t('Attribute Category'));
?>
<?php
echo $form->select('akCategoryID', $categories);
?>
</div>
示例10: view
public function view()
{
parent::view();
$this->set('text', \Core::make('helper/text'));
$this->set('categories', Category::getList());
}