public function load($tabId = null, $documentTypeId = null)
{
$this->setId((int) $tabId);
$this->setDocumentTypeId((int) $documentTypeId);
$tabId = $this->getId();
$select = $this->select(function (Select $select) use($documentTypeId, $tabId) {
if ($documentTypeId !== null) {
$select->where->equalTo('document_type_id', $documentTypeId);
}
if ($tabId !== null) {
$select->where->equalTo('id', $tabId);
}
});
$row = $this->fetchRow($select);
if (empty($row['id'])) {
return false;
}
$this->setName($row['name']);
$this->setDescription($row['description']);
$this->setDocumentTypeId($row['document_type_id']);
$this->setSortOrder($row['sort_order']);
return $this;
}