/** * Gets farm from database using User's Environment * * @param int $farmId The identifier of the Role * @param bool $modify optional Modification flag * @return Farm|null Returns specified Farm * @throws ApiErrorException */ public function getFarm($farmId, $modify = false) { if (empty($this->farmController)) { $this->farmController = $this->getContainer()->api->controller(static::$farmControllerClass); } return $this->farmController->getFarm($farmId, $modify ? Acl::PERM_FARMS_MANAGE : null); }
/** * Gets farm from database using User's Environment * * @param int $farmId The identifier of the Role * @param bool $modify optional Modification flag * @return Farm|null Returns specified Farm * @throws ApiErrorException */ public function getFarm($farmId, $modify = false) { if (empty($this->farmController)) { $this->farmController = $this->getContainer()->api->controller(static::$farmControllerClass); } return $this->farmController->getFarm($farmId, $modify); }