Exemplo n.º 1
0
 public function testFormatValueForPublicationState()
 {
     $doc = new Opus_Document(3);
     $field = $doc->getField('PublicationState');
     $output = $this->__helper->format($field, 'Opus_Document');
     // PublicationState is not translated right now
     $this->assertEquals('draft', $output);
 }
Exemplo n.º 2
0
 /**
  * Aktualisiert die Liste der zugewiesenen Collections für ein Dokument.
  * 
  * Diese Funktion iteriert über alle Unterformulare und fragt die Collections ab. Die Collections werden in einem
  * Array gesammelt und dann dem Dokument zugewiesen.
  * 
  * @param Opus_Document $document
  */
 public function updateModel($document)
 {
     $roleForms = $this->getSubForms();
     $values = array();
     foreach ($roleForms as $roleForm) {
         $colForms = $roleForm->getSubForms();
         foreach ($colForms as $colForm) {
             $value = $colForm->getModel();
             if (!is_null($value)) {
                 $values[] = $value;
             }
         }
     }
     $field = $document->getField('Collection');
     $field->setValue($values);
 }
Exemplo n.º 3
0
 /**
  * Aktualisiert das Dokument.
  *
  * @param Opus_Document $document
  */
 public function updateModel($document)
 {
     $field = $document->getField($this->_fieldName);
     $values = $this->getSubFormModels($document);
     $field->setValue($values);
 }