Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function getDefaultParams()
 {
     return $this->_content->getDefaultParams();
 }
Пример #2
0
 /**
  * Executes revert action on content and its draft.
  *
  * @param  AbstractClassContent $content
  * @param  Revision      $draft
  * @param  array         $data
  * @return self
  */
 private function executeRevert(AbstractClassContent $content, Revision $draft, array $data)
 {
     if ($content instanceof ContentSet) {
         if (isset($data['elements']) && true === $data['elements']) {
             $draft->clear();
             foreach ($content->getData() as $element) {
                 $draft->push($element);
             }
         }
     } else {
         foreach ($content->getData() as $key => $element) {
             if (isset($data['elements']) && in_array($key, $data['elements'])) {
                 $draft->{$key} = $content->{$key};
             }
         }
     }
     if (isset($data['parameters'])) {
         foreach ($content->getDefaultParams() as $key => $params) {
             if (in_array($key, $data['parameters'])) {
                 $draft->setParam($key, $content->getParamValue($key));
             }
         }
     }
     return $this;
 }