add(self::IS_DEFAULT, true); $tax = self::doSelectOne($c); return $tax ? $tax : self::doSelectOne(new Criteria()); } /** * Zwraca stawkę VAT po jej wartości * * @param string $value Wartość stawki VAT * @return Tax */ public static function retrieveByTax($value) { return stTax::getByValue($value); } /** * Zwraca listę aktywnych stawek VAT * * @return Tax[] */ public static function doSelectActive() { $c = new Criteria(); $c->add(self::IS_ACTIVE, true); $rs = self::doSelectRS($c); $results = array(); while ($rs->next()) { $tax = new Tax(); $tax->hydrate($rs); $results[$tax->getId()] = $tax; } return $results; } public static function clearCache() { $cache = new stFunctionCache('stTax'); $cache->removeAll(); } }