PHP Class Newscoop\Services\ListUserService

Show file Open project: sourcefabric/newscoop Class Usage Examples

Protected Properties

Property Type Description
$config array
$em Doctrine\ORM\EntityManager

Public Methods

Method Description
__construct ( array $config, EntityManager $em )
countBy ( array $criteria = [] ) : integer Count by given criteria
findBy ( array $criteria, array $orderBy = [], integer $limit = NULL, integer $offset = NULL ) : array Find by given criteria
findByCriteria ( UserCriteria $criteria ) : Newscoop\ListResult; Find by criteria
findEditors ( integer $limit = NULL, integer $offset = NULL ) : array List editors
findOneBy ( array $criteria ) : User Find one user by criteria
findUsersBySearch ( $search, $countOnly = false, $page = 1, $limit = 25 ) : array Find user by string
findUsersLastNameInRange ( $letters, $countOnly = false, $page = 1, $limit = 25 ) : array List users by first letter
getActiveUsers ( $countOnly = false, $page = 1, $limit = 8, $editors = [] ) : array List active users
getEditorsCount ( ) : integer Get editors count
getRandomList ( integer $limit = 25 ) : array Get random list of users

Protected Methods

Method Description
getRepository ( ) : Newscoop\Entity\Repository\UserRepository Get repository

Method Details

__construct() public method

public __construct ( array $config, EntityManager $em )
$config array
$em Doctrine\ORM\EntityManager

countBy() public method

Count by given criteria
public countBy ( array $criteria = [] ) : integer
$criteria array
return integer

findBy() public method

Find by given criteria
public findBy ( array $criteria, array $orderBy = [], integer $limit = NULL, integer $offset = NULL ) : array
$criteria array
$orderBy array
$limit integer
$offset integer
return array

findByCriteria() public method

Find by criteria
public findByCriteria ( UserCriteria $criteria ) : Newscoop\ListResult;
$criteria Newscoop\User\UserCriteria
return Newscoop\ListResult;

findEditors() public method

List editors
public findEditors ( integer $limit = NULL, integer $offset = NULL ) : array
$limit integer
$offset integer
return array

findOneBy() public method

Find one user by criteria
public findOneBy ( array $criteria ) : User
$criteria array
return Newscoop\Entity\User

findUsersBySearch() public method

Find user by string
public findUsersBySearch ( $search, $countOnly = false, $page = 1, $limit = 25 ) : array
return array

findUsersLastNameInRange() public method

List users by first letter
public findUsersLastNameInRange ( $letters, $countOnly = false, $page = 1, $limit = 25 ) : array
return array

getActiveUsers() public method

List active users
public getActiveUsers ( $countOnly = false, $page = 1, $limit = 8, $editors = [] ) : array
return array

getEditorsCount() public method

Get editors count
public getEditorsCount ( ) : integer
return integer

getRandomList() public method

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

getRepository() protected method

Get repository
protected getRepository ( ) : Newscoop\Entity\Repository\UserRepository
return Newscoop\Entity\Repository\UserRepository

Property Details

$config protected property

protected array $config
return array

$em protected property

protected EntityManager,Doctrine\ORM $em
return Doctrine\ORM\EntityManager