/** * 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; }