AssignmentManager
class AssignmentManager extends BaseManager
Core assignment manager
Methods
Helps paginate models using the query bulder. Bit more complicated than the native array method, but works better for larger data sets
Find assignment
Find first based on params
Find first content by ID
Find first item by given UUID
Find first instance by SRN
No description
Create new assignment. Accepts: * slug * abstract * content * notes * due_at - int or string * users - array of assigned users * children - array of assigned content items
Update assignment. Accepts: * slug * abstract * content * notes * due_at - int or string * users - array of assigned users * children - array of assigned content items
Remove assignment. This does not remove associated children
Update only the due date for the assignment
Update only the publish time of assignment. This will also update associated children's published time.
Details
in BaseManager at line line 23
object
save(object $obj)
Save handler, because DRY
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);
in BaseManager at line line 80
boolean
restDelete(number $id)
Delete an object with rest
in BaseManager at line line 103
restCreate(array $data)
Create a new object
in BaseManager at line line 117
restUpdate(int $id, array $data)
Update an existing object
at line line 25
mixed
find(mixed $parameters = null)
Find assignment
at line line 35
mixed
findFirst(mixed $params = null)
Find first based on params
at line line 45
mixed
findFirstById(mixed $params = null)
Find first content by ID
at line line 55
object
findFirstByUuid(string $uuid)
Find first item by given UUID
at line line 65
Assignment
findFirstBySrn(string $srn)
Find first instance by SRN
at line line 75
findDueBetween($after, $before)
at line line 97
Assignment
create(array $input, mixed $user = false)
Create new assignment. Accepts: * slug * abstract * content * notes * due_at - int or string * users - array of assigned users * children - array of assigned content items
at line line 257
Assignment
update(int $id, array $input, mixed $user = false)
Update assignment. Accepts: * slug * abstract * content * notes * due_at - int or string * users - array of assigned users * children - array of assigned content items
Keep in mind Users and Children are overwritten, not added to existing collection
at line line 486
boolean
delete(integer $id)
Remove assignment. This does not remove associated children
at line line 514
Assignment
updateDue(integer $id, mixed $time)
Update only the due date for the assignment
at line line 538
Assignment
updatePublish(integer $id, mixed $time)
Update only the publish time of assignment. This will also update associated children's published time.