PHP Class Newscoop\Entity\Repository\UserRepository

Inheritance: extends Doctrine\ORM\EntityRepository
Mostra file Open project: sourcefabric/newscoop Class Usage Examples

Protected Properties

Property Type Description
$setters array

Public Methods

Method Description
countAll ( ) : integer Get total users count
countBy ( array $criteria ) : integer Get users count for given criteria
delete ( User $user ) : void Delete user
findActiveUsers ( boolean $countOnly, integer $offset, integer $limit, array $editorRoles ) : array | integer Find active members of community
findEditors ( integer $blogRole, integer $limit, integer $offset ) : array Get editors
findUsersLastNameInRange ( array $letters, $countOnly, $offset, $limit, $firstName = false ) : array Return Users if their last name begins with one of the letter passed in.
findVerifiedUsers ( $countOnly, $offset, $limit )
getActiveUsers ( $public = true )
getBatch ( $count = self::BATCH_COUNT, array $filter = null ) : array Find users for indexing
getEditorsCount ( integer $blogRole ) : integer Get editors count
getExternalLoginCount ( ) : integer Get external login count
getLatelyLoggedInUsers ( $daysNumber = 7, $count = false ) : integer Get getLatelyLoggedInUsers (logged in x days before today)
getListByCriteria ( UserCriteria $criteria, $results = true ) : Newscoop\ListResult Get list for given criteria
getNewscoopLoginCount ( ) : integer Get newscoop login count
getOneActiveUser ( $id, $public = true )
getRandomList ( integer $limit ) : array Get random list of users
isUnique ( string $property, string $value, integer $id = null ) : boolean Test if property value is unique
save ( User $user, array $values ) : void Save user
searchUsers ( string $search, $countOnly, $offset, $limit, array $attributes = ["first_name", "last_name", "username"] ) : array Return Users if any of their searched attributes contain the searched term.
setIndexedNow ( array $users ) : void Set indexed now
setIndexedNull ( array $items = null ) : void Set indexed null
setUserPoints ( User $user = null, string | integer $authorId = null ) : void Set user points

Private Methods

Method Description
addNameRangeWhere ( Doctrine\ORM\QueryBuilder $qb, array $letters ) : void Add name first letter where condition to query builder
createPublicUserQueryBuilder ( ) : Doctrine\ORM\QueryBuilder Create query builder for public users
getEditorIds ( array $editorRoles ) : array Get editor ids
getUserPointsSelect ( ) : string Get user points select statement
removeAttributes ( User $user ) : void Remove user attributes
setAttributes ( User $user, array $attributes ) : void Set user attributes
setProperties ( User $user, array $values ) : void Set user properties
setUserTypes ( User $user, array $types ) : void Set user types

Method Details

countAll() public method

Get total users count
public countAll ( ) : integer
return integer

countBy() public method

Get users count for given criteria
public countBy ( array $criteria ) : integer
$criteria array
return integer

delete() public method

Delete user
public delete ( User $user ) : void
$user Newscoop\Entity\User
return void

findActiveUsers() public method

Find active members of community
public findActiveUsers ( boolean $countOnly, integer $offset, integer $limit, array $editorRoles ) : array | integer
$countOnly boolean
$offset integer
$limit integer
$editorRoles array
return array | integer

findEditors() public method

Get editors
public findEditors ( integer $blogRole, integer $limit, integer $offset ) : array
$blogRole integer
$limit integer
$offset integer
return array

findUsersLastNameInRange() public method

Return Users if their last name begins with one of the letter passed in.
public findUsersLastNameInRange ( array $letters, $countOnly, $offset, $limit, $firstName = false ) : array
$letters array = ['a', 'b']
return array Newscoop\Entity\User

findVerifiedUsers() public method

public findVerifiedUsers ( $countOnly, $offset, $limit )

getActiveUsers() public method

public getActiveUsers ( $public = true )

getBatch() public method

Find users for indexing
public getBatch ( $count = self::BATCH_COUNT, array $filter = null ) : array
$filter array
return array

getEditorsCount() public method

Get editors count
public getEditorsCount ( integer $blogRole ) : integer
$blogRole integer
return integer

getExternalLoginCount() public method

Get external login count
public getExternalLoginCount ( ) : integer
return integer

getLatelyLoggedInUsers() public method

Get getLatelyLoggedInUsers (logged in x days before today)
public getLatelyLoggedInUsers ( $daysNumber = 7, $count = false ) : integer
return integer

getListByCriteria() public method

Get list for given criteria
public getListByCriteria ( UserCriteria $criteria, $results = true ) : Newscoop\ListResult
$criteria Newscoop\User\UserCriteria
return Newscoop\ListResult

getNewscoopLoginCount() public method

Get newscoop login count
public getNewscoopLoginCount ( ) : integer
return integer

getOneActiveUser() public method

public getOneActiveUser ( $id, $public = true )

getRandomList() public method

Get random list of users
public getRandomList ( integer $limit ) : array
$limit integer
return array

isUnique() public method

Test if property value is unique
public isUnique ( string $property, string $value, integer $id = null ) : boolean
$property string
$value string
$id integer
return boolean

save() public method

Save user
public save ( User $user, array $values ) : void
$user Newscoop\Entity\User
$values array
return void

searchUsers() public method

Return Users if any of their searched attributes contain the searched term.
public searchUsers ( string $search, $countOnly, $offset, $limit, array $attributes = ["first_name", "last_name", "username"] ) : array
$search string
$attributes array
return array Newscoop\Entity\User

setIndexedNow() public method

Set indexed now
public setIndexedNow ( array $users ) : void
$users array
return void

setIndexedNull() public method

Set indexed null
public setIndexedNull ( array $items = null ) : void
$items array
return void

setUserPoints() public method

Set user points
public setUserPoints ( User $user = null, string | integer $authorId = null ) : void
$user Newscoop\Entity\User
$authorId string | integer
return void

Property Details

$setters protected_oe property

protected array $setters
return array