2008-09-07 13:48:40 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Special generator for application-assigned identifiers (doesnt really generate anything).
|
|
|
|
*
|
|
|
|
* @since 2.0
|
|
|
|
*/
|
2008-09-12 10:02:06 +00:00
|
|
|
class Doctrine_ORM_Id_Assigned extends Doctrine_ORM_Id_AbstractIdGenerator
|
2008-09-07 13:48:40 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Enter description here...
|
|
|
|
*
|
2008-09-12 10:40:23 +00:00
|
|
|
* @param Doctrine_ORM_Entity $entity
|
2008-09-07 13:48:40 +00:00
|
|
|
* @return unknown
|
|
|
|
* @override
|
|
|
|
*/
|
2008-12-18 14:08:11 +00:00
|
|
|
public function generate($entity)
|
2008-09-07 13:48:40 +00:00
|
|
|
{
|
|
|
|
if ( ! $entity->_identifier()) {
|
2008-12-18 14:08:11 +00:00
|
|
|
throw new Doctrine_Exception("Entity '$entity' is missing an assigned Id");
|
2008-09-07 13:48:40 +00:00
|
|
|
}
|
2008-12-18 14:08:11 +00:00
|
|
|
return $entity->_identifier();
|
2008-09-07 13:48:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|