mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 22:13:13 +00:00
Add UserQuery entity
This commit is contained in:
104
lib/Doctrine/Entities/UserQuery.php
Normal file
104
lib/Doctrine/Entities/UserQuery.php
Normal file
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Entities;
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Gedmo\Mapping\Annotation as Gedmo;
|
||||
|
||||
/**
|
||||
* @ORM\Table(name="UserQueries")
|
||||
* @ORM\Entity(repositoryClass="Repositories\UserQueryRepository")
|
||||
*/
|
||||
class UserQuery
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", name="usr_id")
|
||||
*/
|
||||
private $usrId;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=256)
|
||||
*/
|
||||
private $query;
|
||||
|
||||
/**
|
||||
* @Gedmo\Timestampable(on="create")
|
||||
* @ORM\Column(type="datetime")
|
||||
*/
|
||||
private $created;
|
||||
|
||||
/**
|
||||
* @return integer
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return integer
|
||||
*/
|
||||
public function getUsrId()
|
||||
{
|
||||
return $this->usrId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param integer $usrId
|
||||
*/
|
||||
public function setUsrId($usrId)
|
||||
{
|
||||
$this->usrId = $usrId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Application $app
|
||||
*
|
||||
* @return \User_Adapter
|
||||
*/
|
||||
public function getUser(Application $app)
|
||||
{
|
||||
return \User_Adapter::getInstance($this->usrId, $app);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getQuery()
|
||||
{
|
||||
return $this->query;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $query
|
||||
*/
|
||||
public function setQuery($query)
|
||||
{
|
||||
$this->query = $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getCreated()
|
||||
{
|
||||
return $this->created;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user