PHP 클래스 Sulu\Bundle\SnippetBundle\Snippet\SnippetRepository

Responsible for retrieving snippets from the content repository
파일 보기 프로젝트 열기: sulu/sulu 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( SessionManager $sessionManager, ContentMapper $contentMapper, Sulu\Component\DocumentManager\DocumentManager $documentManager )
copyLocale ( string $uuid, integer $userId, string $srcLocale, string $destLocales ) : SnippetBridge Copy snippet from src-locale to dest-locale.
getReferences ( string $uuid ) : PHPCR\NodeInterface[] Return the nodes which refer to the structure with the given UUID.
getSnippets ( string $locale, string $type = null, integer $offset = null, integer $max = null, string $search = null, string $sortBy = null, string $sortOrder = null ) : SnippetBridge[] Return snippets.
getSnippetsAmount ( string $locale, string $type = null, string $search = null, string $sortBy = null, string $sortOrder = null ) : SnippetBridge[] Return snippets amount.
getSnippetsByUuids ( array $uuids, string $locale, boolean $loadGhostContent = false ) : SnippetDocument Return snippets identified by the given UUIDs.

비공개 메소드들

메소드 설명
getSnippetsQuery ( string $locale, string $type = null, integer $offset = null, integer $max = null, string $search = null, string $sortBy = null, string $sortOrder = null ) : Query Return snippets load query.

메소드 상세

__construct() 공개 메소드

public __construct ( SessionManager $sessionManager, ContentMapper $contentMapper, Sulu\Component\DocumentManager\DocumentManager $documentManager )
$sessionManager Sulu\Component\PHPCR\SessionManager\SessionManager
$contentMapper Sulu\Component\Content\Mapper\ContentMapper
$documentManager Sulu\Component\DocumentManager\DocumentManager

copyLocale() 공개 메소드

TODO: We currently need the content mapper to copy the locale, it should be removed, see https://github.com/sulu-io/sulu/issues/1998
public copyLocale ( string $uuid, integer $userId, string $srcLocale, string $destLocales ) : SnippetBridge
$uuid string
$userId integer
$srcLocale string
$destLocales string
리턴 Sulu\Component\Content\Compat\Structure\SnippetBridge

getReferences() 공개 메소드

Return the nodes which refer to the structure with the given UUID.
public getReferences ( string $uuid ) : PHPCR\NodeInterface[]
$uuid string
리턴 PHPCR\NodeInterface[]

getSnippets() 공개 메소드

If $type is given then only return the snippets of that type.
public getSnippets ( string $locale, string $type = null, integer $offset = null, integer $max = null, string $search = null, string $sortBy = null, string $sortOrder = null ) : SnippetBridge[]
$locale string
$type string Optional snippet type
$offset integer Optional offset
$max integer Optional max
$search string
$sortBy string
$sortOrder string
리턴 Sulu\Component\Content\Compat\Structure\SnippetBridge[]

getSnippetsAmount() 공개 메소드

If $type is given then only return the snippets of that type.
public getSnippetsAmount ( string $locale, string $type = null, string $search = null, string $sortBy = null, string $sortOrder = null ) : SnippetBridge[]
$locale string
$type string Optional snippet type
$search string
$sortBy string
$sortOrder string
리턴 Sulu\Component\Content\Compat\Structure\SnippetBridge[]

getSnippetsByUuids() 공개 메소드

UUIDs which fail to resolve to a snippet will be ignored.
public getSnippetsByUuids ( array $uuids, string $locale, boolean $loadGhostContent = false ) : SnippetDocument
$uuids array
$locale string
$loadGhostContent boolean
리턴 Sulu\Bundle\SnippetBundle\Document\SnippetDocument