本文整理汇总了PHP中Bank::getMainAgency方法的典型用法代码示例。如果您正苦于以下问题:PHP Bank::getMainAgency方法的具体用法?PHP Bank::getMainAgency怎么用?PHP Bank::getMainAgency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bank
的用法示例。
在下文中一共展示了Bank::getMainAgency方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAgenciesForBank
/**
* @throws DataBackendException
* @return Agency[]
* @see DataBackend::getAgenciesForBank()
*/
public function getAgenciesForBank(Bank $bank)
{
try {
$stmt = $this->statementContainer->prepare("SELECT {$this->agencyAttributes} FROM {$this->prefix}agency a\n WHERE bank = :bankID AND id != :mainAgency");
$agencies = array();
$stmt->execute(array(":bankID" => $bank->getBankID(), ":mainAgency" => $bank->getMainAgency()->getID()));
foreach ($stmt->fetchAll() as $agencyResult) {
$agencies[] = $this->getAgencyObject($bank, $agencyResult);
}
$stmt->closeCursor();
return $agencies;
} catch (\PDOException $e) {
$stmt->closeCursor();
throw new DataBackendIOException($e->getMessage(), 0, $e);
} catch (MissingAttributesDataBackendIOException $e) {
$stmt->closeCursor();
throw new \LogicException($e);
}
}
示例2: isMainAgency
/**
* @return bool
*/
public function isMainAgency()
{
return $this->bank->getMainAgency() === $this;
}