PHP 클래스 Airship\Cabin\Bridge\Blueprint\Author

This contains all of the methods used for managing authors. It's mostly used by the Author landing, although some methods are used in Airship\Cabin\Bridge\Landing\Blog as well.
상속: extends BlueprintGear, use trait Common, use trait Orderable, use trait Slug
파일 보기 프로젝트 열기: paragonie/airship 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$photosDir string

공개 메소드들

메소드 설명
addUserByUniqueId ( integer $authorId, string $uniqueId, boolean $inCharge = false ) : boolean Add a user, given its unique id.
createAuthor ( array $post ) : boolean Create a new Author profile
deleteAuthor ( integer $authorId, integer $reassignTo ) : boolean Delete an author profile
getAll ( string $sortby = 'name', string $dir = 'ASC' ) : array Get all authors, sorting by a particular field
getAuthorIdsForUser ( integer $userid ) : array Get all of the authors available for this user to post under
getAvailablePhotos ( integer $authorID, string $cabin = '', boolean $includeId = false ) : array Get all of the photos in the various
getById ( integer $authorId ) : array Get an author by its ID
getForUser ( integer $userId, string $sortby = 'name', string $dir = 'ASC' ) : array Get all of the authors available for this user to post under
getName ( integer $authorId ) : string Get the author's name
getNumBlogPostsForAuthor ( integer $authorId ) : integer Get the number of photos uploaded for this author
getNumCommentsForAuthor ( integer $authorId ) : integer Get the number of photos uploaded for this author
getNumFilesForAuthor ( integer $authorId ) : integer Get the number of files uploaded for this author
getNumUsersForAuthor ( integer $authorId ) : integer Get the number of users that have access to this author
getPhotoContextId ( string $label ) : integer Get the available photo contexts
getPhotoContexts ( ) : array Get the available photo contexts
getPhotoData ( integer $authorID, string $context ) : array Get all of the photos in the various
getPhotoDirName ( ) : string Get the name of the photos directory (usually: "photos")
getSlug ( integer $authorId ) : string Get the slug for a given Author (given its ID)
getUsersForAuthor ( integer $authorId ) : array Get the users that have access to an Author.
numAuthors ( ) : integer Get the number of Authors that exist.
removeUserByUniqueId ( integer $authorId, string $uniqueId ) : boolean Remove a user from this author
savePhotoChoice ( integer $authorId, string $context, string $cabin, string $filename ) : boolean Save the photo to display in a given context.
toggleOwnerStatus ( integer $authorId, string $uniqueId ) : boolean Toggle the 'owner' flag.
updateAuthor ( integer $authorId, array $post ) : boolean Update an author profile
updateAuthorSlug ( integer $authorId, array $post ) : boolean Should we update the author's slug?
userHasAccess ( integer $authorId, integer $userId ) : boolean Is this user an owner of the given
userIsOwner ( integer $authorId, integer $userId ) : boolean Is this user an owner of the given

보호된 메소드들

메소드 설명
deleteAuthorCascade ( integer $authorId ) Overloadable. Delete all entries that depend on the authors table in any capacity.
getPhotoDirectory ( string $slug, string $cabin ) : integer Get photos directory ID
reassignAuthorship ( integer $oldAuthorId, integer $newAuthorId ) Overloadable. Reassign all entries that depend on the authors table in any capacity to a differnet author (or NULL).

메소드 상세

addUserByUniqueId() 공개 메소드

Add a user, given its unique id.
public addUserByUniqueId ( integer $authorId, string $uniqueId, boolean $inCharge = false ) : boolean
$authorId integer
$uniqueId string
$inCharge boolean
리턴 boolean

createAuthor() 공개 메소드

Create a new Author profile
public createAuthor ( array $post ) : boolean
$post array
리턴 boolean

deleteAuthor() 공개 메소드

Delete an author profile
public deleteAuthor ( integer $authorId, integer $reassignTo ) : boolean
$authorId integer
$reassignTo integer
리턴 boolean

deleteAuthorCascade() 보호된 메소드

Overloadable. Delete all entries that depend on the authors table in any capacity.
protected deleteAuthorCascade ( integer $authorId )
$authorId integer

getAll() 공개 메소드

Get all authors, sorting by a particular field
public getAll ( string $sortby = 'name', string $dir = 'ASC' ) : array
$sortby string
$dir string
리턴 array

getAuthorIdsForUser() 공개 메소드

Get all of the authors available for this user to post under
public getAuthorIdsForUser ( integer $userid ) : array
$userid integer
리턴 array

getAvailablePhotos() 공개 메소드

1. Get the directories for each cabin. 2. Get all of the file IDs for these directories. Our SQL query should automatically draw in the "context" parameter.
public getAvailablePhotos ( integer $authorID, string $cabin = '', boolean $includeId = false ) : array
$authorID integer
$cabin string
$includeId boolean
리턴 array

getById() 공개 메소드

Get an author by its ID
public getById ( integer $authorId ) : array
$authorId integer
리턴 array

getForUser() 공개 메소드

Get all of the authors available for this user to post under
public getForUser ( integer $userId, string $sortby = 'name', string $dir = 'ASC' ) : array
$userId integer
$sortby string
$dir string
리턴 array

getName() 공개 메소드

Get the author's name
public getName ( integer $authorId ) : string
$authorId integer
리턴 string

getNumBlogPostsForAuthor() 공개 메소드

Get the number of photos uploaded for this author
public getNumBlogPostsForAuthor ( integer $authorId ) : integer
$authorId integer
리턴 integer

getNumCommentsForAuthor() 공개 메소드

Get the number of photos uploaded for this author
public getNumCommentsForAuthor ( integer $authorId ) : integer
$authorId integer
리턴 integer

getNumFilesForAuthor() 공개 메소드

Get the number of files uploaded for this author
public getNumFilesForAuthor ( integer $authorId ) : integer
$authorId integer
리턴 integer

getNumUsersForAuthor() 공개 메소드

Get the number of users that have access to this author
public getNumUsersForAuthor ( integer $authorId ) : integer
$authorId integer
리턴 integer

getPhotoContextId() 공개 메소드

Get the available photo contexts
public getPhotoContextId ( string $label ) : integer
$label string
리턴 integer

getPhotoContexts() 공개 메소드

Get the available photo contexts
public getPhotoContexts ( ) : array
리턴 array

getPhotoData() 공개 메소드

1. Get the directories for each cabin. 2. Get all of the file IDs for these directories. Our SQL query should automatically draw in the "context" parameter.
public getPhotoData ( integer $authorID, string $context ) : array
$authorID integer
$context string
리턴 array

getPhotoDirName() 공개 메소드

Get the name of the photos directory (usually: "photos")
public getPhotoDirName ( ) : string
리턴 string

getPhotoDirectory() 보호된 메소드

Get photos directory ID
protected getPhotoDirectory ( string $slug, string $cabin ) : integer
$slug string
$cabin string
리턴 integer

getSlug() 공개 메소드

Get the slug for a given Author (given its ID)
public getSlug ( integer $authorId ) : string
$authorId integer
리턴 string

getUsersForAuthor() 공개 메소드

Get the users that have access to an Author.
public getUsersForAuthor ( integer $authorId ) : array
$authorId integer
리턴 array

numAuthors() 공개 메소드

Get the number of Authors that exist.
public numAuthors ( ) : integer
리턴 integer

reassignAuthorship() 보호된 메소드

Overloadable. Reassign all entries that depend on the authors table in any capacity to a differnet author (or NULL).
protected reassignAuthorship ( integer $oldAuthorId, integer $newAuthorId )
$oldAuthorId integer
$newAuthorId integer = 0

removeUserByUniqueId() 공개 메소드

Remove a user from this author
public removeUserByUniqueId ( integer $authorId, string $uniqueId ) : boolean
$authorId integer
$uniqueId string
리턴 boolean

savePhotoChoice() 공개 메소드

Save the photo to display in a given context.
public savePhotoChoice ( integer $authorId, string $context, string $cabin, string $filename ) : boolean
$authorId integer
$context string
$cabin string
$filename string
리턴 boolean

toggleOwnerStatus() 공개 메소드

Toggle the 'owner' flag.
public toggleOwnerStatus ( integer $authorId, string $uniqueId ) : boolean
$authorId integer
$uniqueId string
리턴 boolean

updateAuthor() 공개 메소드

Update an author profile
public updateAuthor ( integer $authorId, array $post ) : boolean
$authorId integer
$post array
리턴 boolean

updateAuthorSlug() 공개 메소드

Should we update the author's slug?
public updateAuthorSlug ( integer $authorId, array $post ) : boolean
$authorId integer
$post array
리턴 boolean

userHasAccess() 공개 메소드

Is this user an owner of the given
public userHasAccess ( integer $authorId, integer $userId ) : boolean
$authorId integer
$userId integer
리턴 boolean

userIsOwner() 공개 메소드

Is this user an owner of the given
public userIsOwner ( integer $authorId, integer $userId ) : boolean
$authorId integer
$userId integer
리턴 boolean

프로퍼티 상세

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

protected string $photosDir
리턴 string