PHP 트레잇 Sulu\Component\Persistence\RelationTrait

파일 보기 프로젝트 열기: sulu/sulu

공개 메소드들

메소드 설명
compareData ( $entities, array $requestEntities, callable $compare = null, callable $add = null, callable $update = null, callable $delete = null ) : boolean function compares entities with data of array and makes callback.
compareEntitiesWithData ( Traversable $entities, array $requestEntities, callable $compare, callable $add = null, callable $update = null, callable $delete = null ) : boolean Compares entities with data array and calls the given callbacks.
processSubEntities ( Traversable $entities, array $requestEntities, callable $get, callable $add = null, callable $update = null, callable $delete = null ) : boolean This method processes a put request (delete non-existing entities, update existing entities, add new entries), and let the single actions be modified by callbacks.

보호된 메소드들

메소드 설명
findMatchByCallback ( $entity, array $requestEntities, callable $compare, array &$matchedEntry, string &$matchedKey ) Applies a given compare function to a given set of data entries. Returns the entity itself and its key with the $matchedEntry and $matchKey parameters.

메소드 상세

compareData() 공개 메소드

function compares entities with data of array and makes callback.
public compareData ( $entities, array $requestEntities, callable $compare = null, callable $add = null, callable $update = null, callable $delete = null ) : boolean
$entities
$requestEntities array
$compare callable
$add callable
$update callable
$delete callable
리턴 boolean

compareEntitiesWithData() 공개 메소드

Compares entities with data array and calls the given callbacks.
public compareEntitiesWithData ( Traversable $entities, array $requestEntities, callable $compare, callable $add = null, callable $update = null, callable $delete = null ) : boolean
$entities Traversable The list of entities to work on
$requestEntities array The entities as retrieved from the request
$compare callable return true if data matches entity
$add callable
$update callable
$delete callable
리턴 boolean

findMatchByCallback() 보호된 메소드

Applies a given compare function to a given set of data entries. Returns the entity itself and its key with the $matchedEntry and $matchKey parameters.
protected findMatchByCallback ( $entity, array $requestEntities, callable $compare, array &$matchedEntry, string &$matchedKey )
$entity The entity to compare
$requestEntities array The set of entities to search in
$compare callable Compare function, which defines if data matches the entity
$matchedEntry array
$matchedKey string

processSubEntities() 공개 메소드

This method processes a put request (delete non-existing entities, update existing entities, add new entries), and let the single actions be modified by callbacks.
public processSubEntities ( Traversable $entities, array $requestEntities, callable $get, callable $add = null, callable $update = null, callable $delete = null ) : boolean
$entities Traversable The list of entities to work on
$requestEntities array The entities as retrieved from the request
$get callable Return id of entity
$add callable
$update callable
$delete callable
리턴 boolean