ZF2 Query Helpers and Oracle Bound In / Out Variables
public function copyEntity(CopyEntity $copyEntity) {
// Prepare the statement
$statement = $this->getDbAdapter()->createStatement('BEGIN entity.copy(:rid,:nkid,:new_official_name,:entered_by); END;');
// Setup parameter container
$parameterContainer = new ParameterContainer();
$parameterContainer->offsetSet('rid',$copyEntity->getRid(),$parameterContainer::TYPE_INTEGER);
$parameterContainer->offsetSet('nkid',0,$parameterContainer::TYPE_INTEGER);
$parameterContainer->offsetSet('new_official_name',$copyEntity->getOfficial_name(),$parameterContainer::TYPE_STRING);
$parameterContainer->offsetSet('entered_by',$copyEntity->getEntered_by(),$parameterContainer::TYPE_INTEGER);
$parameterContainer->offsetSetReference('rid', 'rid');
$parameterContainer->offsetSetReference('nkid', 'nkid');
$statement->setParameterContainer($parameterContainer);
try {
$statement->execute();
} catch (RuntimeException $ex) {
$parameterContainer->offsetSet('code',$ex->getCode());
}
// Return parameter container values
return $parameterContainer->getNamedArray();
}