PHP Class Baum\SetMapper

Afficher le fichier Open project: gazsp/baum Class Usage Examples

Protected Properties

Свойство Type Description
$childrenKeyName string Children key name.
$node Node Node instance for reference.

Méthodes publiques

Méthode Description
__construct ( Node $node, $childrenKeyName = 'children' ) : void Create a new \Baum\SetBuilder class instance.
getChildrenKeyName ( ) : string Returns the children key name to use on the mapping array.
map ( $nodeList ) : boolean Maps a tree structure into the database. Unguards & wraps in transaction.
mapTree ( $nodeList ) : boolean Maps a tree structure into the database without unguarding nor wrapping inside a transaction.

Méthodes protégées

Méthode Description
deleteUnaffected ( $keys = [] )
firstOrNew ( $attributes )
getDataAttributes ( $attributes )
getSearchAttributes ( $attributes )
mapTreeRecursive ( array $tree, $parentKey = null, &$affectedKeys = [] ) : boolean Maps a tree structure into the database.
pruneScope ( )
wrapInTransaction ( Closure $callback )

Method Details

__construct() public méthode

Create a new \Baum\SetBuilder class instance.
public __construct ( Node $node, $childrenKeyName = 'children' ) : void
$node Node
Résultat void

deleteUnaffected() protected méthode

protected deleteUnaffected ( $keys = [] )

firstOrNew() protected méthode

protected firstOrNew ( $attributes )

getChildrenKeyName() public méthode

Returns the children key name to use on the mapping array.
public getChildrenKeyName ( ) : string
Résultat string

getDataAttributes() protected méthode

protected getDataAttributes ( $attributes )

getSearchAttributes() protected méthode

protected getSearchAttributes ( $attributes )

map() public méthode

Maps a tree structure into the database. Unguards & wraps in transaction.
public map ( $nodeList ) : boolean
Résultat boolean

mapTree() public méthode

Maps a tree structure into the database without unguarding nor wrapping inside a transaction.
public mapTree ( $nodeList ) : boolean
Résultat boolean

mapTreeRecursive() protected méthode

Maps a tree structure into the database.
protected mapTreeRecursive ( array $tree, $parentKey = null, &$affectedKeys = [] ) : boolean
$tree array
Résultat boolean

pruneScope() protected méthode

protected pruneScope ( )

wrapInTransaction() protected méthode

protected wrapInTransaction ( Closure $callback )
$callback Closure

Property Details

$childrenKeyName protected_oe property

Children key name.
protected string $childrenKeyName
Résultat string

$node protected_oe property

Node instance for reference.
protected Node,Baum $node
Résultat Node