1
0
mirror of synced 2025-01-19 06:51:40 +03:00
doctrine2/lib/Doctrine/ORM/Id/Assigned.php

26 lines
573 B
PHP
Raw Normal View History

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
*/
public function generate($entity)
2008-09-07 13:48:40 +00:00
{
if ( ! $entity->_identifier()) {
throw new Doctrine_Exception("Entity '$entity' is missing an assigned Id");
2008-09-07 13:48:40 +00:00
}
return $entity->_identifier();
2008-09-07 13:48:40 +00:00
}
}
?>