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
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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