/** * Get Tabs * * @return \Gc\Tab\Collection */ public function getTabs() { if ($this->getData('tabs') === null) { $tabsCollection = new Tab\Collection(); $tabsCollection->load($this->getId()); $this->setData('tabs', $tabsCollection->getTabs()); } return $this->getData('tabs'); }
/** * Test * * @return void */ public function testGetTabs() { $this->assertInternalType('array', $this->object->getTabs()); }
/** * Initialize tabs sub form * * @return \Zend\Form\FieldSet */ protected function getTabs() { $fieldsets = $this->getFieldSets(); if (!empty($fieldsets['tabs'])) { return $fieldsets['tabs']; } $fieldsets = new FieldSet('tabs'); $tabsList = new Element\Select('tabs_list'); $tabCollection = new Tab\Collection(); $tabsList->setValueOptions($tabCollection->getTabs()); $fieldsets->add($tabsList); $this->add($fieldsets); $this->getInputFilter()->add(array('type' => 'Zend\\InputFilter\\InputFilter'), 'tabs'); return $fieldsets; }