All pastes #636984 Raw Edit

Something

public text v1 · immutable
#636984 ·published 2007-07-28 12:33 UTC
rendered paste body
class Intraface_TableGateway extends pdoext_TableGateway
{
    private $user;

    function __construct($table, $conn, $user)
    {
        $this->user = $user;
        parent::__construct($table, $conn);
    }

    function insert($data)
    {
        $data['intranet_id'] = $this->user->getActiveIntranetId();
        $data['user_id'] = $this->user->getId();
        parent::insert($data);
    }

    function update($data, $condition)
    {
        $condition['intranet_id'] = $this->user->getActiveIntranetId();
        $condition['user_id'] = $this->user->getId();
        parent::update($data, $condition);
    }

    function delete($condition)
    {
        $condition['intranet_id'] = $this->user->getActiveIntranetId();
        $condition['user_id'] = $this->user->getId();
        parent::delete($condition);
    }
}