Beispiel #1
0
 /**
  * Remove services of this object
  * through the object_services cross reference table.
  *
  * @param ChildServices $services
  * @return ChildObject The current object (for fluent API support)
  */
 public function removeServices(ChildServices $services)
 {
     if ($this->getServicess()->contains($services)) {
         $objectServices = new ChildObjectServices();
         $objectServices->setServices($services);
         if ($services->isObjectsLoaded()) {
             //remove the back reference if available
             $services->getObjects()->removeObject($this);
         }
         $objectServices->setObject($this);
         $this->removeObjectServices(clone $objectServices);
         $objectServices->clear();
         $this->collServicess->remove($this->collServicess->search($services));
         if (null === $this->servicessScheduledForDeletion) {
             $this->servicessScheduledForDeletion = clone $this->collServicess;
             $this->servicessScheduledForDeletion->clear();
         }
         $this->servicessScheduledForDeletion->push($services);
     }
     return $this;
 }
 /**
  * Exclude object from result
  *
  * @param   ChildObjectServices $objectServices Object to remove from the list of results
  *
  * @return $this|ChildObjectServicesQuery The current query, for fluid interface
  */
 public function prune($objectServices = null)
 {
     if ($objectServices) {
         $this->addCond('pruneCond0', $this->getAliasedColName(ObjectServicesTableMap::COL_ID_OBJECT), $objectServices->getIdObject(), Criteria::NOT_EQUAL);
         $this->addCond('pruneCond1', $this->getAliasedColName(ObjectServicesTableMap::COL_ID_SERVICES), $objectServices->getIdServices(), Criteria::NOT_EQUAL);
         $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
     }
     return $this;
 }
Beispiel #3
0
 /**
  * Filter the query by a related \ObjectServices object
  *
  * @param \ObjectServices|ObjectCollection $objectServices the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildServicesQuery The current query, for fluid interface
  */
 public function filterByObjectServices($objectServices, $comparison = null)
 {
     if ($objectServices instanceof \ObjectServices) {
         return $this->addUsingAlias(ServicesTableMap::COL_ID, $objectServices->getIdServices(), $comparison);
     } elseif ($objectServices instanceof ObjectCollection) {
         return $this->useObjectServicesQuery()->filterByPrimaryKeys($objectServices->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByObjectServices() only accepts arguments of type \\ObjectServices or Collection');
     }
 }