mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 12:33:26 +00:00
192 lines
3.3 KiB
PHP
192 lines
3.3 KiB
PHP
<?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="UserNotificationSettings",
|
|
* uniqueConstraints={
|
|
* @ORM\UniqueConstraint(name="unique_index",columns={"usr_id", "name"})
|
|
* }
|
|
* )
|
|
* @ORM\Entity(repositoryClass="Repositories\UserNotificaionSettingRepository")
|
|
*/
|
|
class UserNotificationSetting
|
|
{
|
|
/**
|
|
* @ORM\Column(type="integer")
|
|
* @ORM\Id
|
|
* @ORM\GeneratedValue
|
|
*/
|
|
private $id;
|
|
|
|
/**
|
|
* @ORM\Column(type="integer", name="usr_id")
|
|
*/
|
|
private $usrId;
|
|
|
|
/**
|
|
* @ORM\Column(type="string", length=64)
|
|
*/
|
|
private $name;
|
|
|
|
/**
|
|
* @ORM\Column(type="string", length=128, nullable=true)
|
|
*/
|
|
private $value;
|
|
|
|
/**
|
|
* @Gedmo\Timestampable(on="create")
|
|
* @ORM\Column(type="datetime")
|
|
*/
|
|
private $created;
|
|
|
|
/**
|
|
* @Gedmo\Timestampable(on="update")
|
|
* @ORM\Column(type="datetime")
|
|
*/
|
|
private $updated;
|
|
|
|
/**
|
|
* @return integer
|
|
*/
|
|
public function getId()
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
/**
|
|
* @return integer
|
|
*/
|
|
public function getUsrId()
|
|
{
|
|
return $this->usrId;
|
|
}
|
|
|
|
/**
|
|
* @param integer $usrId
|
|
*
|
|
* @return UserNotificationSetting
|
|
*/
|
|
public function setUsrId($usrId)
|
|
{
|
|
$this->usrId = $usrId;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @param Application $app
|
|
*
|
|
* @return \User_Adapter
|
|
*/
|
|
public function getUser(Application $app)
|
|
{
|
|
return \User_Adapter::getInstance($this->usrId, $app);
|
|
}
|
|
|
|
/**
|
|
* @param \User_Adapter $user
|
|
*
|
|
* @return UserNotificationSetting
|
|
*/
|
|
public function setUser(\User_Adapter $user)
|
|
{
|
|
$this->setUsrId($user->get_id());
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getName()
|
|
{
|
|
return $this->name;
|
|
}
|
|
|
|
/**
|
|
* @param string $name
|
|
*
|
|
* @return UserNotificationSetting
|
|
*/
|
|
public function setName($name)
|
|
{
|
|
$this->name = $name;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getValue()
|
|
{
|
|
return $this->value;
|
|
}
|
|
|
|
/**
|
|
* @param string $value
|
|
*
|
|
* @return UserNotificationSetting
|
|
*/
|
|
public function setValue($value)
|
|
{
|
|
$this->value = $value;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return \DateTime
|
|
*/
|
|
public function getCreated()
|
|
{
|
|
return $this->created;
|
|
}
|
|
|
|
/**
|
|
* @param \DateTime $created
|
|
*
|
|
* @return UserNotificationSetting
|
|
*/
|
|
public function setCreated(\DateTime $created)
|
|
{
|
|
$this->created = $created;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return \DateTime
|
|
*/
|
|
public function getUpdated()
|
|
{
|
|
return $this->updated;
|
|
}
|
|
|
|
/**
|
|
* @param \DateTime $created
|
|
*
|
|
* @return UserNotificationSetting
|
|
*/
|
|
public function setUpdated($updated)
|
|
{
|
|
$this->updated = $updated;
|
|
|
|
return $this;
|
|
}
|
|
}
|