/** * Gets an instance of the api client. Sets the api client tenant. * * return Editor_Models_ApiClient */ protected function _getApiClientInstance() { if (null === $this->_apiClient) { $user = OpenSKOS_Db_Table_Users::requireById($this->get('userId')); $tenant = OpenSKOS_Db_Table_Tenants::fromCode($user->tenant); $this->_apiClient = Editor_Models_ApiClient::factory(); $this->_apiClient->setTenant($tenant); } return $this->_apiClient; }
public function getClasses(OpenSKOS_Db_Table_Row_Tenant $tenant = null) { if (null === $tenant) { $tenant = OpenSKOS_Db_Table_Tenants::fromCode($this->tenant); } if (null === $tenant) { $tenant = OpenSKOS_Db_Table_Tenants::fromIdentity(); } return $this->getTable()->getClasses($tenant, $this); }