getFarm() public method

Gets specified Farm taking into account both scope and authentication token
public getFarm ( string $farmId, boolean | string $modify = false ) : Farm
$farmId string Numeric identifier of the Farm
$modify boolean | string optional Permission identifier
return Scalr\Model\Entity\Farm Returns the Farm Entity on success
示例#1
0
 /**
  * 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);
 }
示例#2
0
文件: FarmRoles.php 项目: scalr/scalr
 /**
  * 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);
 }