/** * @return array */ protected function getValues() { if ($this->values === null) { $this->values = array(); if ($this->contentClassAttribute->attribute('data_type_string') == 'ezobjectrelationlist') { //$field = ezfSolrDocumentFieldBase::generateSubattributeFieldName( $this->contentClassAttribute, 'name', 'string' ); //@todo errore nella definzione del nome del sottoattributo? verifaicare vedi anche in self::buildFetch //$field = ezfSolrDocumentFieldBase::$DocumentFieldName->lookupSchemaName( // ezfSolrDocumentFieldBase::SUBMETA_FIELD_PREFIX . $this->contentClassAttribute->attribute( 'identifier' ) . ezfSolrDocumentFieldBase::SUBATTR_FIELD_SEPARATOR . 'name', // 'string'); $field = ezfSolrDocumentFieldBase::$DocumentFieldName->lookupSchemaName(ezfSolrDocumentFieldBase::SUBATTR_FIELD_PREFIX . $this->contentClassAttribute->attribute('identifier') . ezfSolrDocumentFieldBase::SUBATTR_FIELD_SEPARATOR . 'name' . ezfSolrDocumentFieldBase::SUBATTR_FIELD_SEPARATOR, 'string'); } else { $field = ezfSolrDocumentFieldBase::generateAttributeFieldName($this->contentClassAttribute, 'string'); } $facets = array('field' => $field, 'name' => $this->attributes['name'], 'limit' => 300, 'sort' => 'alpha'); $fetchParameters = array('SearchContentClassID' => array($this->contentClassAttribute->attribute('contentclass_id')), 'Facet' => array($facets)); $data = $this->client->fetchRemoteNavigationList($fetchParameters); if (isset($data[$this->attributes['name']])) { $this->values = $data[$this->attributes['name']]; // setto i valori attivi e inietto il conto nel nome foreach ($this->values as $index => $value) { $current = (array) $this->attributes['value']; if (in_array($value['query'], $current)) { $this->values[$index]['active'] = true; } $this->values[$index]['query'] = OCFacetNavgationHelper::encodeValue($this->values[$index]['query']); if (isset($value['count']) && $value['count'] > 0) { $this->values[$index]['name'] = $value['name'] . ' (' . $value['count'] . ')'; } } } } return $this->values; }
public static function getFieldName(eZContentClassAttribute $classAttribute, $subAttribute = null, $context = 'search') { switch ($classAttribute->attribute('data_type_string')) { case 'ezinteger': return parent::generateAttributeFieldName($classAttribute, self::getClassAttributeType($classAttribute, null, $context)); break; default: break; } }
/** * Validates $data with the constraints defined on the class attribute * * @param $data * @param eZContentObjectAttribute $contentObjectAttribute * @param eZContentClassAttribute $classAttribute * * @return int */ function validateStringHTTPInput($data, $contentObjectAttribute, $classAttribute) { $maxLen = $classAttribute->attribute(self::MAX_LEN_FIELD); $textCodec = eZTextCodec::instance(false); if ($textCodec->strlen($data) > $maxLen and $maxLen > 0) { $contentObjectAttribute->setValidationError(ezpI18n::tr('kernel/classes/datatypes', 'The input text is too long. The maximum number of characters allowed is %1.'), $maxLen); return eZInputValidator::STATE_INVALID; } return eZInputValidator::STATE_ACCEPTED; }
public static function getFieldName( eZContentClassAttribute $classAttribute, $subAttribute = null ) { $contentClassAttributeIdentifier = $classAttribute->attribute( 'identifier' ); if ( $subAttribute != null ) { $suffix = self::getPostFix( $contentClassAttributeIdentifier ); return 'attr_'.$contentClassAttributeIdentifier.'_'.$subAttribute.$suffix; } return self::generateAttributeFieldName( $classAttribute, self::getClassAttributeType( $classAttribute ) ); }
/** * test for getFieldName() */ public function testGetFieldName() { $providerArray = array(); $ezcca1 = new eZContentClassAttribute(array('identifier' => 'title', 'data_type_string' => 'ezstring')); $expected1 = ezfSolrDocumentFieldBase::ATTR_FIELD_PREFIX . 'title_t'; $providerArray[] = array($expected1, $ezcca1, null); // Testing the default subattribute $ezcca2 = new eZContentClassAttribute(array('identifier' => 'dummy', 'data_type_string' => 'dummy_example')); $expected2 = ezfSolrDocumentFieldBase::ATTR_FIELD_PREFIX . 'dummy_t'; $providerArray[] = array($expected2, $ezcca2, null); //Testing the class/attribute/subattribute syntax, with the secondary subattribute of // the 'dummy' datatype $ezcca3 = $ezcca2; $expected3 = ezfSolrDocumentFieldBase::SUBATTR_FIELD_PREFIX . 'dummy-subattribute1_i'; $options3 = 'subattribute1'; $providerArray[] = array($expected3, $ezcca3, $options3); //Testing the class/attribute/subattribute syntax, with the default subattribute of // the 'dummy' datatype $ezcca5 = $ezcca2; $expected5 = ezfSolrDocumentFieldBase::ATTR_FIELD_PREFIX . 'dummy_t'; $options5 = 'subattribute2'; $providerArray[] = array($expected5, $ezcca5, $options5); //Testing the class/attribute/subattribute syntax for ezobjectrelation attributes $time4 = time(); $image4 = new ezpObject("image", 2); $image4->name = __METHOD__ . $time4; $image4->caption = __METHOD__ . $time4; $imageId4 = $image4->publish(); $srcObjId4 = 123456; $ezcca4 = new eZContentClassAttribute(array('id' => $time4, 'identifier' => 'image', 'data_type_string' => 'ezobjectrelation', 'data_int' => $imageId4)); $ezcca4->store(); //Create entry in ezcontentobject_link $q4 = "INSERT INTO ezcontentobject_link VALUES( {$ezcca4->attribute('id')}, {$srcObjId4}, 1, 123456, 0, 8, {$imageId4} );"; eZDB::instance()->query($q4); $expected4 = ezfSolrDocumentFieldBase::SUBATTR_FIELD_PREFIX . 'image-name_t'; $options4 = 'name'; $providerArray[] = array($expected4, $ezcca4, $options4); // Testing the class/attribute/subattribute syntax for ezobjectrelation attributes, with a subattribute of // a different type than the default Solr type : $ezcca5 = $ezcca4; $expected5 = ezfSolrDocumentFieldBase::SUBATTR_FIELD_PREFIX . 'image-caption_t'; $options5 = 'caption'; $providerArray[] = array($expected5, $ezcca5, $options5); // perform actual testing foreach ($providerArray as $input) { $expected = $input[0]; $contentClassAttribute = $input[1]; $options = $input[2]; self::assertEquals($expected, ezfSolrDocumentFieldBase::getFieldName($contentClassAttribute, $options)); } }
public static function getFieldName(eZContentClassAttribute $classAttribute, $subAttribute = null, $context = 'search') { switch ($classAttribute->attribute('data_type_string')) { case 'ezmatrix': if ($subAttribute and $subAttribute !== '') { // A subattribute was passed return parent::generateSubattributeFieldName($classAttribute, $subAttribute, self::DEFAULT_SUBATTRIBUTE_TYPE); } else { // return the default field name here. return parent::generateAttributeFieldName($classAttribute, self::getClassAttributeType($classAttribute, null, $context)); } break; } return null; }
/** * @param eZContentObjectAttribute $contentObjectAttribute the attribute to serialize * @return array for further processing */ public static function getAttributeData ( eZContentObjectAttribute $contentObjectAttribute ) { $dataTypeIdentifier = $contentObjectAttribute->attribute( 'data_type_string' ); $contentClassAttribute = eZContentClassAttribute::fetch( $contentObjectAttribute->attribute( 'contentclassattribute_id' ) ); $attributeHandler = $dataTypeIdentifier . 'SolrStorage'; // prefill the array with generic metadata first $target = array ( 'data_type_identifier' => $dataTypeIdentifier, 'version_format' => self::STORAGE_VERSION_FORMAT, 'attribute_identifier' => $contentClassAttribute->attribute( 'identifier' ), 'has_content' => $contentObjectAttribute->hasContent(), ); if ( class_exists( $attributeHandler ) ) { $attributeContent = call_user_func( array( $attributeHandler, 'getAttributeContent' ), $contentObjectAttribute, $contentClassAttribute ); return array_merge( $target, $attributeContent, array( 'content_method' => self::CONTENT_METHOD_CUSTOM_HANDLER ) ); } else { $target = array_merge( $target, array( 'content_method' => self::CONTENT_METHOD_TOSTRING, 'content' => $contentObjectAttribute->toString(), 'has_rendered_content' => false, 'rendered' => null )); return $target; } }
public function buildFetch() { $filters = array(); foreach ($this->requestFields as $key => $value) { if (strpos($key, OCClassSearchFormAttributeField::NAME_PREFIX) !== false) { $contentClassAttributeID = str_replace(OCClassSearchFormAttributeField::NAME_PREFIX, '', $key); $contentClassAttribute = eZContentClassAttribute::fetch($contentClassAttributeID); if ($contentClassAttribute instanceof eZContentClassAttribute) { $field = OCClassSearchFormAttributeField::instance($contentClassAttribute); $field->buildFetch($this, $key, $value, $filters); $this->isFetch = true; } } elseif (in_array($key, OCFacetNavgationHelper::$allowedUserParamters)) { if (!empty($value)) { $this->currentParameters[$key] = $value; $this->isFetch = true; } } elseif ($key == 'class_id') { $this->currentParameters[$key] = $value; $this->addFetchField(array('name' => ezpI18n::tr('extension/ezfind/facets', 'Content type'), 'value' => eZContentClass::fetch($value)->attribute('name'), 'remove_view_parameters' => $this->getViewParametersString(array($key)))); $this->isFetch = true; } elseif ($key == 'publish_date') { $publishedField = new OCClassSearchFormPublishedField($this->requestFields['class_id']); $publishedField->buildFetch($this, $value, $filters); $this->isFetch = true; } elseif ($key == 'query') { $queryField = new OCClassSearchFormQueryField(); $queryField->buildFetch($this, $value); $this->searchText = $queryField->queryText(); $this->isFetch = true; } } $this->currentParameters['filter'] = $filters; return $this->currentParameters; }
/** * #15898: Cannot translate a user content object * Make sure datatype translation flag is honored. * * @link http://issues.ez.no/15898 */ public function testAttributeIsTranslatable() { $stringAttribute = eZContentClassAttribute::create(0, 'ezstring'); $this->assertEquals(1, $stringAttribute->attribute('can_translate'), 'ezstring class attribute should have been translatable by default'); $stringAttribute = eZContentClassAttribute::create(0, 'ezuser'); $this->assertEquals(0, $stringAttribute->attribute('can_translate'), 'ezuser class attribute should NOT have been translatable by default'); }
function validateClassAttributeHTTPInput($http, $base, $classAttribute) { //checking if the recaptcha key is set up if recaptcha is enabled $ini = eZINI::instance('ezcomments.ini'); $fields = $ini->variable('FormSettings', 'AvailableFields'); if (in_array('recaptcha', $fields)) { $publicKey = $ini->variable('RecaptchaSetting', 'PublicKey'); $privateKey = $ini->variable('RecaptchaSetting', 'PrivateKey'); if ($publicKey === '' || $privateKey === '') { eZDebug::writeNotice('reCAPTCHA key is not set up. For help please visit http://projects.ez.no/ezcomments', __METHOD__); } } if ($http->hasPostVariable('StoreButton') || $http->hasPostVariable('ApplyButton')) { // find the class and count how many Comments dattype $cond = array('contentclass_id' => $classAttribute->attribute('contentclass_id'), 'version' => eZContentClass::VERSION_STATUS_TEMPORARY, 'data_type_string' => $classAttribute->attribute('data_type_string')); $classAttributeList = eZContentClassAttribute::fetchFilteredList($cond); // if there is more than 1 comment attribute, return it as INVALID if (!is_null($classAttributeList) && count($classAttributeList) > 1) { if ($classAttributeList[0]->attribute('id') == $classAttribute->attribute('id')) { eZDebug::writeNotice('There are more than 1 comment attribute in the class.', __METHOD__); return eZInputValidator::STATE_INVALID; } } } return eZInputValidator::STATE_ACCEPTED; }
function classAttributeName() { if ($this->ClassAttributeName === null) { $contentClassAttribute = eZContentClassAttribute::fetch($this->attribute('contentclass_attribute_id')); $this->ClassAttributeName = $contentClassAttribute->attribute('name'); } return $this->ClassAttributeName; }
/** * Validates $data with the constraints defined on the class attribute * * @param $data * @param eZContentObjectAttribute $contentObjectAttribute * @param eZContentClassAttribute $classAttribute * * @return int */ function validateIntegerHTTPInput($data, $contentObjectAttribute, $classAttribute) { $min = $classAttribute->attribute(self::MIN_VALUE_FIELD); $max = $classAttribute->attribute(self::MAX_VALUE_FIELD); $input_state = $classAttribute->attribute(self::INPUT_STATE_FIELD); switch ($input_state) { case self::NO_MIN_MAX_VALUE: $this->IntegerValidator->setRange(false, false); $state = $this->IntegerValidator->validate($data); if ($state === eZInputValidator::STATE_INVALID || $state === eZInputValidator::STATE_INTERMEDIATE) { $contentObjectAttribute->setValidationError(ezpI18n::tr('kernel/classes/datatypes', 'The input is not a valid integer.')); } else { return $state; } break; case self::HAS_MIN_VALUE: $this->IntegerValidator->setRange($min, false); $state = $this->IntegerValidator->validate($data); if ($state === eZInputValidator::STATE_ACCEPTED) { return eZInputValidator::STATE_ACCEPTED; } else { $contentObjectAttribute->setValidationError(ezpI18n::tr('kernel/classes/datatypes', 'The number must be greater than %1'), $min); } break; case self::HAS_MAX_VALUE: $this->IntegerValidator->setRange(false, $max); $state = $this->IntegerValidator->validate($data); if ($state === 1) { return eZInputValidator::STATE_ACCEPTED; } else { $contentObjectAttribute->setValidationError(ezpI18n::tr('kernel/classes/datatypes', 'The number must be less than %1'), $max); } break; case self::HAS_MIN_MAX_VALUE: $this->IntegerValidator->setRange($min, $max); $state = $this->IntegerValidator->validate($data); if ($state === 1) { return eZInputValidator::STATE_ACCEPTED; } else { $contentObjectAttribute->setValidationError(ezpI18n::tr('kernel/classes/datatypes', 'The number is not within the required range %1 - %2'), $min, $max); } break; } return eZInputValidator::STATE_INVALID; }
/** * Validates $data with the constraints defined on the class attribute * * @param $data * @param eZContentObjectAttribute $contentObjectAttribute * @param eZContentClassAttribute $classAttribute * * @return int */ function validateFloatHTTPInput($data, $contentObjectAttribute, $classAttribute) { $min = $classAttribute->attribute(self::MIN_FIELD); $max = $classAttribute->attribute(self::MAX_FIELD); $inputState = $classAttribute->attribute(self::INPUT_STATE_FIELD); switch ($inputState) { case self::NO_MIN_MAX_VALUE: $state = $this->FloatValidator->validate($data); if ($state === eZInputValidator::STATE_ACCEPTED) { return eZInputValidator::STATE_ACCEPTED; } else { $contentObjectAttribute->setValidationError(ezpI18n::tr('kernel/classes/datatypes', 'The given input is not a floating point number.')); } break; case self::HAS_MIN_VALUE: $this->FloatValidator->setRange($min, false); $state = $this->FloatValidator->validate($data); if ($state === eZInputValidator::STATE_ACCEPTED) { return eZInputValidator::STATE_ACCEPTED; } else { $contentObjectAttribute->setValidationError(ezpI18n::tr('kernel/classes/datatypes', 'The input must be greater than %1'), $min); } break; case self::HAS_MAX_VALUE: $this->FloatValidator->setRange(false, $max); $state = $this->FloatValidator->validate($data); if ($state === eZInputValidator::STATE_ACCEPTED) { return eZInputValidator::STATE_ACCEPTED; } else { $contentObjectAttribute->setValidationError(ezpI18n::tr('kernel/classes/datatypes', 'The input must be less than %1'), $max); } break; case self::HAS_MIN_MAX_VALUE: $this->FloatValidator->setRange($min, $max); $state = $this->FloatValidator->validate($data); if ($state === eZInputValidator::STATE_ACCEPTED) { return eZInputValidator::STATE_ACCEPTED; } else { $contentObjectAttribute->setValidationError(ezpI18n::tr('kernel/classes/datatypes', 'The input is not in defined range %1 - %2'), $min, $max); } break; } return eZInputValidator::STATE_INVALID; }
/** * Adds new content class attribute to initialized class. * * @param string $name * @param string $identifier * @param string $type * @return eZContentClassAttribute */ public function add($name = 'Test attribute', $identifer = 'test_attribute', $type = 'ezstring') { $classAttribute = eZContentClassAttribute::create($this->id, $type, array(), $this->language); $classAttribute->setName($name, $this->language); $dataType = $classAttribute->dataType(); $dataType->initializeClassAttribute($classAttribute); $classAttribute->setAttribute('identifier', $identifer); $classAttribute->store(); return $classAttribute; }
/** * Test scenario for issue #13712: Multiprice datatype shows wrong price after multiple calls in template * * Test Outline * ------------ * 1. Create a euro currency * 2. Create a VAT type of 10 % * 3. Create a content class with an attribute of the datatype ezmultiprice * 4. Create a content object of this content class and set a custom price ex. VAT with the VAT type of 10% that we created * 5. Subsequently retrieve the attribute 'inc_vat_price_list' * * @result: the returned eZMultiPriceData instances differ on each call, their values are increased each time with VAT * @expected: the returned eZMultiPriceData instances are equal * @link http://issues.ez.no/13712 * @group issue_13712 */ public function testMultipleCallsToCalculatedPrice() { $currencyCode = 'EUR'; // create currency $currencyParams = array('code' => $currencyCode, 'symbol' => false, 'locale' => 'eng-GB', 'custom_rate_value' => 0, 'rate_factor' => 1); $currency = eZCurrencyData::create($currencyCode, '€', 'eng-GB', 0, 0, 1); $currency->store(); $currencyID = $currency->attribute('id'); $this->assertInternalType('integer', $currencyID); // create VAT type $row = array('name' => 'Test', 'percentage' => 10.0); $vatType = new eZVatType($row); $vatType->store(); $vatTypeID = $vatType->attribute('id'); $this->assertInternalType('integer', $vatTypeID); $class = eZContentClass::create(false, array('name' => 'eZMultiPrice::testMultipleCallsToCalculatedPrice', 'identifier' => 'ezmultiprice_test')); $class->store(); $classID = $class->attribute('id'); $this->assertInternalType('integer', $classID); $attributes = $class->fetchAttributes(); // add class attributes $newAttribute = eZContentClassAttribute::create($classID, 'ezmultiprice', array('name' => 'Test', 'identifier' => 'test')); $dataType = $newAttribute->dataType(); $dataType->initializeClassAttribute($newAttribute); $newAttribute->setAttribute(eZMultiPriceType::DEFAULT_CURRENCY_CODE_FIELD, $currencyCode); $newAttribute->setAttribute(eZMultiPriceType::VAT_ID_FIELD, $vatTypeID); $newAttribute->store(); $attributes[] = $newAttribute; $class->storeDefined($attributes); $contentObject = $class->instantiate(); $version = $contentObject->currentVersion(); $dataMap = $version->dataMap(); $multiPrice = $dataMap['test']->content(); $multiPrice->setAttribute('selected_vat_type', $vatTypeID); $multiPrice->setAttribute('is_vat_included', eZMultiPriceType::EXCLUDED_VAT); $multiPrice->setCustomPrice($currencyCode, 100); $multiPrice->updateAutoPriceList(); $dataMap['test']->setContent($multiPrice); $dataMap['test']->setAttribute('data_text', $vatTypeID . ',' . eZMultiPriceType::EXCLUDED_VAT); $dataMap['test']->store(); // test values $firstIncVatPriceList = $multiPrice->attribute('inc_vat_price_list'); $this->assertArrayHasKey('EUR', $firstIncVatPriceList); $firstCallValue = $firstIncVatPriceList['EUR']->attribute('value'); $secondIncVatPriceList = $multiPrice->attribute('inc_vat_price_list'); $this->assertArrayHasKey('EUR', $secondIncVatPriceList); $secondCallValue = $secondIncVatPriceList['EUR']->attribute('value'); $this->assertEquals($firstCallValue, $secondCallValue); $thirdIncVatPriceList = $multiPrice->attribute('inc_vat_price_list'); $this->assertArrayHasKey('EUR', $thirdIncVatPriceList); $thirdCallValue = $thirdIncVatPriceList['EUR']->attribute('value'); $this->assertEquals($firstCallValue, $thirdCallValue); }
/** * Fetch content class attributes by dataTypestring * * @param array $imageDataTypeStrings array of image datatype strings. ie: array( 'ezimage' ) * @return array Array of content class attributes, empty array if not * @static */ static function fetchContentClassImageAttributes($imageDataTypeStrings = false) { $contentClassImageAttributes = array(); if (!is_array($imageDataTypeStrings)) { // Default datatypes to create image alias variations $imageDataTypeStrings = eZINI::instance('bcimagealias.ini')->variable('BCImageAliasSettings', 'ImageDataTypeStringList'); } foreach ($imageDataTypeStrings as $dataTypeString) { $contentClassImageAttributes = array_merge($contentClassImageAttributes, eZContentClassAttribute::fetchList(true, array('data_type' => $dataTypeString))); } return $contentClassImageAttributes; }
public static function fetchMapMarkers($parentNodeId, $childrenClassIdentifiers) { foreach ($childrenClassIdentifiers as $key => $value) { if (empty($value)) { unset($childrenClassIdentifiers[$key]); } } $sortBy = array('name' => 'asc'); $result = array(); if ($parentNode = self::getNode($parentNodeId)) { if (!empty($childrenClassIdentifiers)) { $childrenClassTypes = (array) eZContentClass::fetchList(0, true, false, null, null, $childrenClassIdentifiers); } else { $childrenClassTypes = self::getChildrenClasses($parentNodeId); } // ricavo gli attributi delle classi $geoAttributes = array(); foreach ($childrenClassTypes as $classType) { if ($classType instanceof eZContentClass) { $geoAttributes = array_merge($geoAttributes, eZContentClassAttribute::fetchFilteredList(array('contentclass_id' => $classType->attribute('id'), 'version' => $classType->attribute('version'), 'data_type_string' => 'ezgmaplocation'))); } } if (count($geoAttributes)) { // imposto i filtri di ricerca $geoFields = $geoFieldsNames = array(); foreach ($geoAttributes as $geoAttribute) { if ($geoAttribute instanceof eZContentClassAttribute) { $geoFields[$geoAttribute->attribute('identifier')] = $geoAttribute->attribute('name'); $geoFieldsNames[] = "subattr_{$geoAttribute->attribute('identifier')}___coordinates____gpt"; } } $childrenParameters = array('SearchSubTreeArray' => array($parentNode->attribute('node_id')), 'Filter' => array('-meta_id_si:' . $parentNode->attribute('contentobject_id')), 'SearchLimit' => 1000, 'AsObjects' => false, 'SortBy' => $sortBy, 'FieldsToReturn' => $geoFieldsNames); // cerco i figli $solr = new OCSolr(); $children = $solr->search('', $childrenParameters); if ($children['SearchCount'] > 0) { foreach ($children['SearchResult'] as $item) { foreach ($geoFieldsNames as $geoFieldsName) { @(list($longitude, $latitude) = explode(',', $item['fields'][$geoFieldsName][0])); if (intval($latitude) > 0 && intval($longitude) > 0) { $href = isset($item['main_url_alias']) ? $item['main_url_alias'] : $item['main_url_alias_ms']; eZURI::transformURI($href, false, 'full'); $popup = isset($item['name']) ? $item['name'] : $item['name_t']; $id = isset($item['id_si']) ? $item['id_si'] : $item['id']; $result[] = array('id' => $id, 'type' => null, 'lat' => floatval($latitude), 'lon' => floatval($longitude), 'lng' => floatval($longitude), 'popupMsg' => $popup, 'title' => $popup, 'description' => "<h3><a href='{$href}'>{$popup}</a></h3>", 'urlAlias' => $href, 'objectID' => $id); } } } } } } return array('result' => $result); }
function classAttributeName() { if ($this->ClassAttributeName === null) { $contentClassAttribute = eZContentClassAttribute::fetch($this->attribute('contentclass_attribute_id')); if (!$contentClassAttribute instanceof eZContentClassAttribute) { eZDebug::writeError('Unable to find eZContentClassAttribute #' . $this->attribute('contentclass_attribute_id'), __METHOD__); return null; } $this->ClassAttributeName = $contentClassAttribute->attribute('name'); } return $this->ClassAttributeName; }
/** * Returns the ids of content classes that have an xmltext attribute * @return array(contentclass_id=>array(contentclassattribute_id)) */ function getClassList() { $affectedClasses = array(); $classAttributes = eZContentClassAttribute::fetchFilteredList(array('data_type_string' => 'ezxmltext', 'version' => eZContentClass::VERSION_STATUS_DEFINED), false); foreach ($classAttributes as $classAttribute) { $contentClassId = $classAttribute['contentclass_id']; if (!isset($affectedClasses[$contentClassId])) { $affectedClasses[$contentClassId] = array(); } $affectedClasses[$contentClassId][] = $classAttribute['identifier']; } return $affectedClasses; }
/** * Regression test for issue #15263 * Content object name/url of imported content classes aren't generated correctly * * @url http://issues.ez.no/15263 * * @outline * 1) Expire and force generation of class attribute cache * 2) Load a test package * 3) Install the package * 4) Publish an object of the imported class * 5) The object name / url alias shouldn't be the expected one **/ public function testIssue15263() { $adminUser = eZUser::fetchByName('admin'); $previousUser = eZUser::currentUser(); eZUser::setCurrentlyLoggedInUser($adminUser, $adminUser->attribute('contentobject_id')); // 1) Expire and force generation of class attribute cache $handler = eZExpiryHandler::instance(); $handler->setTimestamp('class-identifier-cache', time() - 1); $handler->store(); eZContentClassAttribute::classAttributeIdentifierByID(1); // 1) Load a test package $packageName = 'ezpackage_regression_testIssue15223.ezpkg'; $packageFilename = dirname(__FILE__) . DIRECTORY_SEPARATOR . $packageName; $packageImportTried = false; while (!$packageImportTried) { $package = eZPackage::import($packageFilename, $packageName); if (!$package instanceof eZPackage) { if ($package === eZPackage::STATUS_ALREADY_EXISTS) { $packageToRemove = eZPackage::fetch($packageName); $packageToRemove->remove(); } else { self::fail("An error occured loading the package '{$packageFilename}'"); } } $packageImportTried = true; } // 2) Install the package $installParameters = array('site_access_map' => array('*' => false), 'top_nodes_map' => array('*' => 2), 'design_map' => array('*' => false), 'restore_dates' => true, 'user_id' => $adminUser->attribute('contentobject_id'), 'non-interactive' => true, 'language_map' => $package->defaultLanguageMap()); $result = $package->install($installParameters); // 3) Publish an object of the imported class $object = new ezpObject('test_issue_15523', 2, $adminUser->attribute('contentobject_id'), 1); $object->myname = __METHOD__; $object->myothername = __METHOD__; $publishedObjectID = $object->publish(); unset($object); // 4) Test data from the publish object $publishedNodeArray = eZContentObjectTreeNode::fetchByContentObjectID($publishedObjectID); if (count($publishedNodeArray) != 1) { $this->fail("An error occured fetching node for object #{$publishedObjectID}"); } $publishedNode = $publishedNodeArray[0]; if (!$publishedNode instanceof eZContentObjectTreeNode) { $this->fail("An error occured fetching node for object #{$publishedObjectID}"); } else { $this->assertEquals("eZPackageRegression::testIssue15263", $publishedNode->attribute('name')); $this->assertEquals("eZPackageRegression-testIssue15263", $publishedNode->attribute('url_alias')); } // Remove the installed package & restore the logged in user $package->remove(); eZUser::setCurrentlyLoggedInUser($previousUser, $previousUser->attribute('contentobject_id')); }
function getClassConstraintListAsArray($class_identifier = false, $contentclass_id = false, $debug = false) { //todo debug if (!$contentclass_id && !$class_identifier) { return; } if ($contentclass_id && $class_identifier) { return; } $ezobjectrelationlist = eZContentClassAttribute::fetchFilteredList(array('data_type_string' => 'ezobjectrelationlist')); $return = array(); if ($contentclass_id) { foreach ($ezobjectrelationlist as $attribute) { if ($attribute->attribute('contentclass_id') == $contentclass_id) { $attributeContent = $attribute->content(); if (!empty($attributeContent['class_constraint_list'])) { $return = array_merge($return, $attributeContent['class_constraint_list']); } } } if (!empty($return)) { return $return; } else { return false; } } if ($class_identifier) { foreach ($ezobjectrelationlist as $attribute) { $attributeContent = $attribute->content(); if (!empty($attributeContent['class_constraint_list'])) { if (in_array($class_identifier, $attributeContent['class_constraint_list'])) { $class = eZContentClass::fetch($attribute->attribute('contentclass_id')); $classIdentifier = eZContentClass::classIdentifierByID($attribute->attribute('contentclass_id')); $return[$classIdentifier][] = array('class_id' => $attribute->attribute('contentclass_id'), 'class_name' => $class->attribute('name'), 'attribute_identifier' => $attribute->attribute('identifier'), 'attribute_name' => $attribute->attribute('name'), 'class_constraint_list' => $attributeContent['class_constraint_list'], 'search_filter' => $classIdentifier . '/' . $attribute->attribute('identifier') . '/main_node_id'); } } } //eZDebug::writeNotice( $return, __METHOD__ ); if (!empty($return)) { return $return; } else { return false; } } return false; }
function addEntry($contentClassAttributeID, $contentClassID = false) { if (!isset($contentClassAttributeID)) { return; } if (!$contentClassID) { $contentClassAttribute = eZContentClassAttribute::fetch($contentClassAttributeID); $contentClassID = $contentClassAttribute->attribute('contentclass_id'); } // Checking if $contentClassAttributeID and $contentClassID already exist (in Entries) foreach ($this->Entries as $entrie) { if ($entrie->attribute('contentclass_attribute_id') == $contentClassAttributeID and $entrie->attribute('contentclass_id') == $contentClassID) { return; } } $waitUntilDateValue = eZWaitUntilDateValue::create($this->WorkflowEventID, $this->WorkflowEventVersion, $contentClassAttributeID, $contentClassID); $waitUntilDateValue->store(); $this->Entries = eZWaitUntilDateValue::fetchAllElements($this->WorkflowEventID, $this->WorkflowEventVersion); }
/** * @param eZContentClassAttribute $attribute * * @return OCClassSearchFormAttributeField */ public static function instance(eZContentClassAttribute $attribute) { if (self::$fieldHandlers === null) { self::$fieldHandlers = array(); if (eZINI::instance('ocsearchtools.ini')->hasVariable('ClassSearchFormHandlers', 'AttributeHandlers')) { self::$fieldHandlers = eZINI::instance('ocsearchtools.ini')->variable('ClassSearchFormHandlers', 'AttributeHandlers'); } } if (!isset(self::$_instances[$attribute->attribute('id')])) { if (isset(self::$fieldHandlers[$attribute->attribute('data_type_string')]) && class_exists(self::$fieldHandlers[$attribute->attribute('data_type_string')])) { $className = self::$fieldHandlers[$attribute->attribute('data_type_string')]; } else { $className = 'OCClassSearchFormAttributeField'; } self::$_instances[$attribute->attribute('id')] = new $className($attribute); } return self::$_instances[$attribute->attribute('id')]; }
function validateClassAttributeHTTPInput($http, $base, $classAttribute) { $typeParam = $base . self::CLASS_TYPE . $classAttribute->attribute('id'); $fileParam = $base . self::CLASS_FILE . $classAttribute->attribute('id'); $sectionParam = $base . self::CLASS_SECTION . $classAttribute->attribute('id'); $parameterParam = $base . self::CLASS_PARAMETER . $classAttribute->attribute('id'); if ($http->hasPostVariable($fileParam) and $http->hasPostVariable($sectionParam) and $http->hasPostVariable($parameterParam) and $http->hasPostVariable($typeParam) and (int) $http->postVariable($typeParam) > 0 and (int) $http->postVariable($typeParam) <= 6) { $liveClassAttribute = eZContentClassAttribute::fetch($classAttribute->attribute('id')); if (is_object($liveClassAttribute)) { $new_type = (int) $http->postVariable($typeParam); $old_type = (int) $liveClassAttribute->attribute(self::CLASS_TYPE_FIELD); if ($new_type !== $old_type and ($new_type === ymcDynamicIniSetting::TYPE_ARRAY or $old_type === ymcDynamicIniSetting::TYPE_ARRAY)) { eZDebug::writeNotice('It is not possible to change an existing type from/to the array-type', 'ymcDynamicIniSettingType::validateClassAttributeHTTPInput'); return eZInputValidator::STATE_INVALID; } } return eZInputValidator::STATE_ACCEPTED; } eZDebug::writeNotice('Could not validate parameters: ' . "\n" . $fileParam . ':' . $http->postVariable($fileParam) . "\n" . $sectionParam . ':' . $http->postVariable($sectionParam) . "\n" . $parameterParam . ':' . $http->postVariable($parameterParam) . "\n" . $typeParam . ':' . $http->postVariable($typeParam), 'ymcDynamicIniSettingType::validateClassAttributeHTTPInput'); return eZInputValidator::STATE_INVALID; }
/** * Identifies, based on the existing object relations, the type of the subattribute. * * @param eZContentClassAttribute $classAttribute * @param $subAttribute * @param $context * * @return bool|string */ protected static function getTypeForSubattribute(eZContentClassAttribute $classAttribute, $subAttribute, $context) { $q = "SELECT DISTINCT( ezcoa.data_type_string )\n FROM ezcontentobject_link AS ezcol,\n ezcontentobject_attribute AS ezcoa,\n ezcontentclass_attribute AS ezcca,\n ezcontentclass_attribute AS ezcca_target\n WHERE ezcol.contentclassattribute_id={$classAttribute->attribute('id')}\n AND ezcca_target.identifier='{$subAttribute}'\n AND ezcca.data_type_string='{$classAttribute->attribute('data_type_string')}'\n AND ezcca.id=ezcol.contentclassattribute_id\n AND ezcol.to_contentobject_id = ezcoa.contentobject_id\n AND ezcoa.contentclassattribute_id = ezcca_target.id;\n "; $rows = eZDB::instance()->arrayQuery($q); if (count($rows) == 0) { return self::DEFAULT_SUBATTRIBUTE_TYPE; } if ($rows and count($rows) > 0) { if (count($rows) > 1) { $msg = "Multiple types were found for subattribute '{$subAttribute}' of class attribute #{$classAttribute->attribute('id')} [{$classAttribute->attribute('data_type_string')}]. This means that objects of different content classes were related through class attribute #{$classAttribute->attribute('id')} and had attributes named '{$subAttribute}' of different datatypes : \n" . print_r($rows, true) . " Picking the first one here : {$rows[0]['data_type_string']}"; eZDebug::writeWarning($msg, __METHOD__); } return ezfSolrDocumentFieldBase::getClassAttributeType(new eZContentClassAttribute($rows[0]), null, $context); } return false; }
/** * Return content action(s) which can be performed on object containing * the current datatype. Return format is array of arrays with key 'name' * and 'action'. 'action' can be mapped to url in datatype.ini * * @param eZContentClassAttribute $classAttribute * @return array */ function contentActionList($classAttribute) { $actionList = array(); if ($classAttribute instanceof eZContentClassAttribute) { if ($classAttribute->attribute('is_information_collector') == true) { $actionList[] = array('name' => ezpI18n::tr('kernel/classes/datatypes', 'Send', 'Datatype information collector action'), 'action' => 'ActionCollectInformation'); } } else { eZDebug::writeError('$classAttribute isn\'t an object.', __METHOD__); } return $actionList; }
/** * Get an array of all defined class attributes with ezxmltext datatype. * * @return array */ public function xmlClassAttributeIds() { if ($this->xmlClassAttributeIdArray === null) { // First we want to find all class attributes which are defined. We won't be touching // attributes which are in a transient state. $xmlTextAttributes = eZContentClassAttribute::fetchList(true, array('data_type' => 'ezxmltext', 'version' => 0)); $this->xmlClassAttributeIdArray = array(); foreach ($xmlTextAttributes as $classAttr) { $this->xmlClassAttributeIdArray[] = $classAttr->attribute('id'); } unset($xmlTextAttributes); } return $this->xmlClassAttributeIdArray; }
function install($package, $installType, $parameters, $name, $os, $filename, $subdirectory, $content, &$installParameters, &$installData) { $serializedNameListNode = $content->getElementsByTagName('serialized-name-list')->item(0); $serializedNameList = $serializedNameListNode ? $serializedNameListNode->textContent : false; $classNameList = new eZContentClassNameList($serializedNameList); if ($classNameList->isEmpty()) { $classNameList->initFromString($content->getElementsByTagName('name')->item(0)->textContent); // for backward compatibility( <= 3.8 ) } $classNameList->validate(); $serializedDescriptionListNode = $content->getElementsByTagName('serialized-description-list')->item(0); $serializedDescriptionList = $serializedDescriptionListNode ? $serializedDescriptionListNode->textContent : false; $classDescriptionList = new eZSerializedObjectNameList($serializedDescriptionList); $classIdentifier = $content->getElementsByTagName('identifier')->item(0)->textContent; $classRemoteID = $content->getElementsByTagName('remote-id')->item(0)->textContent; $classObjectNamePattern = $content->getElementsByTagName('object-name-pattern')->item(0)->textContent; $classURLAliasPattern = is_object($content->getElementsByTagName('url-alias-pattern')->item(0)) ? $content->getElementsByTagName('url-alias-pattern')->item(0)->textContent : null; $classIsContainer = $content->getAttribute('is-container'); if ($classIsContainer !== false) { $classIsContainer = $classIsContainer == 'true' ? 1 : 0; } $classRemoteNode = $content->getElementsByTagName('remote')->item(0); $classID = $classRemoteNode->getElementsByTagName('id')->item(0)->textContent; $classGroupsNode = $classRemoteNode->getElementsByTagName('groups')->item(0); $classCreated = $classRemoteNode->getElementsByTagName('created')->item(0)->textContent; $classModified = $classRemoteNode->getElementsByTagName('modified')->item(0)->textContent; $classCreatorNode = $classRemoteNode->getElementsByTagName('creator')->item(0); $classModifierNode = $classRemoteNode->getElementsByTagName('modifier')->item(0); $classAttributesNode = $content->getElementsByTagName('attributes')->item(0); $dateTime = time(); $classCreated = $dateTime; $classModified = $dateTime; $userID = false; if (isset($installParameters['user_id'])) { $userID = $installParameters['user_id']; } $class = eZContentClass::fetchByRemoteID($classRemoteID); if ($class) { $className = $class->name(); $description = ezpI18n::tr('kernel/package', "Class '%classname' already exists.", false, array('%classname' => $className)); $choosenAction = $this->errorChoosenAction(self::ERROR_EXISTS, $installParameters, $description, $this->HandlerType); switch ($choosenAction) { case eZPackage::NON_INTERACTIVE: case self::ACTION_REPLACE: if (eZContentClassOperations::remove($class->attribute('id')) == false) { eZDebug::writeWarning("Unable to remove class '{$className}'."); return true; } eZDebug::writeNotice("Class '{$className}' will be replaced.", 'eZContentClassPackageHandler'); break; case self::ACTION_SKIP: return true; case self::ACTION_NEW: $class->setAttribute('remote_id', eZRemoteIdUtility::generate('class')); $class->store(); $classNameList->appendGroupName(" (imported)"); break; default: $installParameters['error'] = array('error_code' => self::ERROR_EXISTS, 'element_id' => $classRemoteID, 'description' => $description, 'actions' => array()); if ($class->isRemovable()) { $errorMsg = ezpI18n::tr('kernel/package', "Replace existing class"); $objectsCount = eZContentObject::fetchSameClassListCount($class->attribute('id')); if ($objectsCount) { $errorMsg .= ' ' . ezpI18n::tr('kernel/package', "(Warning! {$objectsCount} content object(s) and their sub-items will be removed)"); } $installParameters['error']['actions'][self::ACTION_REPLACE] = $errorMsg; } $installParameters['error']['actions'][self::ACTION_SKIP] = ezpI18n::tr('kernel/package', 'Skip installing this class'); $installParameters['error']['actions'][self::ACTION_NEW] = ezpI18n::tr('kernel/package', 'Keep existing and create a new one'); return false; } } unset($class); // Try to create a unique class identifier $currentClassIdentifier = $classIdentifier; $unique = false; while (!$unique) { $classList = eZContentClass::fetchByIdentifier($currentClassIdentifier); if ($classList) { // "increment" class identifier if (preg_match('/^(.*)_(\\d+)$/', $currentClassIdentifier, $matches)) { $currentClassIdentifier = $matches[1] . '_' . ($matches[2] + 1); } else { $currentClassIdentifier = $currentClassIdentifier . '_1'; } } else { $unique = true; } unset($classList); } $classIdentifier = $currentClassIdentifier; $values = array('version' => 0, 'serialized_name_list' => $classNameList->serializeNames(), 'serialized_description_list' => $classDescriptionList->serializeNames(), 'create_lang_if_not_exist' => true, 'identifier' => $classIdentifier, 'remote_id' => $classRemoteID, 'contentobject_name' => $classObjectNamePattern, 'url_alias_name' => $classURLAliasPattern, 'is_container' => $classIsContainer, 'created' => $classCreated, 'modified' => $classModified); if ($content->hasAttribute('sort-field')) { $values['sort_field'] = eZContentObjectTreeNode::sortFieldID($content->getAttribute('sort-field')); } else { eZDebug::writeNotice('The sort field was not specified in the content class package. ' . 'This property is exported and imported since eZ Publish 4.0.2', __METHOD__); } if ($content->hasAttribute('sort-order')) { $values['sort_order'] = $content->getAttribute('sort-order'); } else { eZDebug::writeNotice('The sort order was not specified in the content class package. ' . 'This property is exported and imported since eZ Publish 4.0.2', __METHOD__); } if ($content->hasAttribute('always-available')) { $values['always_available'] = $content->getAttribute('always-available') === 'true' ? 1 : 0; } else { eZDebug::writeNotice('The default object availability was not specified in the content class package. ' . 'This property is exported and imported since eZ Publish 4.0.2', __METHOD__); } // create class $class = eZContentClass::create($userID, $values); $class->store(); $classID = $class->attribute('id'); if (!isset($installData['classid_list'])) { $installData['classid_list'] = array(); } if (!isset($installData['classid_map'])) { $installData['classid_map'] = array(); } $installData['classid_list'][] = $class->attribute('id'); $installData['classid_map'][$classID] = $class->attribute('id'); // create class attributes $classAttributeList = $classAttributesNode->getElementsByTagName('attribute'); foreach ($classAttributeList as $classAttributeNode) { $isNotSupported = strtolower($classAttributeNode->getAttribute('unsupported')) == 'true'; if ($isNotSupported) { continue; } $attributeDatatype = $classAttributeNode->getAttribute('datatype'); $attributeIsRequired = strtolower($classAttributeNode->getAttribute('required')) == 'true'; $attributeIsSearchable = strtolower($classAttributeNode->getAttribute('searchable')) == 'true'; $attributeIsInformationCollector = strtolower($classAttributeNode->getAttribute('information-collector')) == 'true'; $attributeIsTranslatable = strtolower($classAttributeNode->getAttribute('translatable')) == 'true'; $attributeSerializedNameListNode = $classAttributeNode->getElementsByTagName('serialized-name-list')->item(0); $attributeSerializedNameListContent = $attributeSerializedNameListNode ? $attributeSerializedNameListNode->textContent : false; $attributeSerializedNameList = new eZSerializedObjectNameList($attributeSerializedNameListContent); if ($attributeSerializedNameList->isEmpty()) { $attributeSerializedNameList->initFromString($classAttributeNode->getElementsByTagName('name')->item(0)->textContent); } // for backward compatibility( <= 3.8 ) $attributeSerializedNameList->validate(); $attributeSerializedDescriptionListNode = $classAttributeNode->getElementsByTagName('serialized-description-list')->item(0); $attributeSerializedDescriptionListContent = $attributeSerializedDescriptionListNode ? $attributeSerializedDescriptionListNode->textContent : false; $attributeSerializedDescriptionList = new eZSerializedObjectNameList($attributeSerializedDescriptionListContent); $attributeCategoryNode = $classAttributeNode->getElementsByTagName('category')->item(0); $attributeCategory = $attributeCategoryNode ? $attributeCategoryNode->textContent : ''; $attributeSerializedDataTextNode = $classAttributeNode->getElementsByTagName('serialized-description-text')->item(0); $attributeSerializedDataTextContent = $attributeSerializedDataTextNode ? $attributeSerializedDataTextNode->textContent : false; $attributeSerializedDataText = new eZSerializedObjectNameList($attributeSerializedDataTextContent); $attributeIdentifier = $classAttributeNode->getElementsByTagName('identifier')->item(0)->textContent; $attributePlacement = $classAttributeNode->getElementsByTagName('placement')->item(0)->textContent; $attributeDatatypeParameterNode = $classAttributeNode->getElementsByTagName('datatype-parameters')->item(0); $classAttribute = $class->fetchAttributeByIdentifier($attributeIdentifier); if (!$classAttribute) { $classAttribute = eZContentClassAttribute::create($class->attribute('id'), $attributeDatatype, array('version' => 0, 'identifier' => $attributeIdentifier, 'serialized_name_list' => $attributeSerializedNameList->serializeNames(), 'serialized_description_list' => $attributeSerializedDescriptionList->serializeNames(), 'category' => $attributeCategory, 'serialized_data_text' => $attributeSerializedDataText->serializeNames(), 'is_required' => $attributeIsRequired, 'is_searchable' => $attributeIsSearchable, 'is_information_collector' => $attributeIsInformationCollector, 'can_translate' => $attributeIsTranslatable, 'placement' => $attributePlacement)); $dataType = $classAttribute->dataType(); $classAttribute->store(); $dataType->unserializeContentClassAttribute($classAttribute, $classAttributeNode, $attributeDatatypeParameterNode); $classAttribute->sync(); } } // add class to a class group $classGroupsList = $classGroupsNode->getElementsByTagName('group'); foreach ($classGroupsList as $classGroupNode) { $classGroupName = $classGroupNode->getAttribute('name'); $classGroup = eZContentClassGroup::fetchByName($classGroupName); if (!$classGroup) { $classGroup = eZContentClassGroup::create(); $classGroup->setAttribute('name', $classGroupName); $classGroup->store(); } $classGroup->appendClass($class); } return true; }
/** * Get an array of class attribute identifiers based on either a class attribute * list, or a content classes list * * @param array $classIDArray * Classes to search in. Either an array of class ID, class identifiers, * a class ID or a class identifier. * Using numerical attribute/class identifiers for $classIDArray is more efficient. * @param array $classAttributeID * Class attributes to search in. Either an array of class attribute id, * or a single class attribute. Literal identifiers are not allowed. * @param array $fieldTypeExcludeList * filter list. List of field types to exclude. ( set to empty array by default ). * * @return array List of solr field names. */ protected function getClassAttributes($classIDArray = false, $classAttributeIDArray = false, $fieldTypeExcludeList = null) { eZDebug::createAccumulator('Class attribute list', 'eZ Find'); eZDebug::accumulatorStart('Class attribute list'); $fieldArray = array(); $classAttributeArray = array(); // classAttributeIDArray = simple integer (content class attribute ID) if (is_numeric($classAttributeIDArray) and $classAttributeIDArray > 0) { $classAttributeArray[] = eZContentClassAttribute::fetch($classAttributeIDArray); } else { if (is_array($classAttributeIDArray)) { foreach ($classAttributeIDArray as $classAttributeID) { $classAttributeArray[] = eZContentClassAttribute::fetch($classAttributeID); } } } // no class attribute list given, we need a class list // this block will create the class attribute array based on $classIDArray if (empty($classAttributeArray)) { // Fetch class list. $condArray = array("is_searchable" => 1, "version" => eZContentClass::VERSION_STATUS_DEFINED); if (!$classIDArray) { $classIDArray = array(); } else { if (!is_array($classIDArray)) { $classIDArray = array($classIDArray); } } // literal class identifiers are converted to numerical ones $tmpClassIDArray = $classIDArray; $classIDArray = array(); foreach ($tmpClassIDArray as $key => $classIdentifier) { if (!is_numeric($classIdentifier)) { if (!($contentClass = eZContentClass::fetchByIdentifier($classIdentifier, false))) { eZDebug::writeWarning("Unknown content class identifier '{$classIdentifier}'", __METHOD__); } else { $classIDArray[] = $contentClass['id']; } } else { $classIDArray[] = $classIdentifier; } } if (!empty($classIDArray)) { $condArray['contentclass_id'] = array($classIDArray); } $classAttributeArray = eZContentClassAttribute::fetchFilteredList($condArray); } // $classAttributeArray now contains a list of eZContentClassAttribute // we can use to construct the list of fields solr should search in // @TODO : retrieve sub attributes here. Mind the types ! foreach ($classAttributeArray as $classAttribute) { $fieldArray = array_merge(ezfSolrDocumentFieldBase::getFieldNameList($classAttribute, $fieldTypeExcludeList), $fieldArray); } // the array is unified + sorted in order to make it consistent $fieldArray = array_unique($fieldArray); sort($fieldArray); eZDebug::accumulatorStop('Class attribute list'); return $fieldArray; }
/** * Expires in-memory cache for eZContentClass. * * Clears cache for fetched eZContentClass objects, * class identifiers and class attributes. * * @since 4.2 */ public static function expireCache() { unset($GLOBALS['eZContentClassObjectCache']); self::$identifierHash = null; eZContentClassAttribute::expireCache(); }