PHP Class Newscoop\Entity\User

Inheritance: 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
Afficher le fichier Open project: sourcefabric/newscoop Class Usage Examples

Méthodes publiques

Свойство Type Description
$image string

Protected Properties

Свойство Type Description
$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

Méthodes publiques

Méthode Description
__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

Private Methods

Méthode Description
getViewUrl ( string $action, Zend_View_Abstract $view ) : string TODO: move this to user service - it's not a part of entity

Method Details

__construct() public méthode

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

__toString() public méthode

public __toString ( ) : string
Résultat string

addAttribute() public méthode

Add attribute
public addAttribute ( string $name, string $value ) : Newscoop\Entity\User
$name string
$value string
Résultat Newscoop\Entity\User

addClient() public méthode

Add oauth client
public addClient ( Client $client ) : Newscoop\Entity\User
$client Newscoop\GimmeBundle\Entity\Client
Résultat Newscoop\Entity\User

addUserType() public méthode

Add user type
public addUserType ( Group $type ) : Newscoop\Entity\User
$type Newscoop\Entity\User\Group
Résultat Newscoop\Entity\User

checkPassword() public méthode

Check password
public checkPassword ( string $password ) : boolean
$password string
Résultat boolean

eraseCredentials() public méthode

Removes sensitive data from the user.
public eraseCredentials ( )

exists() public méthode

Check if the user exists Test if there is set an id
Deprecation: legacy from frontend controllers
public exists ( ) : boolean
Résultat boolean

generateRandomString() final public méthode

Get random string
final public generateRandomString ( integer $length = 12, string $allowed_chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' ) : string
$length integer
$allowed_chars string
Résultat string

getAttribute() public méthode

Get attribute
public getAttribute ( string $name ) : mixed
$name string
Résultat mixed

getAttributes() public méthode

Get all user attributes
public getAttributes ( ) : array
Résultat array of all user attributes

getAuthor() public méthode

Get author
public getAuthor ( ) : integer
Résultat integer

getAuthorId() public méthode

Get author id
public getAuthorId ( ) : integer
Résultat integer

getCity() public méthode

Get city
public getCity ( ) : string
Résultat string

getClients() public méthode

Get oauth clients
public getClients ( ) : ArrayCollection
Résultat Doctrine\Common\Collections\ArrayCollection

getCommenters() public méthode

public getCommenters ( )

getComments() public méthode

Get a User's comments which are associated with his User account.
public getComments ( ) : array
Résultat array

getCountryCode() public méthode

Get country code
public getCountryCode ( ) : string
Résultat string

getCreated() public méthode

Get created datetime
public getCreated ( ) : DateTime
Résultat DateTime

getDataTableView() public méthode

Get DataTable view
public getDataTableView ( Zend_View_Abstract $view ) : object
$view Zend_View_Abstract
Résultat object

getEditView() public méthode

Get edit view
public getEditView ( Zend_View_Abstract $view ) : object
$view Zend_View_Abstract
Résultat object

getEmail() public méthode

Get email
public getEmail ( ) : string
Résultat string

getFirstName() public méthode

Get first name
public getFirstName ( ) : string
Résultat string

getGroupNames() public méthode

Get group names
public getGroupNames ( ) : array
Résultat array

getGroups() public méthode

Get groups
public getGroups ( ) : array
Résultat array of Newscoop\Entity\User\Group

getId() public méthode

Get id
public getId ( ) : integer
Résultat integer

getImage() public méthode

Get image
public getImage ( ) : string
Résultat string

getIndexed() public méthode

Get indexed
public getIndexed ( ) : DateTime
Résultat DateTime

getLastLogin() public méthode

Get lastLogin
public getLastLogin ( ) : void
Résultat void

getLastName() public méthode

Get last name
public getLastName ( ) : string
Résultat string

getName() public méthode

Get name
public getName ( ) : string
Résultat string

getObject() public méthode

public getObject ( )

getPassword() public méthode

Get password for authentication
public getPassword ( ) : [type]
Résultat [type]

getPhone() public méthode

Get phone
public getPhone ( ) : string
Résultat string

getPoints() public méthode

Get points
public getPoints ( ) : integer
Résultat integer

getPostal() public méthode

Get postal code
public getPostal ( ) : string
Résultat string

getProperty() public méthode

Get an enity property
Deprecation: legacy from frontend controllers
public getProperty ( $p_key ) : mixed
$p_key
Résultat mixed

getPublication() public méthode

Get publication id which user registered with
public getPublication ( ) : integer
Résultat integer

getRawAttributes() public méthode

Get raw user attributes
public getRawAttributes ( ) : array
Résultat array

getRealName() public méthode

Get real name
public getRealName ( ) : string
Résultat string

getResetToken() public méthode

Get password reset token
public getResetToken ( ) : string
Résultat string

getRoleId() public méthode

Get role id
public getRoleId ( ) : integer
Résultat integer

getRoles() public méthode

Get user roles for authentication
public getRoles ( ) : array
Résultat array array with roles

getSalt() public méthode

Get password salt for authentication
public getSalt ( ) : string
Résultat string

getState() public méthode

Get state
public getState ( ) : string
Résultat string

getStatus() public méthode

Get status
public getStatus ( ) : integer
Résultat integer

getStreet() public méthode

Get street address
public getStreet ( ) : string
Résultat string

getSubscriber() public méthode

Get subscriber
public getSubscriber ( ) : integer
Résultat integer

getTopics() public méthode

Gets user's topics
public getTopics ( ) : ArrayCollection | null
Résultat Doctrine\Common\Collections\ArrayCollection | null

getUpdated() public méthode

Get updated datetime
public getUpdated ( ) : DateTime
Résultat DateTime

getUserId() public méthode

Get user id proxy to getId
public getUserId ( ) : integer
Résultat integer

getUserTypes() public méthode

Get user types
public getUserTypes ( ) : array
Résultat array

getUsername() public méthode

Get username
public getUsername ( ) : string
Résultat string

getView() public méthode

Get view
public getView ( ) : UserView
Résultat Newscoop\View\UserView

hasClient() public méthode

Has client
public hasClient ( Client $client ) : boolean
$client Newscoop\GimmeBundle\Entity\Client
Résultat boolean

hasGroup() public méthode

Test if user has group
public hasGroup ( string $name ) : boolean
$name string
Résultat boolean

hasPermission() public méthode

Check permissions
public hasPermission ( string $permission, string $resource = null, string $action = null ) : boolean
$permission string
$resource string
$action string
Résultat boolean

isAccountNonExpired() public méthode

Checks if the user account is not expired.
public isAccountNonExpired ( ) : boolean
Résultat boolean In active status

isAccountNonLocked() public méthode

Checks if the user account is not locked. Currently there is no seperation between pending and banned.
public isAccountNonLocked ( ) : boolean
Résultat boolean Not locked status

isActive() public méthode

Test if user is active
public isActive ( ) : boolean
Résultat boolean

isAdmin() public méthode

Test if user is admin
public isAdmin ( ) : boolean
Résultat boolean

isBanned() public méthode

Test if user is banned
public isBanned ( ) : boolean
Résultat boolean

isCredentialsNonExpired() public méthode

Checks if credentials are expired. We don't have this mechanism in Newscoop.
public isCredentialsNonExpired ( ) : boolean
Résultat boolean Not credentials expired status

isEnabled() public méthode

Checks if the user account is enabled.
public isEnabled ( ) : boolean
Résultat boolean Active status

isEqualTo() public méthode

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

isPending() public méthode

Test if user is pending
public isPending ( ) : boolean
Résultat boolean

isPublic() public méthode

Test if user is public
public isPublic ( ) : boolean
Résultat boolean

preUpdate() public méthode

public preUpdate ( )

removeAttribute() public méthode

Remove attribute
public removeAttribute ( string $name ) : Newscoop\Entity\UserAttribute
$name string
Résultat Newscoop\Entity\UserAttribute

rename() public méthode

Rename user
public rename ( string $username ) : void
$username string
Résultat void

render() public méthode

Render user
public render ( ) : UserView
Résultat Newscoop\View\UserView

serialize() public méthode

public serialize ( )

setActive() public méthode

Set user as active
public setActive ( ) : Newscoop\Entity\User
Résultat Newscoop\Entity\User

setAdmin() public méthode

Set admin switch
public setAdmin ( boolean $admin ) : Newscoop\Entity\User
$admin boolean
Résultat Newscoop\Entity\User

setAttributes() public méthode

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

setAuthor() public méthode

Set author
public setAuthor ( Author $author = null ) : Newscoop\Entity\User
$author Author
Résultat Newscoop\Entity\User

setCity() public méthode

Set city
public setCity ( string $city ) : string
$city string
Résultat string

setCountryCode() public méthode

Set country code
public setCountryCode ( string $countryCode ) : string
$countryCode string
Résultat string

setEmail() public méthode

Set email
public setEmail ( string $email ) : Newscoop\Entity\User
$email string
Résultat Newscoop\Entity\User

setFirstName() public méthode

Set first name
public setFirstName ( string $first_name ) : Newscoop\Entity\User
$first_name string
Résultat Newscoop\Entity\User

setImage() public méthode

Set image
public setImage ( string $image ) : Newscoop\Entity\User
$image string
Résultat Newscoop\Entity\User

setIndexed() public méthode

Set indexed
public setIndexed ( DateTime $indexed = null ) : self
$indexed DateTime
Résultat self

setLastLogin() public méthode

Set lastLogin
public setLastLogin ( DateTime $lastLogin = null ) : void
$lastLogin DateTime
Résultat void

setLastName() public méthode

Set last name
public setLastName ( string $last_name ) : Newscoop\Entity\User
$last_name string
Résultat Newscoop\Entity\User

setPassword() public méthode

Set password
public setPassword ( string $password ) : Newscoop\Entity\User
$password string
Résultat Newscoop\Entity\User

setPhone() public méthode

Set phone
public setPhone ( string $phone ) : string
$phone string
Résultat string

setPoints() public méthode

Set points
public setPoints ( integer $points ) : Newscoop\Entity\User
$points integer
Résultat Newscoop\Entity\User

setPostal() public méthode

Set postal code
public setPostal ( string $postal ) : string
$postal string
Résultat string

setPublic() public méthode

Set user is public
public setPublic ( boolean $public = true ) : Newscoop\Entity\User
$public boolean
Résultat Newscoop\Entity\User

setPublication() public méthode

Set publication which user registered with
public setPublication ( integer $publication ) : integer
$publication integer Publication id
Résultat integer

setResetToken() public méthode

Set password reset token
public setResetToken ( integer $resetToken ) : string
$resetToken integer
Résultat string

setRole() public méthode

Set role
public setRole ( Role $role ) : Newscoop\Entity\User
$role Newscoop\Entity\Acl\Role
Résultat Newscoop\Entity\User

setState() public méthode

Set state
public setState ( string $state ) : string
$state string
Résultat string

setStatus() public méthode

Set status
public setStatus ( integer $status ) : Newscoop\Entity\User
$status integer
Résultat Newscoop\Entity\User

setStreet() public méthode

Set street address
public setStreet ( string $street ) : string
$street string
Résultat string

setSubscriber() public méthode

Set subscriber
public setSubscriber ( integer $subscriber ) : Newscoop\Entity\User
$subscriber integer
Résultat Newscoop\Entity\User

setUsername() public méthode

Set username
public setUsername ( string $username ) : Newscoop\Entity\User
$username string
Résultat Newscoop\Entity\User

unserialize() public méthode

public unserialize ( $data )

updateProfile() public méthode

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

Property Details

$attributes protected_oe property

protected Doctrine\Common\Collections\Collection; $attributes
Résultat Doctrine\Common\Collections\Collection;

$author protected_oe property

protected Newscoop\Entity\Author $author
Résultat Newscoop\Entity\Author

$city protected_oe property

protected string $city
Résultat string

$clients protected_oe property

protected Newscoop\Package\Package $clients
Résultat Newscoop\Package\Package

$commenters protected_oe property

protected Doctrine\Common\Collections\Collection; $commenters
Résultat Doctrine\Common\Collections\Collection;

$countryCode protected_oe property

protected string $countryCode
Résultat string

$created protected_oe property

protected DateTime $created
Résultat DateTime

$email protected_oe property

protected string $email
Résultat string

$first_name protected_oe property

protected string $first_name
Résultat string

$groups protected_oe property

protected Doctrine\Common\Collections\Collection; $groups
Résultat Doctrine\Common\Collections\Collection;

$id protected_oe property

protected int $id
Résultat integer

$identities protected_oe property

protected Doctrine\Common\Collections\Collection $identities
Résultat Doctrine\Common\Collections\Collection

$image public_oe property

public string $image
Résultat string

$indexed protected_oe property

protected DateTime $indexed
Résultat DateTime

$is_admin protected_oe property

protected bool $is_admin
Résultat boolean

$is_public protected_oe property

protected bool $is_public
Résultat boolean

$lastLogin protected_oe property

protected DateTime $lastLogin
Résultat DateTime

$last_name protected_oe property

protected string $last_name
Résultat string

$password protected_oe property

protected string $password
Résultat string

$phone protected_oe property

protected string $phone
Résultat string

$points protected_oe property

protected int $points
Résultat integer

$postal protected_oe property

protected string $postal
Résultat string

$publication protected_oe property

protected int $publication
Résultat integer

$resetToken protected_oe property

protected string $resetToken
Résultat string

$role protected_oe property

protected Role,Newscoop\Entity\Acl $role
Résultat Newscoop\Entity\Acl\Role

$state protected_oe property

protected string $state
Résultat string

$status protected_oe property

protected int $status
Résultat integer

$street protected_oe property

protected string $street
Résultat string

$subscriber protected_oe property

protected int $subscriber
Résultat integer

$topics protected_oe property

protected ArrayCollection,Doctrine\Common\Collections $topics
Résultat Doctrine\Common\Collections\ArrayCollection

$updated protected_oe property

protected DateTime $updated
Résultat DateTime

$username protected_oe property

protected string $username
Résultat string