Scalr_Account::getCostCenters PHP Method

getCostCenters() public method

Gets the list of the Cost Centers which correspond to Account
public getCostCenters ( ) : ArrayCollection
return Scalr\Model\Collections\ArrayCollection Returns collection of the entities
    public function getCostCenters()
    {
        $ccs = new ArrayCollection();
        foreach (AccountCostCenterEntity::findByAccountId($this->id) as $accountCc) {
            $cc = CostCentreEntity::findPk($accountCc->ccId);
            if (!$cc instanceof CostCentreEntity) {
                continue;
            }
            $ccs->append($cc);
        }
        return $ccs;
    }