PHP 클래스 Bolt\Stack

Each user (by design) has their own stack. No sharesies!
저자: Bob den Otter, [email protected]
파일 보기 프로젝트 열기: bolt/bolt 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( Matcher $matcher, Users $users, Symfony\Component\HttpFoundation\Session\SessionInterface $session, string[] $acceptedFileTypes ) Constructor.
add ( Bolt\Filesystem\Handler\FileInterface | string $filename, Bolt\Filesystem\Handler\FileInterface &$removed = null ) : Bolt\Filesystem\Handler\FileInterface Add a file to the stack.
contains ( Bolt\Filesystem\Handler\FileInterface | string $filename ) : boolean Check if a given file is present on the stack.
count ( )
delete ( Bolt\Filesystem\Handler\FileInterface | string $filename ) Delete a file from the stack.
getIterator ( )
getList ( array $types = [] ) : Bolt\Filesystem\Handler\FileInterface[] Returns the list of files in the stack, filtered by type (if given).
isStackable ( Bolt\Filesystem\Handler\FileInterface | string $filename ) : boolean Check if a given file can be added to the stack.

비공개 메소드들

메소드 설명
hydrateList ( string[] $paths ) : Bolt\Filesystem\Handler\FileInterface[] Converts a list of paths to file objects.
initialize ( ) Initialize file list for current user, either from session or database.
persist ( ) Persist the contents of the current stack to the session, as well as the database.
persistableList ( ) : string[] Returns the list of files as full paths.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( Matcher $matcher, Users $users, Symfony\Component\HttpFoundation\Session\SessionInterface $session, string[] $acceptedFileTypes )
$matcher Bolt\Filesystem\Matcher
$users Users
$session Symfony\Component\HttpFoundation\Session\SessionInterface
$acceptedFileTypes string[]

add() 공개 메소드

Add a file to the stack.
public add ( Bolt\Filesystem\Handler\FileInterface | string $filename, Bolt\Filesystem\Handler\FileInterface &$removed = null ) : Bolt\Filesystem\Handler\FileInterface
$filename Bolt\Filesystem\Handler\FileInterface | string The file to add.
$removed Bolt\Filesystem\Handler\FileInterface Returns the removed file, if one was removed.
리턴 Bolt\Filesystem\Handler\FileInterface If filename cannot be matched to filesystem.

contains() 공개 메소드

Check if a given file is present on the stack.
public contains ( Bolt\Filesystem\Handler\FileInterface | string $filename ) : boolean
$filename Bolt\Filesystem\Handler\FileInterface | string
리턴 boolean

count() 공개 메소드

public count ( )

delete() 공개 메소드

Delete a file from the stack.
public delete ( Bolt\Filesystem\Handler\FileInterface | string $filename )
$filename Bolt\Filesystem\Handler\FileInterface | string

getIterator() 공개 메소드

public getIterator ( )

getList() 공개 메소드

Returns the list of files in the stack, filtered by type (if given).
public getList ( array $types = [] ) : Bolt\Filesystem\Handler\FileInterface[]
$types array Filter files by type. Valid types: "image", "document", "other"
리턴 Bolt\Filesystem\Handler\FileInterface[]

isStackable() 공개 메소드

Requirements: - File's extension is accepted - File can be matched to filesystem - File is not currently on the stack
public isStackable ( Bolt\Filesystem\Handler\FileInterface | string $filename ) : boolean
$filename Bolt\Filesystem\Handler\FileInterface | string
리턴 boolean