PHP 클래스 Newscoop\Services\UserService

파일 보기 프로젝트 열기: sourcefabric/newscoop 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$auth Zend_Auth
$currentUser Newscoop\Entity\User
$em Doctrine\Common\Persistence\ObjectManager
$repository Newscoop\Entity\Repository\UserRepository
$security Symfony\Component\Security\Core\SecurityContext
$userIp

공개 메소드들

메소드 설명
__construct ( Doctrine\Common\Persistence\ObjectManager $em, Zend_Auth $auth, SecurityContext $security )
checkUsername ( string $username ) : boolean Test if username is available
countAll ( ) : integer Count all users
countBy ( array $criteria ) : integer Count users by given criteria
createPending ( string $email, string | null $firstName = null, string | null $lastName = null, string | null $subscriber = null, $publication = null ) : User Create pending user
createUser ( string $email, string $password, $username, string $firstName = null, string $lastName = null, integer $publication, $public = true, $userTypes = [], $isAdmin = false ) Create new activated user
delete ( User $user ) : void Delete user
extractCriteriaFromRequest ( $request )
find ( integer $id ) : User Find user
findAll ( ) : mixed Find all users
findBy ( array $criteria, array $orderBy = null, integer | null $limit = null, integer | null $offset = null ) : mixed Find by given criteria
findByAuthor ( integer $authorId ) : User | null Find user by author
findOneBy ( array $criteria ) : User Find one by given criteria
generateUsername ( string $firstName, string $lastName ) : string Generate username
getClassName ( ) : string Get user entity class name
getCollection ( array $criteria, array $orderBy, integer $limit = null, integer $offset = null ) : PaginatedCollection Get collection by given criteria
getCurrentUser ( ) : User Get current user
getGroupOptions ( ) : array Get user group options
getPublicUserCount ( ) : integer Get count of public users
getUserIp ( ) : string Get user IP
loadUserByUsername ( $username )
loginUser ( User $user, string $providerKey ) : UsernamePasswordToken Log in user
renameUser ( object $command ) : void Rename user
save ( array $data, User $user = null ) : User Save user
savePending ( array $data, User $user ) : void Save pending user
setActive ( User $user ) : void Set user active
setUserIp ( string $userIp = null ) : string Set user IP
updateUserPoints ( Symfony\Component\EventDispatcher\GenericEvent $event ) : void Update user points
userIpResolver ( Request $request ) : string Resolve user IP from provided data

비공개 메소드들

메소드 설명
getRepository ( ) : Newscoop\Entity\Repository\UserRepository Get repository for user entity

메소드 상세

__construct() 공개 메소드

public __construct ( Doctrine\Common\Persistence\ObjectManager $em, Zend_Auth $auth, SecurityContext $security )
$em Doctrine\Common\Persistence\ObjectManager
$auth Zend_Auth
$security Symfony\Component\Security\Core\SecurityContext

checkUsername() 공개 메소드

Test if username is available
public checkUsername ( string $username ) : boolean
$username string
리턴 boolean

countAll() 공개 메소드

Count all users
public countAll ( ) : integer
리턴 integer

countBy() 공개 메소드

Count users by given criteria
public countBy ( array $criteria ) : integer
$criteria array
리턴 integer

createPending() 공개 메소드

Create pending user
public createPending ( string $email, string | null $firstName = null, string | null $lastName = null, string | null $subscriber = null, $publication = null ) : User
$email string
$firstName string | null
$lastName string | null
$subscriber string | null
리턴 Newscoop\Entity\User

createUser() 공개 메소드

Create new activated user
public createUser ( string $email, string $password, $username, string $firstName = null, string $lastName = null, integer $publication, $public = true, $userTypes = [], $isAdmin = false )
$email string
$password string
$firstName string
$lastName string
$publication integer

delete() 공개 메소드

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

extractCriteriaFromRequest() 공개 메소드

public extractCriteriaFromRequest ( $request )

find() 공개 메소드

Find user
public find ( integer $id ) : User
$id integer
리턴 Newscoop\Entity\User

findAll() 공개 메소드

Find all users
public findAll ( ) : mixed
리턴 mixed

findBy() 공개 메소드

Find by given criteria
public findBy ( array $criteria, array $orderBy = null, integer | null $limit = null, integer | null $offset = null ) : mixed
$criteria array
$orderBy array
$limit integer | null
$offset integer | null
리턴 mixed

findByAuthor() 공개 메소드

Find user by author
public findByAuthor ( integer $authorId ) : User | null
$authorId integer
리턴 Newscoop\Entity\User | null

findOneBy() 공개 메소드

Find one by given criteria
public findOneBy ( array $criteria ) : User
$criteria array
리턴 Newscoop\Entity\User

generateUsername() 공개 메소드

Generate username
public generateUsername ( string $firstName, string $lastName ) : string
$firstName string
$lastName string
리턴 string

getClassName() 공개 메소드

Get user entity class name
public getClassName ( ) : string
리턴 string

getCollection() 공개 메소드

Get collection by given criteria
public getCollection ( array $criteria, array $orderBy, integer $limit = null, integer $offset = null ) : PaginatedCollection
$criteria array
$orderBy array
$limit integer
$offset integer
리턴 Newscoop\PaginatedCollection

getCurrentUser() 공개 메소드

Get current user
public getCurrentUser ( ) : User
리턴 Newscoop\Entity\User

getGroupOptions() 공개 메소드

Get user group options
public getGroupOptions ( ) : array
리턴 array

getPublicUserCount() 공개 메소드

Get count of public users
public getPublicUserCount ( ) : integer
리턴 integer

getUserIp() 공개 메소드

Get user IP
public getUserIp ( ) : string
리턴 string

loadUserByUsername() 공개 메소드

public loadUserByUsername ( $username )

loginUser() 공개 메소드

Log in user
public loginUser ( User $user, string $providerKey ) : UsernamePasswordToken
$user Newscoop\Entity\User
$providerKey string
리턴 Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken

renameUser() 공개 메소드

Rename user
public renameUser ( object $command ) : void
$command object
리턴 void

save() 공개 메소드

Save user
public save ( array $data, User $user = null ) : User
$data array
$user Newscoop\Entity\User
리턴 Newscoop\Entity\User

savePending() 공개 메소드

Save pending user
public savePending ( array $data, User $user ) : void
$data array
$user Newscoop\Entity\User
리턴 void

setActive() 공개 메소드

Set user active
public setActive ( User $user ) : void
$user Newscoop\Entity\User
리턴 void

setUserIp() 공개 메소드

Set user IP
public setUserIp ( string $userIp = null ) : string
$userIp string User IP
리턴 string

updateUserPoints() 공개 메소드

Update user points
public updateUserPoints ( Symfony\Component\EventDispatcher\GenericEvent $event ) : void
$event Symfony\Component\EventDispatcher\GenericEvent
리턴 void

userIpResolver() 공개 메소드

Resolve user IP from provided data
public userIpResolver ( Request $request ) : string
$request Symfony\Component\HttpFoundation\Request Request object
리턴 string $userIp User IP

프로퍼티 상세

$auth 보호되어 있는 프로퍼티

protected Zend_Auth $auth
리턴 Zend_Auth

$currentUser 보호되어 있는 프로퍼티

protected User,Newscoop\Entity $currentUser
리턴 Newscoop\Entity\User

$em 보호되어 있는 프로퍼티

protected ObjectManager,Doctrine\Common\Persistence $em
리턴 Doctrine\Common\Persistence\ObjectManager

$repository 보호되어 있는 프로퍼티

protected UserRepository,Newscoop\Entity\Repository $repository
리턴 Newscoop\Entity\Repository\UserRepository

$security 보호되어 있는 프로퍼티

protected SecurityContext,Symfony\Component\Security\Core $security
리턴 Symfony\Component\Security\Core\SecurityContext

$userIp 보호되어 있는 프로퍼티

protected $userIp