/** * Constructs a new ezcPersistentDefinitionNotFoundException for the class $class * with the additional error information $message. * * @param string $class * @param string $message * @return void */ public function __construct($class, $message = null) { $info = "Could not fetch the persistent object definition for the class '{$class}'."; if ($message !== null) { $info .= " {$message}"; } parent::__construct($info); }
/** * Constructs a new ezcPersistentIdentifierGenerationException for the class * $class with the optional message $msg. * * @param string $class * @param string $msg * @return void */ public function __construct($class, $msg = null) { $info = "Could not create an identifier for the object of type '{$class}'."; if ($info != null) { $info .= " {$msg}"; } parent::__construct($info); }
/** * Constructs a new exception. * * $name specifies the name of the name of the handler to use. * $known is a list of the known database handlers. * * @param string $name * @param array $known */ public function __construct($name, array $known = array()) { if ($name == '' || $name == null) { $name = 'no name provided'; } $message = "Could not find the persistent session: {$name}."; if (count($known) > 0) { $knownMessage = ' The known sessions are: ' . implode(', ', $known) . '.'; $message .= $knownMessage; } parent::__construct($message); }
/** * Constructs a new ezcPersistentDefinitionMissingIdPropertyException for the class $class. * * @param string $class * @return void */ public function __construct($class) { parent::__construct("The persistent object definition for the class '{$class}' does not have an 'idProperty' attribute defined."); }
/** * Creates a new ezcPersistentIdentityMissingException. * * Creates a new ezcPersistentIdentityMissingException for the object of * $class with ID $id. * * @param string $class * @param mixed $id * @param string $relatedClass * @param string $relationName */ public function __construct($class, $id) { parent::__construct("The identity of the object of class '{$class}' with ID '{$id}' was expected to exists, but not found in the identity map."); }
/** * Constructs a new ezcPersistentObjectAlreadyPersistentException for the class * $class. * * @param string $class * @return void */ public function __construct($class) { parent::__construct("The object of type {$class} is already persistent."); }
/** * Creates a new ezcPersistentIdentityRelatedObjectAlreadyExistsException. * * Creates a new ezcPersistentIdentityRelatedObjectAlreadyExistsException * for the object of $class with ID $id and the related objects of class * $relatedClass, with optional set name $relationName. * * @param string $class * @param mixed $id * @param string $relatedClass * @param mixed $relatedId * @param string $relationName */ public function __construct($class, $id, $relatedClass, $relatedId, $relationName = null) { parent::__construct(sprintf("The object of class '%s' with ID '%s' is already related to the object of class '%s' with ID '%s'%s.", $relatedClass, $relatedId, $class, $id, $relationName !== null ? " over the relation '{$relationName}'" : '')); }
/** * Constructs a new ezcPersistentRelatedObjectNotFoundException for the object $object * which does not have a relation for $relatedClass. * * @param object $object * @param string $relatedClass * @return void */ public function __construct($object, $relatedClass) { parent::__construct("No related object found with class '{$relatedClass}' for object of class '" . get_class($object) . "'."); }
/** * Constructs a new ezcPersistentQueryException with additional information in $msg. * * You can also provide the query for debugging purposes. * * @param string $msg * @param string $query * @return void */ public function __construct($msg, $query = null) { parent::__construct("A query failed internally in Persistent Object: {$msg}" . ($query !== null ? " Query: '{$query->getQuery()}'" : "")); }
/** * Constructs a new ezcPersistentUndeterministicRelationException for the given * relation class $class. * * @param string $class * @return void */ public function __construct($class) { parent::__construct("There are multiple relations defined for class {$class}, but the neccessary relation name was missing for the desired operation."); }
/** * Constructs a new ezcPersistentRelationNotFoundException for the class $class * which does not have a relation for $relatedClass. * * @param string $class * @param string $relatedClass * @param string $relationName * @return void */ public function __construct($class, $relatedClass, $relationName = null) { parent::__construct("Class '{$class}' does not have a relation to '{$relatedClass}'" . ($relationName !== null ? " with name '{$relationName}'." : '.')); }
/** * Creates a new exception. * * Creates a new ezcPersistentInvalidObjectStateException for the given * $object with the given $reason. * * @param object $object * @param string $reason */ public function __construct($object, $reason = null) { parent::__construct('The state returned by an object of class ' . get_class($object) . ' was invalid.' . ($reason !== null ? " (Reason: {$reason})" : '')); }
/** * Constructs a new ezcPersistentRelationOperationNotSupportedException for * the $class which does not support the $operation in respect to * $relatedClass. Optionally a $reason can be given. * * @param string $class * @param string $relatedClass * @param string $operation * @param string $reason * @return void */ public function __construct($class, $relatedClass, $operation, $reason = null) { parent::__construct("The relation between '{$class}' and '{$relatedClass}' does not support the operation '{$operation}'." . ($reason !== null ? " Reason: '{$reason}'." : "")); }
/** * Creates a new ezcPersistentIdentityAlreadyExistsException. * * Creates a new ezcPersistentIdentityAlreadyExistsException for the object * identified by $class and $id. * * @param string $class * @param mixed $id */ public function __construct($class, $id) { parent::__construct("An identity for the object of '{$class}' with ID '{$id}' already exists in the identity map."); }
/** * Creates a new ezcPersistentIdentityRelatedObjectsInconsistentException. * * Creates a new ezcPersistentIdentityRelatedObjectsInconsistentException. * The source object is of $class with $id, the related objects are * expected to be of $expectedClass, but the $actualClass was found. * * @param string $class * @param mixed $id * @param string $expectedClass * @param string $actualClass */ public function __construct($class, $id, $expectedClass, $actualClass) { parent::__construct(sprintf("Inconsistent relation set for object of class '%s' with ID '%s'. '%s' was expected, but '%s' was found.", $class, $id, $expectedClass, $actualClass)); }
/** * Constructs a new ezcPersistentRelationInvalidException for the given * relation class $class. * * @param string $class * @return void */ public function __construct($class) { parent::__construct("Class '{$class}' is not a valid relation defitinion class."); }