PHP Класс Newscoop\Entity\User

Наследование: implements Zend_Acl_Role_Interface, implements Symfony\Component\Security\Core\User\UserInterface, implements Symfony\Component\Security\Core\User\AdvancedUserInterface, implements Serializable, implements Symfony\Component\Security\Core\User\EquatableInterface, implements Newscoop\Search\DocumentInterface
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$image string

Защищенные свойства (Protected)

Свойство Тип Описание
$attributes Doctrine\Common\Collections\Collection;
$author Newscoop\Entity\Author
$city string
$clients Newscoop\Package\Package
$commenters Doctrine\Common\Collections\Collection;
$countryCode string
$created DateTime
$email string
$first_name string
$groups Doctrine\Common\Collections\Collection;
$id integer
$identities Doctrine\Common\Collections\Collection
$indexed DateTime
$is_admin boolean
$is_public boolean
$lastLogin DateTime
$last_name string
$password string
$phone string
$points integer
$postal string
$publication integer
$resetToken string
$role Newscoop\Entity\Acl\Role
$state string
$status integer
$street string
$subscriber integer
$topics Doctrine\Common\Collections\ArrayCollection
$updated DateTime
$username string

Открытые методы

Метод Описание
__construct ( string $email = null )
__toString ( ) : string
addAttribute ( string $name, string $value ) : Newscoop\Entity\User Add attribute
addClient ( Client $client ) : Newscoop\Entity\User Add oauth client
addUserType ( Group $type ) : Newscoop\Entity\User Add user type
checkPassword ( string $password ) : boolean Check password
eraseCredentials ( ) Removes sensitive data from the user.
exists ( ) : boolean Check if the user exists Test if there is set an id
generateRandomString ( integer $length = 12, string $allowed_chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' ) : string Get random string
getAttribute ( string $name ) : mixed Get attribute
getAttributes ( ) : array Get all user attributes
getAuthor ( ) : integer Get author
getAuthorId ( ) : integer Get author id
getCity ( ) : string Get city
getClients ( ) : ArrayCollection Get oauth clients
getCommenters ( )
getComments ( ) : array Get a User's comments which are associated with his User account.
getCountryCode ( ) : string Get country code
getCreated ( ) : DateTime Get created datetime
getDataTableView ( Zend_View_Abstract $view ) : object TODO: move this to user service - it's not a part of entity
getEditView ( Zend_View_Abstract $view ) : object TODO: move this to user service - it's not a part of entity
getEmail ( ) : string Get email
getFirstName ( ) : string Get first name
getGroupNames ( ) : array Get group names
getGroups ( ) : array Get groups
getId ( ) : integer Get id
getImage ( ) : string Get image
getIndexed ( ) : DateTime Get indexed
getLastLogin ( ) : void Get lastLogin
getLastName ( ) : string Get last name
getName ( ) : string Get name
getObject ( )
getPassword ( ) : [type] Get password for authentication
getPhone ( ) : string Get phone
getPoints ( ) : integer Get points
getPostal ( ) : string Get postal code
getProperty ( $p_key ) : mixed Get an enity property
getPublication ( ) : integer Get publication id which user registered with
getRawAttributes ( ) : array Get raw user attributes
getRealName ( ) : string Get real name
getResetToken ( ) : string Get password reset token
getRoleId ( ) : integer Get role id
getRoles ( ) : array Get user roles for authentication
getSalt ( ) : string Get password salt for authentication
getState ( ) : string Get state
getStatus ( ) : integer Get status
getStreet ( ) : string Get street address
getSubscriber ( ) : integer Get subscriber
getTopics ( ) : ArrayCollection | null Gets user's topics
getUpdated ( ) : DateTime Get updated datetime
getUserId ( ) : integer Get user id proxy to getId
getUserTypes ( ) : array Get user types
getUsername ( ) : string Get username
getView ( ) : UserView Get view
hasClient ( Client $client ) : boolean Has client
hasGroup ( string $name ) : boolean Test if user has group
hasPermission ( string $permission, string $resource = null, string $action = null ) : boolean Check permissions
isAccountNonExpired ( ) : boolean Checks if the user account is not expired.
isAccountNonLocked ( ) : boolean Checks if the user account is not locked. Currently there is no seperation between pending and banned.
isActive ( ) : boolean Test if user is active
isAdmin ( ) : boolean Test if user is admin
isBanned ( ) : boolean Test if user is banned
isCredentialsNonExpired ( ) : boolean Checks if credentials are expired. We don't have this mechanism in Newscoop.
isEnabled ( ) : boolean Checks if the user account is enabled.
isEqualTo ( Symfony\Component\Security\Core\User\UserInterface $user )
isPending ( ) : boolean Test if user is pending
isPublic ( ) : boolean Test if user is public
preUpdate ( )
removeAttribute ( string $name ) : Newscoop\Entity\UserAttribute Remove attribute
rename ( string $username ) : void TODO: move this to user service - it's not a part of entity
render ( ) : UserView TODO: move this to user service - it's not a part of entity
serialize ( )
setActive ( ) : Newscoop\Entity\User Set user as active
setAdmin ( boolean $admin ) : Newscoop\Entity\User Set admin switch
setAttributes ( mixed $attributes ) Set User attributes
setAuthor ( Author $author = null ) : Newscoop\Entity\User Set author
setCity ( string $city ) : string Set city
setCountryCode ( string $countryCode ) : string Set country code
setEmail ( string $email ) : Newscoop\Entity\User Set email
setFirstName ( string $first_name ) : Newscoop\Entity\User Set first name
setImage ( string $image ) : Newscoop\Entity\User Set image
setIndexed ( DateTime $indexed = null ) : self Set indexed
setLastLogin ( DateTime $lastLogin = null ) : void Set lastLogin
setLastName ( string $last_name ) : Newscoop\Entity\User Set last name
setPassword ( string $password ) : Newscoop\Entity\User Set password
setPhone ( string $phone ) : string Set phone
setPoints ( integer $points ) : Newscoop\Entity\User Set points
setPostal ( string $postal ) : string Set postal code
setPublic ( boolean $public = true ) : Newscoop\Entity\User Set user is public
setPublication ( integer $publication ) : integer Set publication which user registered with
setResetToken ( integer $resetToken ) : string Set password reset token
setRole ( Role $role ) : Newscoop\Entity\User Set role
setState ( string $state ) : string Set state
setStatus ( integer $status ) : Newscoop\Entity\User Set status
setStreet ( string $street ) : string Set street address
setSubscriber ( integer $subscriber ) : Newscoop\Entity\User Set subscriber
setUsername ( string $username ) : Newscoop\Entity\User Set username
unserialize ( $data )
updateProfile ( string $username, string $password, string $firstName, string $lastName, string $image, array $attributes ) TODO: move this to user service - it's not a part of entity

Приватные методы

Метод Описание
getViewUrl ( string $action, Zend_View_Abstract $view ) : string TODO: move this to user service - it's not a part of entity

Описание методов

__construct() публичный метод

public __construct ( string $email = null )
$email string

__toString() публичный метод

public __toString ( ) : string
Результат string

addAttribute() публичный метод

Add attribute
public addAttribute ( string $name, string $value ) : Newscoop\Entity\User
$name string
$value string
Результат Newscoop\Entity\User

addClient() публичный метод

Add oauth client
public addClient ( Client $client ) : Newscoop\Entity\User
$client Newscoop\GimmeBundle\Entity\Client
Результат Newscoop\Entity\User

addUserType() публичный метод

Add user type
public addUserType ( Group $type ) : Newscoop\Entity\User
$type Newscoop\Entity\User\Group
Результат Newscoop\Entity\User

checkPassword() публичный метод

Check password
public checkPassword ( string $password ) : boolean
$password string
Результат boolean

eraseCredentials() публичный метод

Removes sensitive data from the user.
public eraseCredentials ( )

exists() публичный метод

Check if the user exists Test if there is set an id
Устаревший: legacy from frontend controllers
public exists ( ) : boolean
Результат boolean

generateRandomString() закрытый публичный метод

Get random string
final public generateRandomString ( integer $length = 12, string $allowed_chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' ) : string
$length integer
$allowed_chars string
Результат string

getAttribute() публичный метод

Get attribute
public getAttribute ( string $name ) : mixed
$name string
Результат mixed

getAttributes() публичный метод

Get all user attributes
public getAttributes ( ) : array
Результат array of all user attributes

getAuthor() публичный метод

Get author
public getAuthor ( ) : integer
Результат integer

getAuthorId() публичный метод

Get author id
public getAuthorId ( ) : integer
Результат integer

getCity() публичный метод

Get city
public getCity ( ) : string
Результат string

getClients() публичный метод

Get oauth clients
public getClients ( ) : ArrayCollection
Результат Doctrine\Common\Collections\ArrayCollection

getCommenters() публичный метод

public getCommenters ( )

getComments() публичный метод

Get a User's comments which are associated with his User account.
public getComments ( ) : array
Результат array

getCountryCode() публичный метод

Get country code
public getCountryCode ( ) : string
Результат string

getCreated() публичный метод

Get created datetime
public getCreated ( ) : DateTime
Результат DateTime

getDataTableView() публичный метод

Get DataTable view
public getDataTableView ( Zend_View_Abstract $view ) : object
$view Zend_View_Abstract
Результат object

getEditView() публичный метод

Get edit view
public getEditView ( Zend_View_Abstract $view ) : object
$view Zend_View_Abstract
Результат object

getEmail() публичный метод

Get email
public getEmail ( ) : string
Результат string

getFirstName() публичный метод

Get first name
public getFirstName ( ) : string
Результат string

getGroupNames() публичный метод

Get group names
public getGroupNames ( ) : array
Результат array

getGroups() публичный метод

Get groups
public getGroups ( ) : array
Результат array of Newscoop\Entity\User\Group

getId() публичный метод

Get id
public getId ( ) : integer
Результат integer

getImage() публичный метод

Get image
public getImage ( ) : string
Результат string

getIndexed() публичный метод

Get indexed
public getIndexed ( ) : DateTime
Результат DateTime

getLastLogin() публичный метод

Get lastLogin
public getLastLogin ( ) : void
Результат void

getLastName() публичный метод

Get last name
public getLastName ( ) : string
Результат string

getName() публичный метод

Get name
public getName ( ) : string
Результат string

getObject() публичный метод

public getObject ( )

getPassword() публичный метод

Get password for authentication
public getPassword ( ) : [type]
Результат [type]

getPhone() публичный метод

Get phone
public getPhone ( ) : string
Результат string

getPoints() публичный метод

Get points
public getPoints ( ) : integer
Результат integer

getPostal() публичный метод

Get postal code
public getPostal ( ) : string
Результат string

getProperty() публичный метод

Get an enity property
Устаревший: legacy from frontend controllers
public getProperty ( $p_key ) : mixed
$p_key
Результат mixed

getPublication() публичный метод

Get publication id which user registered with
public getPublication ( ) : integer
Результат integer

getRawAttributes() публичный метод

Get raw user attributes
public getRawAttributes ( ) : array
Результат array

getRealName() публичный метод

Get real name
public getRealName ( ) : string
Результат string

getResetToken() публичный метод

Get password reset token
public getResetToken ( ) : string
Результат string

getRoleId() публичный метод

Get role id
public getRoleId ( ) : integer
Результат integer

getRoles() публичный метод

Get user roles for authentication
public getRoles ( ) : array
Результат array array with roles

getSalt() публичный метод

Get password salt for authentication
public getSalt ( ) : string
Результат string

getState() публичный метод

Get state
public getState ( ) : string
Результат string

getStatus() публичный метод

Get status
public getStatus ( ) : integer
Результат integer

getStreet() публичный метод

Get street address
public getStreet ( ) : string
Результат string

getSubscriber() публичный метод

Get subscriber
public getSubscriber ( ) : integer
Результат integer

getTopics() публичный метод

Gets user's topics
public getTopics ( ) : ArrayCollection | null
Результат Doctrine\Common\Collections\ArrayCollection | null

getUpdated() публичный метод

Get updated datetime
public getUpdated ( ) : DateTime
Результат DateTime

getUserId() публичный метод

Get user id proxy to getId
public getUserId ( ) : integer
Результат integer

getUserTypes() публичный метод

Get user types
public getUserTypes ( ) : array
Результат array

getUsername() публичный метод

Get username
public getUsername ( ) : string
Результат string

getView() публичный метод

Get view
public getView ( ) : UserView
Результат Newscoop\View\UserView

hasClient() публичный метод

Has client
public hasClient ( Client $client ) : boolean
$client Newscoop\GimmeBundle\Entity\Client
Результат boolean

hasGroup() публичный метод

Test if user has group
public hasGroup ( string $name ) : boolean
$name string
Результат boolean

hasPermission() публичный метод

Check permissions
public hasPermission ( string $permission, string $resource = null, string $action = null ) : boolean
$permission string
$resource string
$action string
Результат boolean

isAccountNonExpired() публичный метод

Checks if the user account is not expired.
public isAccountNonExpired ( ) : boolean
Результат boolean In active status

isAccountNonLocked() публичный метод

Checks if the user account is not locked. Currently there is no seperation between pending and banned.
public isAccountNonLocked ( ) : boolean
Результат boolean Not locked status

isActive() публичный метод

Test if user is active
public isActive ( ) : boolean
Результат boolean

isAdmin() публичный метод

Test if user is admin
public isAdmin ( ) : boolean
Результат boolean

isBanned() публичный метод

Test if user is banned
public isBanned ( ) : boolean
Результат boolean

isCredentialsNonExpired() публичный метод

Checks if credentials are expired. We don't have this mechanism in Newscoop.
public isCredentialsNonExpired ( ) : boolean
Результат boolean Not credentials expired status

isEnabled() публичный метод

Checks if the user account is enabled.
public isEnabled ( ) : boolean
Результат boolean Active status

isEqualTo() публичный метод

public isEqualTo ( Symfony\Component\Security\Core\User\UserInterface $user )
$user Symfony\Component\Security\Core\User\UserInterface

isPending() публичный метод

Test if user is pending
public isPending ( ) : boolean
Результат boolean

isPublic() публичный метод

Test if user is public
public isPublic ( ) : boolean
Результат boolean

preUpdate() публичный метод

public preUpdate ( )

removeAttribute() публичный метод

Remove attribute
public removeAttribute ( string $name ) : Newscoop\Entity\UserAttribute
$name string
Результат Newscoop\Entity\UserAttribute

rename() публичный метод

Rename user
public rename ( string $username ) : void
$username string
Результат void

render() публичный метод

Render user
public render ( ) : UserView
Результат Newscoop\View\UserView

serialize() публичный метод

public serialize ( )

setActive() публичный метод

Set user as active
public setActive ( ) : Newscoop\Entity\User
Результат Newscoop\Entity\User

setAdmin() публичный метод

Set admin switch
public setAdmin ( boolean $admin ) : Newscoop\Entity\User
$admin boolean
Результат Newscoop\Entity\User

setAttributes() публичный метод

Set User attributes
public setAttributes ( mixed $attributes )
$attributes mixed UserAttributes

setAuthor() публичный метод

Set author
public setAuthor ( Author $author = null ) : Newscoop\Entity\User
$author Author
Результат Newscoop\Entity\User

setCity() публичный метод

Set city
public setCity ( string $city ) : string
$city string
Результат string

setCountryCode() публичный метод

Set country code
public setCountryCode ( string $countryCode ) : string
$countryCode string
Результат string

setEmail() публичный метод

Set email
public setEmail ( string $email ) : Newscoop\Entity\User
$email string
Результат Newscoop\Entity\User

setFirstName() публичный метод

Set first name
public setFirstName ( string $first_name ) : Newscoop\Entity\User
$first_name string
Результат Newscoop\Entity\User

setImage() публичный метод

Set image
public setImage ( string $image ) : Newscoop\Entity\User
$image string
Результат Newscoop\Entity\User

setIndexed() публичный метод

Set indexed
public setIndexed ( DateTime $indexed = null ) : self
$indexed DateTime
Результат self

setLastLogin() публичный метод

Set lastLogin
public setLastLogin ( DateTime $lastLogin = null ) : void
$lastLogin DateTime
Результат void

setLastName() публичный метод

Set last name
public setLastName ( string $last_name ) : Newscoop\Entity\User
$last_name string
Результат Newscoop\Entity\User

setPassword() публичный метод

Set password
public setPassword ( string $password ) : Newscoop\Entity\User
$password string
Результат Newscoop\Entity\User

setPhone() публичный метод

Set phone
public setPhone ( string $phone ) : string
$phone string
Результат string

setPoints() публичный метод

Set points
public setPoints ( integer $points ) : Newscoop\Entity\User
$points integer
Результат Newscoop\Entity\User

setPostal() публичный метод

Set postal code
public setPostal ( string $postal ) : string
$postal string
Результат string

setPublic() публичный метод

Set user is public
public setPublic ( boolean $public = true ) : Newscoop\Entity\User
$public boolean
Результат Newscoop\Entity\User

setPublication() публичный метод

Set publication which user registered with
public setPublication ( integer $publication ) : integer
$publication integer Publication id
Результат integer

setResetToken() публичный метод

Set password reset token
public setResetToken ( integer $resetToken ) : string
$resetToken integer
Результат string

setRole() публичный метод

Set role
public setRole ( Role $role ) : Newscoop\Entity\User
$role Newscoop\Entity\Acl\Role
Результат Newscoop\Entity\User

setState() публичный метод

Set state
public setState ( string $state ) : string
$state string
Результат string

setStatus() публичный метод

Set status
public setStatus ( integer $status ) : Newscoop\Entity\User
$status integer
Результат Newscoop\Entity\User

setStreet() публичный метод

Set street address
public setStreet ( string $street ) : string
$street string
Результат string

setSubscriber() публичный метод

Set subscriber
public setSubscriber ( integer $subscriber ) : Newscoop\Entity\User
$subscriber integer
Результат Newscoop\Entity\User

setUsername() публичный метод

Set username
public setUsername ( string $username ) : Newscoop\Entity\User
$username string
Результат Newscoop\Entity\User

unserialize() публичный метод

public unserialize ( $data )

updateProfile() публичный метод

Update user profile
public updateProfile ( string $username, string $password, string $firstName, string $lastName, string $image, array $attributes )
$username string
$password string
$firstName string
$lastName string
$image string
$attributes array

Описание свойств

$attributes защищенное свойство

protected Doctrine\Common\Collections\Collection; $attributes
Результат Doctrine\Common\Collections\Collection;

$author защищенное свойство

protected Newscoop\Entity\Author $author
Результат Newscoop\Entity\Author

$city защищенное свойство

protected string $city
Результат string

$clients защищенное свойство

protected Newscoop\Package\Package $clients
Результат Newscoop\Package\Package

$commenters защищенное свойство

protected Doctrine\Common\Collections\Collection; $commenters
Результат Doctrine\Common\Collections\Collection;

$countryCode защищенное свойство

protected string $countryCode
Результат string

$created защищенное свойство

protected DateTime $created
Результат DateTime

$email защищенное свойство

protected string $email
Результат string

$first_name защищенное свойство

protected string $first_name
Результат string

$groups защищенное свойство

protected Doctrine\Common\Collections\Collection; $groups
Результат Doctrine\Common\Collections\Collection;

$id защищенное свойство

protected int $id
Результат integer

$identities защищенное свойство

protected Doctrine\Common\Collections\Collection $identities
Результат Doctrine\Common\Collections\Collection

$image публичное свойство

public string $image
Результат string

$indexed защищенное свойство

protected DateTime $indexed
Результат DateTime

$is_admin защищенное свойство

protected bool $is_admin
Результат boolean

$is_public защищенное свойство

protected bool $is_public
Результат boolean

$lastLogin защищенное свойство

protected DateTime $lastLogin
Результат DateTime

$last_name защищенное свойство

protected string $last_name
Результат string

$password защищенное свойство

protected string $password
Результат string

$phone защищенное свойство

protected string $phone
Результат string

$points защищенное свойство

protected int $points
Результат integer

$postal защищенное свойство

protected string $postal
Результат string

$publication защищенное свойство

protected int $publication
Результат integer

$resetToken защищенное свойство

protected string $resetToken
Результат string

$role защищенное свойство

protected Role,Newscoop\Entity\Acl $role
Результат Newscoop\Entity\Acl\Role

$state защищенное свойство

protected string $state
Результат string

$status защищенное свойство

protected int $status
Результат integer

$street защищенное свойство

protected string $street
Результат string

$subscriber защищенное свойство

protected int $subscriber
Результат integer

$topics защищенное свойство

protected ArrayCollection,Doctrine\Common\Collections $topics
Результат Doctrine\Common\Collections\ArrayCollection

$updated защищенное свойство

protected DateTime $updated
Результат DateTime

$username защищенное свойство

protected string $username
Результат string