本文整理汇总了PHP中AttributeKeyCategory::add方法的典型用法代码示例。如果您正苦于以下问题:PHP AttributeKeyCategory::add方法的具体用法?PHP AttributeKeyCategory::add怎么用?PHP AttributeKeyCategory::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AttributeKeyCategory
的用法示例。
在下文中一共展示了AttributeKeyCategory::add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: installCoreAttributeItems
protected function installCoreAttributeItems() {
$cakc = AttributeKeyCategory::getByHandle('collection');
if (is_object($cakc)) {
return false;
}
$cakc = AttributeKeyCategory::add('collection');
$uakc = AttributeKeyCategory::add('user');
$fakc = AttributeKeyCategory::add('file');
$tt = AttributeType::add('text', t('Text'));
$textareat = AttributeType::add('textarea', t('Text Area'));
$boolt = AttributeType::add('boolean', t('Checkbox'));
$dtt = AttributeType::add('date_time', t('Date/Time'));
$ift = AttributeType::add('image_file', t('Image/File'));
$nt = AttributeType::add('number', t('Number'));
$rt = AttributeType::add('rating', t('Rating'));
$st = AttributeType::add('select', t('Select'));
$addresst = AttributeType::add('address', t('Address'));
// assign collection attributes
$cakc->associateAttributeKeyType($tt);
$cakc->associateAttributeKeyType($textareat);
$cakc->associateAttributeKeyType($boolt);
$cakc->associateAttributeKeyType($dtt);
$cakc->associateAttributeKeyType($ift);
$cakc->associateAttributeKeyType($nt);
$cakc->associateAttributeKeyType($rt);
$cakc->associateAttributeKeyType($st);
// assign user attributes
$uakc->associateAttributeKeyType($tt);
$uakc->associateAttributeKeyType($textareat);
$uakc->associateAttributeKeyType($boolt);
$uakc->associateAttributeKeyType($dtt);
$uakc->associateAttributeKeyType($nt);
$uakc->associateAttributeKeyType($st);
$uakc->associateAttributeKeyType($addresst);
// assign file attributes
$fakc->associateAttributeKeyType($tt);
$fakc->associateAttributeKeyType($textareat);
$fakc->associateAttributeKeyType($boolt);
$fakc->associateAttributeKeyType($dtt);
$fakc->associateAttributeKeyType($nt);
$fakc->associateAttributeKeyType($rt);
$fakc->associateAttributeKeyType($st);
}
示例2: importAttributeCategories
protected function importAttributeCategories(SimpleXMLElement $sx) {
if (isset($sx->attributecategories)) {
foreach($sx->attributecategories->category as $akc) {
$pkg = ContentImporter::getPackageObject($akc['package']);
$akx = AttributeKeyCategory::add($akc['handle'], $akc['allow-sets'], $pkg);
}
}
}