/** * Exclude object from result * * @param ChildSocolissimoDeliveryMode $socolissimoDeliveryMode Object to remove from the list of results * * @return ChildSocolissimoDeliveryModeQuery The current query, for fluid interface */ public function prune($socolissimoDeliveryMode = null) { if ($socolissimoDeliveryMode) { $this->addUsingAlias(SocolissimoDeliveryModeTableMap::ID, $socolissimoDeliveryMode->getId(), Criteria::NOT_EQUAL); } return $this; }
/** * Declares an association between this object and a ChildSocolissimoDeliveryMode object. * * @param ChildSocolissimoDeliveryMode $v * @return \SoColissimo\Model\SocolissimoPrice The current object (for fluent API support) * @throws PropelException */ public function setSocolissimoDeliveryMode(ChildSocolissimoDeliveryMode $v = null) { if ($v === null) { $this->setDeliveryModeId(NULL); } else { $this->setDeliveryModeId($v->getId()); } $this->aSocolissimoDeliveryMode = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildSocolissimoDeliveryMode object, it will not be re-added. if ($v !== null) { $v->addSocolissimoPrice($this); } return $this; }
/** * Filter the query by a related \SoColissimo\Model\SocolissimoDeliveryMode object * * @param \SoColissimo\Model\SocolissimoDeliveryMode|ObjectCollection $socolissimoDeliveryMode The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildSocolissimoPriceQuery The current query, for fluid interface */ public function filterBySocolissimoDeliveryMode($socolissimoDeliveryMode, $comparison = null) { if ($socolissimoDeliveryMode instanceof \SoColissimo\Model\SocolissimoDeliveryMode) { return $this->addUsingAlias(SocolissimoPriceTableMap::DELIVERY_MODE_ID, $socolissimoDeliveryMode->getId(), $comparison); } elseif ($socolissimoDeliveryMode instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(SocolissimoPriceTableMap::DELIVERY_MODE_ID, $socolissimoDeliveryMode->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterBySocolissimoDeliveryMode() only accepts arguments of type \\SoColissimo\\Model\\SocolissimoDeliveryMode or Collection'); } }
public static function getPrices(SocolissimoDeliveryMode $deliveryMode) { self::$prices = null; $fileName = sprintf('%s%s', __DIR__, "/Config/prices_" . $deliveryMode->getCode() . ".json"); // If delivery mode file doesn't exist take global price if (!file_exists($fileName)) { $fileName = sprintf('%s%s', __DIR__, self::JSON_PRICE_RESOURCE); // If global price doesn't exist throw exception if (!file_exists($fileName)) { throw new Exception("Prices configuration not found."); } } if (null === self::$prices) { self::$prices = json_decode(file_get_contents($fileName), true); } return self::$prices; }