Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 43 lines (40 sloc) 0.929 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
<?php
/**
* Calling prototype:
*
* $proc->invoke(int $id, array $properties)
*/
abstract class Mapper_Procedure_Update extends Mapper_Procedure_Writable
{
    protected function _selfCheck()
    {
        parent::_selfCheck();
        $in = $this->getInParams();
        assert('Mapper_Type_ParamList::getFieldType($in, $this->getIdField()) instanceof Mapper_Type_Identifier');
    }

    /**
* Returns the name of input ID parameter.
*
* @return string
*/
    public function getIdField()
    {
        return 'id';
    }

    /**
* UPDATE procedure returns boolean.
*
* @return mixed
*/
    public function getOutParams()
    {
        return new DB_Pgsql_Type_Boolean();
    }
    
    public function invoke($id, $values)
    {
        $values = (array) $values;
        $values[$this->getIdField()] = $id;
        $rows = parent::invoke($values);
        return $rows;
    }
}
Something went wrong with that request. Please try again.