Doctrine\OXM\OXMException::cannotPersistMappedSuperclass PHP Method

cannotPersistMappedSuperclass() public static method

public static cannotPersistMappedSuperclass ( $className )
    public static function cannotPersistMappedSuperclass($className)
    {
        return new self("OXM cannot persist XmlMappedSuperclass '{$className}'.  OXM can only persist root entities.");
    }

Usage Example

Beispiel #1
0
 /**
  * Persists an xml entity as part of the current unit of work.
  *
  * @param object $xmlEntity The xml entity to persist.
  */
 public function persist($xmlEntity)
 {
     $class = $this->xem->getClassMetadata(get_class($xmlEntity));
     if ($class->isMappedSuperclass) {
         throw OXMException::cannotPersistMappedSuperclass($class->name);
     }
     if (!$class->isRoot) {
         throw OXMException::canOnlyPersistRootClasses($class->name);
     }
     $visited = array();
     $this->doPersist($xmlEntity, $visited);
 }