예제 #1
0
 /**
  * @param  ChildTemplates $templates The ChildTemplates object to remove.
  * @return $this|ChildTemplatenames The current object (for fluent API support)
  */
 public function removeTemplates(ChildTemplates $templates)
 {
     if ($this->getTemplatess()->contains($templates)) {
         $pos = $this->collTemplatess->search($templates);
         $this->collTemplatess->remove($pos);
         if (null === $this->templatessScheduledForDeletion) {
             $this->templatessScheduledForDeletion = clone $this->collTemplatess;
             $this->templatessScheduledForDeletion->clear();
         }
         $this->templatessScheduledForDeletion[] = $templates;
         $templates->setTemplatenames(null);
     }
     return $this;
 }
예제 #2
0
 /**
  * Remove templates of this object
  * through the R_fieldpostprocessor_forfield cross reference table.
  *
  * @param ChildTemplates $templates
  * @return ChildFieldpostprocessor The current object (for fluent API support)
  */
 public function removeTemplates(ChildTemplates $templates)
 {
     if ($this->getTemplatess()->contains($templates)) {
         $rFieldpostprocessorForfield = new ChildRFieldpostprocessorForfield();
         $rFieldpostprocessorForfield->setTemplates($templates);
         if ($templates->isFieldpostprocessorsLoaded()) {
             //remove the back reference if available
             $templates->getFieldpostprocessors()->removeObject($this);
         }
         $rFieldpostprocessorForfield->setFieldpostprocessor($this);
         $this->removeRFieldpostprocessorForfield(clone $rFieldpostprocessorForfield);
         $rFieldpostprocessorForfield->clear();
         $this->collTemplatess->remove($this->collTemplatess->search($templates));
         if (null === $this->templatessScheduledForDeletion) {
             $this->templatessScheduledForDeletion = clone $this->collTemplatess;
             $this->templatessScheduledForDeletion->clear();
         }
         $this->templatessScheduledForDeletion->push($templates);
     }
     return $this;
 }