diff --git a/backend/lib/Model/Proxy/VolkszaehlerModelTokenProxy.php b/backend/lib/Model/Proxy/VolkszaehlerModelTokenProxy.php deleted file mode 100644 index 16f7d36..0000000 --- a/backend/lib/Model/Proxy/VolkszaehlerModelTokenProxy.php +++ /dev/null @@ -1,47 +0,0 @@ -_entityPersister = $entityPersister; - $this->_identifier = $identifier; - } - private function _load() - { - if (!$this->__isInitialized__ && $this->_entityPersister) { - $this->__isInitialized__ = true; - if ($this->_entityPersister->load($this->_identifier, $this) === null) { - throw new \Doctrine\ORM\EntityNotFoundException(); - } - unset($this->_entityPersister, $this->_identifier); - } - } - - - public function __toString() - { - $this->_load(); - return parent::__toString(); - } - - public function getToken() - { - $this->_load(); - return parent::getToken(); - } - - - public function __sleep() - { - return array('__isInitialized__', 'id', 'token', 'valid', 'entity'); - } -} \ No newline at end of file diff --git a/backend/lib/Model/Token.php b/backend/lib/Model/Token.php deleted file mode 100644 index 2d443a5..0000000 --- a/backend/lib/Model/Token.php +++ /dev/null @@ -1,96 +0,0 @@ -. - */ - -namespace Volkszaehler\Model; - -use Volkszaehler\Util; - -/** - * Token entity - * - * @author Steffen Vogel - * @package default - * @todo this is a draft! has to be discussed and implemented - * - * @Entity - * @Table(name="tokens") - */ -class Token { - /** - * @Id - * @Column(type="integer", nullable=false) - * @GeneratedValue(strategy="AUTO") - * - * @todo wait until DDC-117 is fixed (PKs on FKs) - */ - protected $id; - - /** - * @Column(type="string", nullable=false, unique=true) - */ - protected $token; - - /** - * var integer timestamp until token is valid - * - * @Column(type="bigint") - * @todo to be implemented - */ - protected $valid; - - /** - * @ManyToOne(targetEntity="Entity", inversedBy="tokens") - */ - protected $entity; - - const LENGTH = 10; - - protected static $chars = array( - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'v', 'u', 'w', 'x', 'y', 'z', - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'V', 'U', 'W', 'X', 'Y', 'Z' - ); - - /** - * Constructor - * - * @param integer $length of the token - */ - public function __construct() { - $this->token = self::generate(); - } - - protected static function generate($length = Token::LENGTH) { - return Util\Random::getString(self::$chars, $length); - } - - public function __toString() { - return $this->getToken(); - } - - public function getToken() { - return $this->token; - } -} - -?>