/**
  * Create a scheduled script that will store the modification made to an eZContentClass.
  *
  * @param eZContentClass Content class to be stored.
  * @param array[eZContentClassAttribute] Attributes of the new content class.
  * @param array Unordered view parameters
  */
 public function store(eZContentClass $class, array $attributes, array &$unorderedParameters)
 {
     $script = eZScheduledScript::create('syncobjectattributes.php', eZINI::instance('ezscriptmonitor.ini')->variable('GeneralSettings', 'PhpCliCommand') . ' extension/ezscriptmonitor/bin/' . eZScheduledScript::SCRIPT_NAME_STRING . ' -s ' . eZScheduledScript::SITE_ACCESS_STRING . ' --classid=' . $class->attribute('id'));
     $script->store();
     $unorderedParameters['ScheduledScriptID'] = $script->attribute('id');
     $class->storeVersioned($attributes, eZContentClass::VERSION_STATUS_MODIFIED);
 }
Ejemplo n.º 2
0
 /**
  * Publishes $toType to $newStatus.
  *
  * @param \eZ\Publish\SPI\Persistence\Content\Type $toType
  * @param int $newStatus
  */
 public function publishNewType(Type $toType, $newStatus)
 {
     $this->contentTypeGateway->publishTypeAndFields($toType->id, $toType->status, Type::STATUS_MODIFIED);
     $script = \eZScheduledScript::create('syncobjectattributes.php', \eZINI::instance('ezscriptmonitor.ini')->variable('GeneralSettings', 'PhpCliCommand') . ' extension/ezscriptmonitor/bin/' . \eZScheduledScript::SCRIPT_NAME_STRING . ' -s ' . \eZScheduledScript::SITE_ACCESS_STRING . ' --classid=' . $toType->id);
     $script->store();
 }