class ContainerManager extends BaseManager

Core container manager

Methods

object
save(object $obj)

Save handler, because DRY

Paginator
getPaginator(integer $page = 1, integer $limit = 50)

Helps paginate models using the query bulder. Bit more complicated than the native array method, but works better for larger data sets

boolean
restDelete(number $id)

Delete an object with rest

restCreate(array $data)

Create a new object

restUpdate(int $id, array $data)

Update an existing object

mixed
find(mixed $parameters = null)

Find container

mixed
findFirst(mixed $params = null)

Find first based on params

mixed
findFirstById(mixed $params = null)

Find first content by ID

object
findFirstByUuid(string $uuid)

Find first item by given UUID

findFirstBySrn(string $srn)

Find first instance by SRN

create(array $input)

Create new container. Accepts: * slug * title * description * type * content - array of content * tags - array of tags

update(int $id, array $input)

Update container. Accepts: * slug * title * description * type * content - array of content * tags - array of tags

boolean
delete(integer $id)

Remove container. This does not remove associated children

importFromJSON($json)

No description

Details

in BaseManager at line line 23
object save(object $obj)

Save handler, because DRY

Parameters

object $obj Model to be saved

Return Value

object Model

Exceptions

Exception Json encoded string of validation errors

in BaseManager at line line 60
Paginator getPaginator(integer $page = 1, integer $limit = 50)

Helps paginate models using the query bulder. Bit more complicated than the native array method, but works better for larger data sets

Because it's based on Phalcon's QueryBuilder, it supports a fluent filtering interface:

    $manager = $this->foo_manager;
    $items = $manager->getPaginator(1, 20)
        ->orderBy('created_at desc')
        ->where('name = :name:', array('name' => $name))
        ->andWhere('type = :type:', array('type' => $type))
        ->paginate();

    echo json_encode($items);

Parameters

integer $page Current page
integer $limit Per page limit

Return Value

Paginator

in BaseManager at line line 80
boolean restDelete(number $id)

Delete an object with rest

Parameters

number $id

Return Value

boolean

Exceptions

Exception

in BaseManager at line line 103
restCreate(array $data)

Create a new object

Parameters

array $data

in BaseManager at line line 117
restUpdate(int $id, array $data)

Update an existing object

Parameters

int $id
array $data

at line line 26
mixed find(mixed $parameters = null)

Find container

Parameters

mixed $parameters

Return Value

mixed

at line line 36
mixed findFirst(mixed $params = null)

Find first based on params

Parameters

mixed $params

Return Value

mixed

at line line 46
mixed findFirstById(mixed $params = null)

Find first content by ID

Parameters

mixed $params

Return Value

mixed

at line line 56
object findFirstByUuid(string $uuid)

Find first item by given UUID

Parameters

string $uuid

Return Value

object ContentModel

at line line 66
Container findFirstBySrn(string $srn)

Find first instance by SRN

Parameters

string $srn SRN

Return Value

Container

at line line 87
Container create(array $input)

Create new container. Accepts: * slug * title * description * type * content - array of content * tags - array of tags

Parameters

array $input Container data

Return Value

Container

at line line 223
Container update(int $id, array $input)

Update container. Accepts: * slug * title * description * type * content - array of content * tags - array of tags

Keep in mind Tags and Content are overwritten, not added to existing collection

Parameters

int $id Container ID
array $input Container data

Return Value

Container

Exceptions

Exception if unable to find container

at line line 418
boolean delete(integer $id)

Remove container. This does not remove associated children

Parameters

integer $id container id

Return Value

boolean

Exceptions

Exception if unable to load container

at line line 490
importFromJSON($json)

Parameters

$json