PHP Trait Nestable\NestableTrait

Show file Open project: atayahmet/laravel-nestable

Public Properties

Property Type Description
$toArray integer Array service.
$toDropdown integer Dropdown service.
$toHtml integer Html service.
$toJson integer Json string service.

Protected Properties

Property Type Description
$_instance Query builder instance.
$nested mixed Start the nested process.
$parameters array Service parameters.
$source Soruce data.
$to integer Default service number (toArray).

Public Methods

Method Description
__call ( array $method, array $args ) : mixed if called method not exists in NestableService pass to parent __call method.
__callStatic ( array $method, array $args ) : mixed Create new instance and call the method.
delete ( ) : boolean | null Call the parent delete method
get ( ) : mixed Get the data from db to collection or default return.
nested ( integer $to = 1 ) : object Set the nest type.
renderAsArray ( ) : array Render as array tree.
renderAsDropdown ( ) : string Render as dropdown.
renderAsHtml ( ) : string Render as html.
renderAsJson ( ) : array Render as json string.
renderAsMultiple ( ) : string Render as multiple list box.

Protected Methods

Method Description
getParameters ( ) : array Get the all service parameters.
getParentField ( ) : string Return the parent key name.
saveParameter ( string $method, mixed $value ) : object Save the service parameters.
to ( ) : mixed Pass data to nest methods.

Method Details

__call() public method

if called method not exists in NestableService pass to parent __call method.
public __call ( array $method, array $args ) : mixed
$method array
$args array
return mixed

__callStatic() public static method

Create new instance and call the method.
public static __callStatic ( array $method, array $args ) : mixed
$method array
$args array
return mixed

delete() public method

Call the parent delete method
public delete ( ) : boolean | null
return boolean | null

get() public method

Get the data from db to collection or default return.
public get ( ) : mixed
return mixed

getParameters() protected method

Get the all service parameters.
protected getParameters ( ) : array
return array

getParentField() protected method

Return the parent key name.
protected getParentField ( ) : string
return string

nested() public static method

Set the nest type.
public static nested ( integer $to = 1 ) : object
$to integer
return object

renderAsArray() public static method

Render as array tree.
public static renderAsArray ( ) : array
return array

renderAsDropdown() public static method

Render as dropdown.
public static renderAsDropdown ( ) : string
return string

renderAsHtml() public static method

Render as html.
public static renderAsHtml ( ) : string
return string

renderAsJson() public static method

Render as json string.
public static renderAsJson ( ) : array
return array

renderAsMultiple() public static method

Render as multiple list box.
public static renderAsMultiple ( ) : string
return string

saveParameter() protected method

Save the service parameters.
protected saveParameter ( string $method, mixed $value ) : object
$method string Method name in NestableService
$value mixed
return object

to() protected method

Pass data to nest methods.
protected to ( ) : mixed
return mixed

Property Details

$_instance protected static property

Query builder instance.
protected static $_instance

$nested protected static property

Start the nested process.
protected static mixed $nested
return mixed

$parameters protected static property

Service parameters.
protected static array $parameters
return array

$source protected property

Soruce data.
protected $source

$to protected static property

Default service number (toArray).
protected static int $to
return integer

$toArray public static property

Array service.
public static int $toArray
return integer

$toDropdown public static property

Dropdown service.
public static int $toDropdown
return integer

$toHtml public static property

Html service.
public static int $toHtml
return integer

$toJson public static property

Json string service.
public static int $toJson
return integer