/**
  * Function which can be over-ridden to perform any pre-deletion tasks
  *
  * You can stop the deletion by returning false but you should also add a
  * message to explain why.
  *
  * @param \Entities\PhysicalInterface $object The Doctrine2 entity to delete
  * @return bool Return false to stop / cancel the deletion
  */
 protected function preDelete($object)
 {
     if ($object->getSwitchPort()->getType() == \Entities\SwitchPort::TYPE_PEERING && $object->getFanoutPhysicalInterface()) {
         $object->getSwitchPort()->setPhysicalInterface(null);
         $object->getFanoutPhysicalInterface()->getSwitchPort()->setType(\Entities\SwitchPort::TYPE_PEERING);
     } else {
         if ($object->getSwitchPort()->getType() == \Entities\SwitchPort::TYPE_FANOUT && $object->getPeeringPhysicalInterface()) {
             if ($this->getParam('related', false)) {
                 $this->removeRelatedInterface($object);
             }
             $object->getPeeringPhysicalInterface()->setFanoutPhysicalInterface(null);
         }
     }
     return true;
 }
 public function getFanoutPhysicalInterface()
 {
     $this->__load();
     return parent::getFanoutPhysicalInterface();
 }