Пример #1
0
 /**
  * Checks whether the current state must be recorded as a version
  *
  * @return  boolean
  */
 public function isVersioningNecessary($con = null)
 {
     if ($this->alreadyInSave) {
         return false;
     }
     if ($this->enforceVersion) {
         return true;
     }
     if (ChildCustomerQuery::isVersioningEnabled() && ($this->isNew() || $this->isModified()) || $this->isDeleted()) {
         return true;
     }
     // to avoid infinite loops, emulate in save
     $this->alreadyInSave = true;
     foreach ($this->getOrders(null, $con) as $relatedObject) {
         if ($relatedObject->isVersioningNecessary($con)) {
             $this->alreadyInSave = false;
             return true;
         }
     }
     $this->alreadyInSave = false;
     return false;
 }