Example #1
0
 /**
  * Clears the current object, sets all attributes to their default values and removes
  * outgoing references as well as back-references (from other objects to this one. Results probably in a database
  * change of those foreign objects when you call `save` there).
  */
 public function clear()
 {
     if (null !== $this->aCustomer) {
         $this->aCustomer->removeProject($this);
     }
     if (null !== $this->aEmployee) {
         $this->aEmployee->removeProject($this);
     }
     $this->id = null;
     $this->name = null;
     $this->limit = null;
     $this->rate = null;
     $this->employee_id = null;
     $this->customer_id = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->applyDefaultValues();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }
Example #2
0
 /**
  * Exclude object from result
  *
  * @param   ChildCustomer $customer Object to remove from the list of results
  *
  * @return $this|ChildCustomerQuery The current query, for fluid interface
  */
 public function prune($customer = null)
 {
     if ($customer) {
         $this->addUsingAlias(CustomerTableMap::COL_ID, $customer->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
Example #3
0
 /**
  * Filter the query by a related \Customer object
  *
  * @param \Customer|ObjectCollection $customer The related object(s) to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @throws \Propel\Runtime\Exception\PropelException
  *
  * @return ChildProjectQuery The current query, for fluid interface
  */
 public function filterByCustomer($customer, $comparison = null)
 {
     if ($customer instanceof \Customer) {
         return $this->addUsingAlias(ProjectTableMap::COL_CUSTOMER_ID, $customer->getId(), $comparison);
     } elseif ($customer instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(ProjectTableMap::COL_CUSTOMER_ID, $customer->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByCustomer() only accepts arguments of type \\Customer or Collection');
     }
 }
Example #4
0
 /**
  * Filter the query by a related \Customer object
  *
  * @param \Customer|ObjectCollection $customer the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildPersonQuery The current query, for fluid interface
  */
 public function filterByCustomer($customer, $comparison = null)
 {
     if ($customer instanceof \Customer) {
         return $this->addUsingAlias(PersonTableMap::COL_ID, $customer->getPersonId(), $comparison);
     } elseif ($customer instanceof ObjectCollection) {
         return $this->useCustomerQuery()->filterByPrimaryKeys($customer->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByCustomer() only accepts arguments of type \\Customer or Collection');
     }
 }
Example #5
0
 /**
  * Clears the current object, sets all attributes to their default values and removes
  * outgoing references as well as back-references (from other objects to this one. Results probably in a database
  * change of those foreign objects when you call `save` there).
  */
 public function clear()
 {
     if (null !== $this->aCustomer) {
         $this->aCustomer->removeInvoice($this);
     }
     $this->id = null;
     $this->created = null;
     $this->due = null;
     $this->paid = null;
     $this->customer_id = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }
Example #6
0
 /**
  * @param ChildCustomer $customer The ChildCustomer object to add.
  */
 protected function doAddCustomer(ChildCustomer $customer)
 {
     $this->collCustomers[] = $customer;
     $customer->setPerson($this);
 }