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
Datei anzeigen Open project: sourcefabric/newscoop Class Usage Examples

Public Properties

Property Type Description
$image string

Protected Properties

Property 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

Public Methods

Method 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

Method 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 method

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

__toString() public method

public __toString ( ) : string
return string

addAttribute() public method

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

addClient() public method

Add oauth client
public addClient ( Client $client ) : Newscoop\Entity\User
$client Newscoop\GimmeBundle\Entity\Client
return Newscoop\Entity\User

addUserType() public method

Add user type
public addUserType ( Group $type ) : Newscoop\Entity\User
$type Newscoop\Entity\User\Group
return Newscoop\Entity\User

checkPassword() public method

Check password
public checkPassword ( string $password ) : boolean
$password string
return boolean

eraseCredentials() public method

Removes sensitive data from the user.
public eraseCredentials ( )

exists() public method

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

generateRandomString() final public method

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

getAttribute() public method

Get attribute
public getAttribute ( string $name ) : mixed
$name string
return mixed

getAttributes() public method

Get all user attributes
public getAttributes ( ) : array
return array of all user attributes

getAuthor() public method

Get author
public getAuthor ( ) : integer
return integer

getAuthorId() public method

Get author id
public getAuthorId ( ) : integer
return integer

getCity() public method

Get city
public getCity ( ) : string
return string

getClients() public method

Get oauth clients
public getClients ( ) : ArrayCollection
return Doctrine\Common\Collections\ArrayCollection

getCommenters() public method

public getCommenters ( )

getComments() public method

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

getCountryCode() public method

Get country code
public getCountryCode ( ) : string
return string

getCreated() public method

Get created datetime
public getCreated ( ) : DateTime
return DateTime

getDataTableView() public method

Get DataTable view
public getDataTableView ( Zend_View_Abstract $view ) : object
$view Zend_View_Abstract
return object

getEditView() public method

Get edit view
public getEditView ( Zend_View_Abstract $view ) : object
$view Zend_View_Abstract
return object

getEmail() public method

Get email
public getEmail ( ) : string
return string

getFirstName() public method

Get first name
public getFirstName ( ) : string
return string

getGroupNames() public method

Get group names
public getGroupNames ( ) : array
return array

getGroups() public method

Get groups
public getGroups ( ) : array
return array of Newscoop\Entity\User\Group

getId() public method

Get id
public getId ( ) : integer
return integer

getImage() public method

Get image
public getImage ( ) : string
return string

getIndexed() public method

Get indexed
public getIndexed ( ) : DateTime
return DateTime

getLastLogin() public method

Get lastLogin
public getLastLogin ( ) : void
return void

getLastName() public method

Get last name
public getLastName ( ) : string
return string

getName() public method

Get name
public getName ( ) : string
return string

getObject() public method

public getObject ( )

getPassword() public method

Get password for authentication
public getPassword ( ) : [type]
return [type]

getPhone() public method

Get phone
public getPhone ( ) : string
return string

getPoints() public method

Get points
public getPoints ( ) : integer
return integer

getPostal() public method

Get postal code
public getPostal ( ) : string
return string

getProperty() public method

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

getPublication() public method

Get publication id which user registered with
public getPublication ( ) : integer
return integer

getRawAttributes() public method

Get raw user attributes
public getRawAttributes ( ) : array
return array

getRealName() public method

Get real name
public getRealName ( ) : string
return string

getResetToken() public method

Get password reset token
public getResetToken ( ) : string
return string

getRoleId() public method

Get role id
public getRoleId ( ) : integer
return integer

getRoles() public method

Get user roles for authentication
public getRoles ( ) : array
return array array with roles

getSalt() public method

Get password salt for authentication
public getSalt ( ) : string
return string

getState() public method

Get state
public getState ( ) : string
return string

getStatus() public method

Get status
public getStatus ( ) : integer
return integer

getStreet() public method

Get street address
public getStreet ( ) : string
return string

getSubscriber() public method

Get subscriber
public getSubscriber ( ) : integer
return integer

getTopics() public method

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

getUpdated() public method

Get updated datetime
public getUpdated ( ) : DateTime
return DateTime

getUserId() public method

Get user id proxy to getId
public getUserId ( ) : integer
return integer

getUserTypes() public method

Get user types
public getUserTypes ( ) : array
return array

getUsername() public method

Get username
public getUsername ( ) : string
return string

getView() public method

Get view
public getView ( ) : UserView
return Newscoop\View\UserView

hasClient() public method

Has client
public hasClient ( Client $client ) : boolean
$client Newscoop\GimmeBundle\Entity\Client
return boolean

hasGroup() public method

Test if user has group
public hasGroup ( string $name ) : boolean
$name string
return boolean

hasPermission() public method

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

isAccountNonExpired() public method

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

isAccountNonLocked() public method

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

isActive() public method

Test if user is active
public isActive ( ) : boolean
return boolean

isAdmin() public method

Test if user is admin
public isAdmin ( ) : boolean
return boolean

isBanned() public method

Test if user is banned
public isBanned ( ) : boolean
return boolean

isCredentialsNonExpired() public method

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

isEnabled() public method

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

isEqualTo() public method

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

isPending() public method

Test if user is pending
public isPending ( ) : boolean
return boolean

isPublic() public method

Test if user is public
public isPublic ( ) : boolean
return boolean

preUpdate() public method

public preUpdate ( )

removeAttribute() public method

Remove attribute
public removeAttribute ( string $name ) : Newscoop\Entity\UserAttribute
$name string
return Newscoop\Entity\UserAttribute

rename() public method

Rename user
public rename ( string $username ) : void
$username string
return void

render() public method

Render user
public render ( ) : UserView
return Newscoop\View\UserView

serialize() public method

public serialize ( )

setActive() public method

Set user as active
public setActive ( ) : Newscoop\Entity\User
return Newscoop\Entity\User

setAdmin() public method

Set admin switch
public setAdmin ( boolean $admin ) : Newscoop\Entity\User
$admin boolean
return Newscoop\Entity\User

setAttributes() public method

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

setAuthor() public method

Set author
public setAuthor ( Author $author = null ) : Newscoop\Entity\User
$author Author
return Newscoop\Entity\User

setCity() public method

Set city
public setCity ( string $city ) : string
$city string
return string

setCountryCode() public method

Set country code
public setCountryCode ( string $countryCode ) : string
$countryCode string
return string

setEmail() public method

Set email
public setEmail ( string $email ) : Newscoop\Entity\User
$email string
return Newscoop\Entity\User

setFirstName() public method

Set first name
public setFirstName ( string $first_name ) : Newscoop\Entity\User
$first_name string
return Newscoop\Entity\User

setImage() public method

Set image
public setImage ( string $image ) : Newscoop\Entity\User
$image string
return Newscoop\Entity\User

setIndexed() public method

Set indexed
public setIndexed ( DateTime $indexed = null ) : self
$indexed DateTime
return self

setLastLogin() public method

Set lastLogin
public setLastLogin ( DateTime $lastLogin = null ) : void
$lastLogin DateTime
return void

setLastName() public method

Set last name
public setLastName ( string $last_name ) : Newscoop\Entity\User
$last_name string
return Newscoop\Entity\User

setPassword() public method

Set password
public setPassword ( string $password ) : Newscoop\Entity\User
$password string
return Newscoop\Entity\User

setPhone() public method

Set phone
public setPhone ( string $phone ) : string
$phone string
return string

setPoints() public method

Set points
public setPoints ( integer $points ) : Newscoop\Entity\User
$points integer
return Newscoop\Entity\User

setPostal() public method

Set postal code
public setPostal ( string $postal ) : string
$postal string
return string

setPublic() public method

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

setPublication() public method

Set publication which user registered with
public setPublication ( integer $publication ) : integer
$publication integer Publication id
return integer

setResetToken() public method

Set password reset token
public setResetToken ( integer $resetToken ) : string
$resetToken integer
return string

setRole() public method

Set role
public setRole ( Role $role ) : Newscoop\Entity\User
$role Newscoop\Entity\Acl\Role
return Newscoop\Entity\User

setState() public method

Set state
public setState ( string $state ) : string
$state string
return string

setStatus() public method

Set status
public setStatus ( integer $status ) : Newscoop\Entity\User
$status integer
return Newscoop\Entity\User

setStreet() public method

Set street address
public setStreet ( string $street ) : string
$street string
return string

setSubscriber() public method

Set subscriber
public setSubscriber ( integer $subscriber ) : Newscoop\Entity\User
$subscriber integer
return Newscoop\Entity\User

setUsername() public method

Set username
public setUsername ( string $username ) : Newscoop\Entity\User
$username string
return Newscoop\Entity\User

unserialize() public method

public unserialize ( $data )

updateProfile() public method

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
return Doctrine\Common\Collections\Collection;

$author protected_oe property

protected Newscoop\Entity\Author $author
return Newscoop\Entity\Author

$city protected_oe property

protected string $city
return string

$clients protected_oe property

protected Newscoop\Package\Package $clients
return Newscoop\Package\Package

$commenters protected_oe property

protected Doctrine\Common\Collections\Collection; $commenters
return Doctrine\Common\Collections\Collection;

$countryCode protected_oe property

protected string $countryCode
return string

$created protected_oe property

protected DateTime $created
return DateTime

$email protected_oe property

protected string $email
return string

$first_name protected_oe property

protected string $first_name
return string

$groups protected_oe property

protected Doctrine\Common\Collections\Collection; $groups
return Doctrine\Common\Collections\Collection;

$id protected_oe property

protected int $id
return integer

$identities protected_oe property

protected Doctrine\Common\Collections\Collection $identities
return Doctrine\Common\Collections\Collection

$image public_oe property

public string $image
return string

$indexed protected_oe property

protected DateTime $indexed
return DateTime

$is_admin protected_oe property

protected bool $is_admin
return boolean

$is_public protected_oe property

protected bool $is_public
return boolean

$lastLogin protected_oe property

protected DateTime $lastLogin
return DateTime

$last_name protected_oe property

protected string $last_name
return string

$password protected_oe property

protected string $password
return string

$phone protected_oe property

protected string $phone
return string

$points protected_oe property

protected int $points
return integer

$postal protected_oe property

protected string $postal
return string

$publication protected_oe property

protected int $publication
return integer

$resetToken protected_oe property

protected string $resetToken
return string

$role protected_oe property

protected Role,Newscoop\Entity\Acl $role
return Newscoop\Entity\Acl\Role

$state protected_oe property

protected string $state
return string

$status protected_oe property

protected int $status
return integer

$street protected_oe property

protected string $street
return string

$subscriber protected_oe property

protected int $subscriber
return integer

$topics protected_oe property

protected ArrayCollection,Doctrine\Common\Collections $topics
return Doctrine\Common\Collections\ArrayCollection

$updated protected_oe property

protected DateTime $updated
return DateTime

$username protected_oe property

protected string $username
return string