Files
Phraseanet/lib/Alchemy/Phrasea/Model/Repositories/SecretRepository.php
Benoît Burnichon fb5ca52306 Add Permalink
2015-05-21 12:26:28 +02:00

46 lines
1.0 KiB
PHP

<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Model\Repositories;
use Alchemy\Phrasea\Model\Entities\Secret;
use Doctrine\ORM\EntityRepository;
/**
* This repository implements ArrayAccess to be used with php-jwt library
*/
class SecretRepository extends EntityRepository implements \ArrayAccess
{
public function offsetExists($offset)
{
return null !== $this->find($offset);
}
public function offsetGet($offset)
{
return $this->find($offset);
}
public function offsetSet($offset, $value)
{
throw new \LogicException('This ArrayAccess is non mutable.');
}
public function offsetUnset($offset)
{
throw new \LogicException('This ArrayAccess is non mutable.');
}
public function save(Secret $secret)
{
$this->_em->persist($secret);
$this->_em->flush($secret);
}
}