getImportableTabs() public method

Return all tabs from collection
public getImportableTabs ( integer $documentTypeId ) : array
$documentTypeId integer Document type id
return array
Example #1
0
 /**
  * Test
  *
  * @return void
  */
 public function testGetImportableTabs()
 {
     $this->assertInternalType('array', $this->object->getImportableTabs(0));
 }
Example #2
0
 /**
  * Set values and create tabs and properties FieldSet
  * from parameter
  *
  * @param mixed $element \Gc\DocumentType\Model | array
  *
  * @return null|DocumentType
  */
 public function setValues($element)
 {
     if ($element instanceof DocumentTypeModel) {
         $infosForm = $this->getInfos();
         $infosForm->get('name')->setValue($element->getName());
         $infosForm->get('description')->setValue($element->getDescription());
         $infosForm->get('icon_id')->setValue($element->getIconId());
         $dependency = $infosForm->get('infos[dependency]');
         if (!empty($dependency)) {
             $dependency->setValue($element->getDependencies());
         }
         $viewsForm = $this->getViews();
         $viewsForm->get('default_view')->setValue($element->getDefaultViewId());
         $viewsCollection = $element->getAvailableViews();
         $viewsForm->get('available_views')->setValue($viewsCollection->getSelect());
         $tabs = $element->getTabs();
         $tabCollection = new Tab\Collection();
         $this->getTabs()->get('tabs_list')->setValueOptions($tabCollection->getImportableTabs($element->getId()));
         foreach ($tabs as $tabId => $tab) {
             $this->addTab($tab);
             $properties = $tab->getProperties();
             foreach ($properties as $property) {
                 $this->addProperty($property);
             }
         }
     } else {
         if (empty($element['tabs'])) {
             return;
         }
         $tabSelect = array();
         foreach ($element['tabs'] as $tabId => $tab) {
             if (!is_array($tab)) {
                 continue;
             }
             $tab['id'] = $tabId;
             $this->addTab($tab);
             $tabSelect[$tabId] = $tab['name'];
         }
         foreach ($element['properties'] as $propertyId => $property) {
             if (!is_array($property)) {
                 continue;
             }
             $property['id'] = $propertyId;
             $this->addProperty($property);
         }
     }
     return $this;
 }