public function getTabs($forceReload = false)
{
$tabs = $this->getData('tabs');
$documentTypeId = $this->getDocumentTypeId();
if (empty($tabs) or $forceReload == true) {
if (!empty($documentTypeId)) {
$rows = $this->fetchAll($this->select(function (Select $select) use($documentTypeId) {
$select->where->equalTo('document_type_id', $documentTypeId);
$select->order('sort_order ASC');
}));
} else {
$rows = $this->fetchAll($this->select());
}
$tabs = array();
foreach ($rows as $row) {
$tabs[] = Model::fromArray((array) $row);
}
$this->setData('tabs', $tabs);
}
return $this->getData('tabs');
}