/**
  * Init object type
  */
 public function __construct()
 {
     $this->type = MetadataPlugin::getApiValue(MetadataConditionType::METADATA_FIELD_MATCH);
 }
예제 #2
0
 public function objectDataChanged(BaseObject $object, $previousVersion = null, BatchJob $raisedJob = null)
 {
     // updated in the indexing server (sphinx)
     $relatedObject = kMetadataManager::getObjectFromPeer($object);
     if ($relatedObject && $relatedObject instanceof IIndexable) {
         $relatedObject->setUpdatedAt(time());
         $relatedObject->save();
         $relatedObject->indexToSearchIndex();
     }
     /** @var Metadata $object */
     if ($object->getObjectType() == MetadataObjectType::DYNAMIC_OBJECT && !$object->isLikeNew()) {
         /**
          * when dynamic object is modified, we need to reindex the metadata and the objects (users, entries)
          * that are referencing it
          */
         $profileFields = MetadataProfileFieldPeer::retrieveByPartnerAndRelatedMetadataProfileId($object->getPartnerId(), $object->getMetadataProfileId());
         $relatedMetadataProfiles = array();
         foreach ($profileFields as $profileField) {
             /** @var MetadataProfileField $profileField */
             if (in_array($profileField->getMetadataProfileId(), $relatedMetadataProfiles)) {
                 continue;
             }
             $filter = new MetadataFilter();
             $filter->set('_eq_metadata_profile_id', $profileField->getMetadataProfileId());
             $indexObjectType = kPluginableEnumsManager::apiToCore('IndexObjectType', MetadataPlugin::getApiValue(MetadataIndexObjectType::METADATA));
             kJobsManager::addIndexJob($object->getPartnerId(), $indexObjectType, $filter, true);
             $relatedMetadataProfiles[] = $profileField->getMetadataProfileId();
         }
     }
     if ($relatedObject instanceof entry) {
         kStorageExporter::reExportEntry($relatedObject);
     }
     return true;
 }
예제 #3
0
 /**
  * @return array
  */
 public static function getAdditionalDescriptions()
 {
     return array(MetadataPlugin::getApiValue(self::METADATA_FIELD_COMPARE) => 'Validate that all metadata elements number compared correctly to all listed numeric values.', MetadataPlugin::getApiValue(self::METADATA_FIELD_MATCH) => 'Validate that any of the metadata elements text matches any of listed textual values.', MetadataPlugin::getApiValue(self::METADATA_FIELD_CHANGED) => 'Check if metadata element changed between metadata versions.');
 }
예제 #4
0
 /**
  * @return array
  */
 public static function getAdditionalDescriptions()
 {
     return array(MetadataPlugin::getApiValue(self::METADATA) => 'Metadata');
 }