Exemplo n.º 1
0
    private function getAllUsedCountryListForType(Pap_Db_CommissionType $beforeSaveType) {
        $existingcountries = array();

        $type = new Pap_Db_CommissionType();
        $type->setParentCommissionTypeId($beforeSaveType->getParentCommissionTypeId());
        $types = $type->loadCollection(array(Pap_Db_Table_CommissionTypes::PARENT_COMMISSIONTYPE_ID));

        foreach ($types as $type) {
            if ($type->getId() == $beforeSaveType->getId()) continue;
            $countryList = preg_split('/,/', $type->getCountryCodes());
            $existingcountries = array_merge($existingcountries, $countryList);
        }
        return $existingcountries;
    }