[Alba-desarrollo] SVN Alba r4552 - in prosistem/alba/trunk/alba:
config lib/model lib/model/map lib/model/om
commits en pressenter.com.ar
commits en pressenter.com.ar
Mie Abr 18 18:22:57 CEST 2007
Author: hsanchez
Date: 2007-04-18 13:22:53 -0300 (Wed, 18 Apr 2007)
New Revision: 4552
Added:
prosistem/alba/trunk/alba/lib/model/Roles.php
prosistem/alba/trunk/alba/lib/model/RolesPeer.php
prosistem/alba/trunk/alba/lib/model/map/RolesMapBuilder.php
prosistem/alba/trunk/alba/lib/model/om/BaseRoles.php
prosistem/alba/trunk/alba/lib/model/om/BaseRolesPeer.php
Modified:
prosistem/alba/trunk/alba/config/schema.xml
Log:
Agregando al schema y el modelo para roles de responsables
Modified: prosistem/alba/trunk/alba/config/schema.xml
===================================================================
--- prosistem/alba/trunk/alba/config/schema.xml 2007-04-18 16:21:23 UTC (rev 4551)
+++ prosistem/alba/trunk/alba/config/schema.xml 2007-04-18 16:22:53 UTC (rev 4552)
@@ -723,4 +723,10 @@
<column name="grupo" type="varchar" size="30" required="false" default=""/>
<column name="defecto" type="boolean" required="true" default="0"/>
</table>
+ <table name="roles" idMethod="native">
+ <column name="id" type="INTEGER" required="true" autoIncrement="true" primaryKey="true"/>
+ <column name="nombre" type="VARCHAR" size="128" required="true" default=""/>
+ <column name="descripcion" type="VARCHAR" size="255" default=""/>
+ <column name="activo" type="BOOLEAN" required="true" default="true"/>
+ </table>
</database>
\ No newline at end of file
Added: prosistem/alba/trunk/alba/lib/model/Roles.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/Roles.php 2007-04-18 16:21:23 UTC (rev 4551)
+++ prosistem/alba/trunk/alba/lib/model/Roles.php 2007-04-18 16:22:53 UTC (rev 4552)
@@ -0,0 +1,12 @@
+<?php
+
+/**
+ * Subclass for representing a row from the 'roles' table.
+ *
+ *
+ *
+ * @package lib.model
+ */
+class Roles extends BaseRoles
+{
+}
Property changes on: prosistem/alba/trunk/alba/lib/model/Roles.php
___________________________________________________________________
Name: svn:keywords
+ Id Date Author Rev URL
Added: prosistem/alba/trunk/alba/lib/model/RolesPeer.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/RolesPeer.php 2007-04-18 16:21:23 UTC (rev 4551)
+++ prosistem/alba/trunk/alba/lib/model/RolesPeer.php 2007-04-18 16:22:53 UTC (rev 4552)
@@ -0,0 +1,12 @@
+<?php
+
+/**
+ * Subclass for performing query and update operations on the 'roles' table.
+ *
+ *
+ *
+ * @package lib.model
+ */
+class RolesPeer extends BaseRolesPeer
+{
+}
Property changes on: prosistem/alba/trunk/alba/lib/model/RolesPeer.php
___________________________________________________________________
Name: svn:keywords
+ Id Date Author Rev URL
Added: prosistem/alba/trunk/alba/lib/model/map/RolesMapBuilder.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/map/RolesMapBuilder.php 2007-04-18 16:21:23 UTC (rev 4551)
+++ prosistem/alba/trunk/alba/lib/model/map/RolesMapBuilder.php 2007-04-18 16:22:53 UTC (rev 4552)
@@ -0,0 +1,44 @@
+<?php
+
+
+
+class RolesMapBuilder {
+
+
+ const CLASS_NAME = 'lib.model.map.RolesMapBuilder';
+
+
+ private $dbMap;
+
+
+ public function isBuilt()
+ {
+ return ($this->dbMap !== null);
+ }
+
+
+ public function getDatabaseMap()
+ {
+ return $this->dbMap;
+ }
+
+
+ public function doBuild()
+ {
+ $this->dbMap = Propel::getDatabaseMap('alba');
+
+ $tMap = $this->dbMap->addTable('roles');
+ $tMap->setPhpName('Roles');
+
+ $tMap->setUseIdGenerator(true);
+
+ $tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);
+
+ $tMap->addColumn('NOMBRE', 'Nombre', 'string', CreoleTypes::VARCHAR, true, 128);
+
+ $tMap->addColumn('DESCRIPCION', 'Descripcion', 'string', CreoleTypes::VARCHAR, false, 255);
+
+ $tMap->addColumn('ACTIVO', 'Activo', 'boolean', CreoleTypes::BOOLEAN, true);
+
+ }
+}
\ No newline at end of file
Property changes on: prosistem/alba/trunk/alba/lib/model/map/RolesMapBuilder.php
___________________________________________________________________
Name: svn:keywords
+ Id Date Author Rev URL
Added: prosistem/alba/trunk/alba/lib/model/om/BaseRoles.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/om/BaseRoles.php 2007-04-18 16:21:23 UTC (rev 4551)
+++ prosistem/alba/trunk/alba/lib/model/om/BaseRoles.php 2007-04-18 16:22:53 UTC (rev 4552)
@@ -0,0 +1,379 @@
+<?php
+
+
+abstract class BaseRoles extends BaseObject implements Persistent {
+
+
+
+ protected static $peer;
+
+
+
+ protected $id;
+
+
+
+ protected $nombre = '';
+
+
+
+ protected $descripcion = '';
+
+
+
+ protected $activo = true;
+
+
+ protected $alreadyInSave = false;
+
+
+ protected $alreadyInValidation = false;
+
+
+ public function getId()
+ {
+
+ return $this->id;
+ }
+
+
+ public function getNombre()
+ {
+
+ return $this->nombre;
+ }
+
+
+ public function getDescripcion()
+ {
+
+ return $this->descripcion;
+ }
+
+
+ public function getActivo()
+ {
+
+ return $this->activo;
+ }
+
+
+ public function setId($v)
+ {
+
+ if ($this->id !== $v) {
+ $this->id = $v;
+ $this->modifiedColumns[] = RolesPeer::ID;
+ }
+
+ }
+
+ public function setNombre($v)
+ {
+
+ if ($this->nombre !== $v || $v === '') {
+ $this->nombre = $v;
+ $this->modifiedColumns[] = RolesPeer::NOMBRE;
+ }
+
+ }
+
+ public function setDescripcion($v)
+ {
+
+ if ($this->descripcion !== $v || $v === '') {
+ $this->descripcion = $v;
+ $this->modifiedColumns[] = RolesPeer::DESCRIPCION;
+ }
+
+ }
+
+ public function setActivo($v)
+ {
+
+ if ($this->activo !== $v || $v === true) {
+ $this->activo = $v;
+ $this->modifiedColumns[] = RolesPeer::ACTIVO;
+ }
+
+ }
+
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->id = $rs->getInt($startcol + 0);
+
+ $this->nombre = $rs->getString($startcol + 1);
+
+ $this->descripcion = $rs->getString($startcol + 2);
+
+ $this->activo = $rs->getBoolean($startcol + 3);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ return $startcol + 4;
+ } catch (Exception $e) {
+ throw new PropelException("Error populating Roles object", $e);
+ }
+ }
+
+
+ public function delete($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("This object has already been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(RolesPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ RolesPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+
+ public function save($con = null)
+ {
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(RolesPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ $affectedRows = $this->doSave($con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+
+ protected function doSave($con)
+ {
+ $affectedRows = 0; if (!$this->alreadyInSave) {
+ $this->alreadyInSave = true;
+
+
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = RolesPeer::doInsert($this, $con);
+ $affectedRows += 1;
+ $this->setId($pk);
+ $this->setNew(false);
+ } else {
+ $affectedRows += RolesPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); }
+
+ $this->alreadyInSave = false;
+ }
+ return $affectedRows;
+ }
+
+ protected $validationFailures = array();
+
+
+ public function getValidationFailures()
+ {
+ return $this->validationFailures;
+ }
+
+
+ public function validate($columns = null)
+ {
+ $res = $this->doValidate($columns);
+ if ($res === true) {
+ $this->validationFailures = array();
+ return true;
+ } else {
+ $this->validationFailures = $res;
+ return false;
+ }
+ }
+
+
+ protected function doValidate($columns = null)
+ {
+ if (!$this->alreadyInValidation) {
+ $this->alreadyInValidation = true;
+ $retval = null;
+
+ $failureMap = array();
+
+
+ if (($retval = RolesPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+
+ $this->alreadyInValidation = false;
+ }
+
+ return (!empty($failureMap) ? $failureMap : true);
+ }
+
+
+ public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = RolesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->getByPosition($pos);
+ }
+
+
+ public function getByPosition($pos)
+ {
+ switch($pos) {
+ case 0:
+ return $this->getId();
+ break;
+ case 1:
+ return $this->getNombre();
+ break;
+ case 2:
+ return $this->getDescripcion();
+ break;
+ case 3:
+ return $this->getActivo();
+ break;
+ default:
+ return null;
+ break;
+ } }
+
+
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = RolesPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getId(),
+ $keys[1] => $this->getNombre(),
+ $keys[2] => $this->getDescripcion(),
+ $keys[3] => $this->getActivo(),
+ );
+ return $result;
+ }
+
+
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = RolesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
+ return $this->setByPosition($pos, $value);
+ }
+
+
+ public function setByPosition($pos, $value)
+ {
+ switch($pos) {
+ case 0:
+ $this->setId($value);
+ break;
+ case 1:
+ $this->setNombre($value);
+ break;
+ case 2:
+ $this->setDescripcion($value);
+ break;
+ case 3:
+ $this->setActivo($value);
+ break;
+ } }
+
+
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = RolesPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
+ if (array_key_exists($keys[1], $arr)) $this->setNombre($arr[$keys[1]]);
+ if (array_key_exists($keys[2], $arr)) $this->setDescripcion($arr[$keys[2]]);
+ if (array_key_exists($keys[3], $arr)) $this->setActivo($arr[$keys[3]]);
+ }
+
+
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(RolesPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(RolesPeer::ID)) $criteria->add(RolesPeer::ID, $this->id);
+ if ($this->isColumnModified(RolesPeer::NOMBRE)) $criteria->add(RolesPeer::NOMBRE, $this->nombre);
+ if ($this->isColumnModified(RolesPeer::DESCRIPCION)) $criteria->add(RolesPeer::DESCRIPCION, $this->descripcion);
+ if ($this->isColumnModified(RolesPeer::ACTIVO)) $criteria->add(RolesPeer::ACTIVO, $this->activo);
+
+ return $criteria;
+ }
+
+
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(RolesPeer::DATABASE_NAME);
+
+ $criteria->add(RolesPeer::ID, $this->id);
+
+ return $criteria;
+ }
+
+
+ public function getPrimaryKey()
+ {
+ return $this->getId();
+ }
+
+
+ public function setPrimaryKey($key)
+ {
+ $this->setId($key);
+ }
+
+
+ public function copyInto($copyObj, $deepCopy = false)
+ {
+
+ $copyObj->setNombre($this->nombre);
+
+ $copyObj->setDescripcion($this->descripcion);
+
+ $copyObj->setActivo($this->activo);
+
+
+ $copyObj->setNew(true);
+
+ $copyObj->setId(NULL);
+ }
+
+
+ public function copy($deepCopy = false)
+ {
+ $clazz = get_class($this);
+ $copyObj = new $clazz();
+ $this->copyInto($copyObj, $deepCopy);
+ return $copyObj;
+ }
+
+
+ public function getPeer()
+ {
+ if (self::$peer === null) {
+ self::$peer = new RolesPeer();
+ }
+ return self::$peer;
+ }
+
+}
\ No newline at end of file
Property changes on: prosistem/alba/trunk/alba/lib/model/om/BaseRoles.php
___________________________________________________________________
Name: svn:keywords
+ Id Date Author Rev URL
Added: prosistem/alba/trunk/alba/lib/model/om/BaseRolesPeer.php
===================================================================
--- prosistem/alba/trunk/alba/lib/model/om/BaseRolesPeer.php 2007-04-18 16:21:23 UTC (rev 4551)
+++ prosistem/alba/trunk/alba/lib/model/om/BaseRolesPeer.php 2007-04-18 16:22:53 UTC (rev 4552)
@@ -0,0 +1,378 @@
+<?php
+
+
+abstract class BaseRolesPeer {
+
+
+ const DATABASE_NAME = 'alba';
+
+
+ const TABLE_NAME = 'roles';
+
+
+ const CLASS_DEFAULT = 'lib.model.Roles';
+
+
+ const NUM_COLUMNS = 4;
+
+
+ const NUM_LAZY_LOAD_COLUMNS = 0;
+
+
+
+ const ID = 'roles.ID';
+
+
+ const NOMBRE = 'roles.NOMBRE';
+
+
+ const DESCRIPCION = 'roles.DESCRIPCION';
+
+
+ const ACTIVO = 'roles.ACTIVO';
+
+
+ private static $phpNameMap = null;
+
+
+
+ private static $fieldNames = array (
+ BasePeer::TYPE_PHPNAME => array ('Id', 'Nombre', 'Descripcion', 'Activo', ),
+ BasePeer::TYPE_COLNAME => array (RolesPeer::ID, RolesPeer::NOMBRE, RolesPeer::DESCRIPCION, RolesPeer::ACTIVO, ),
+ BasePeer::TYPE_FIELDNAME => array ('id', 'nombre', 'descripcion', 'activo', ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ );
+
+
+ private static $fieldKeys = array (
+ BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Nombre' => 1, 'Descripcion' => 2, 'Activo' => 3, ),
+ BasePeer::TYPE_COLNAME => array (RolesPeer::ID => 0, RolesPeer::NOMBRE => 1, RolesPeer::DESCRIPCION => 2, RolesPeer::ACTIVO => 3, ),
+ BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'nombre' => 1, 'descripcion' => 2, 'activo' => 3, ),
+ BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
+ );
+
+
+ public static function getMapBuilder()
+ {
+ include_once 'lib/model/map/RolesMapBuilder.php';
+ return BasePeer::getMapBuilder('lib.model.map.RolesMapBuilder');
+ }
+
+ public static function getPhpNameMap()
+ {
+ if (self::$phpNameMap === null) {
+ $map = RolesPeer::getTableMap();
+ $columns = $map->getColumns();
+ $nameMap = array();
+ foreach ($columns as $column) {
+ $nameMap[$column->getPhpName()] = $column->getColumnName();
+ }
+ self::$phpNameMap = $nameMap;
+ }
+ return self::$phpNameMap;
+ }
+
+ static public function translateFieldName($name, $fromType, $toType)
+ {
+ $toNames = self::getFieldNames($toType);
+ $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
+ if ($key === null) {
+ throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
+ }
+ return $toNames[$key];
+ }
+
+
+
+ static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
+ {
+ if (!array_key_exists($type, self::$fieldNames)) {
+ throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
+ }
+ return self::$fieldNames[$type];
+ }
+
+
+ public static function alias($alias, $column)
+ {
+ return str_replace(RolesPeer::TABLE_NAME.'.', $alias.'.', $column);
+ }
+
+
+ public static function addSelectColumns(Criteria $criteria)
+ {
+
+ $criteria->addSelectColumn(RolesPeer::ID);
+
+ $criteria->addSelectColumn(RolesPeer::NOMBRE);
+
+ $criteria->addSelectColumn(RolesPeer::DESCRIPCION);
+
+ $criteria->addSelectColumn(RolesPeer::ACTIVO);
+
+ }
+
+ const COUNT = 'COUNT(roles.ID)';
+ const COUNT_DISTINCT = 'COUNT(DISTINCT roles.ID)';
+
+
+ public static function doCount(Criteria $criteria, $distinct = false, $con = null)
+ {
+ $criteria = clone $criteria;
+
+ $criteria->clearSelectColumns()->clearOrderByColumns();
+ if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
+ $criteria->addSelectColumn(RolesPeer::COUNT_DISTINCT);
+ } else {
+ $criteria->addSelectColumn(RolesPeer::COUNT);
+ }
+
+ foreach($criteria->getGroupByColumns() as $column)
+ {
+ $criteria->addSelectColumn($column);
+ }
+
+ $rs = RolesPeer::doSelectRS($criteria, $con);
+ if ($rs->next()) {
+ return $rs->getInt(1);
+ } else {
+ return 0;
+ }
+ }
+
+ public static function doSelectOne(Criteria $criteria, $con = null)
+ {
+ $critcopy = clone $criteria;
+ $critcopy->setLimit(1);
+ $objects = RolesPeer::doSelect($critcopy, $con);
+ if ($objects) {
+ return $objects[0];
+ }
+ return null;
+ }
+
+ public static function doSelect(Criteria $criteria, $con = null)
+ {
+ return RolesPeer::populateObjects(RolesPeer::doSelectRS($criteria, $con));
+ }
+
+ public static function doSelectRS(Criteria $criteria, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if (!$criteria->getSelectColumns()) {
+ $criteria = clone $criteria;
+ RolesPeer::addSelectColumns($criteria);
+ }
+
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doSelect($criteria, $con);
+ }
+
+ public static function populateObjects(ResultSet $rs)
+ {
+ $results = array();
+
+ $cls = RolesPeer::getOMClass();
+ $cls = Propel::import($cls);
+ while($rs->next()) {
+
+ $obj = new $cls();
+ $obj->hydrate($rs);
+ $results[] = $obj;
+
+ }
+ return $results;
+ }
+
+ public static function getTableMap()
+ {
+ return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
+ }
+
+
+ public static function getOMClass()
+ {
+ return RolesPeer::CLASS_DEFAULT;
+ }
+
+
+ public static function doInsert($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; } else {
+ $criteria = $values->buildCriteria(); }
+
+ $criteria->remove(RolesPeer::ID);
+
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ try {
+ $con->begin();
+ $pk = BasePeer::doInsert($criteria, $con);
+ $con->commit();
+ } catch(PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+
+ return $pk;
+ }
+
+
+ public static function doUpdate($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $selectCriteria = new Criteria(self::DATABASE_NAME);
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values;
+ $comparison = $criteria->getComparison(RolesPeer::ID);
+ $selectCriteria->add(RolesPeer::ID, $criteria->remove(RolesPeer::ID), $comparison);
+
+ } else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); }
+
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ return BasePeer::doUpdate($selectCriteria, $criteria, $con);
+ }
+
+
+ public static function doDeleteAll($con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+ $affectedRows = 0; try {
+ $con->begin();
+ $affectedRows += BasePeer::doDeleteAll(RolesPeer::TABLE_NAME, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+
+ public static function doDelete($values, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(RolesPeer::DATABASE_NAME);
+ }
+
+ if ($values instanceof Criteria) {
+ $criteria = clone $values; } elseif ($values instanceof Roles) {
+
+ $criteria = $values->buildPkeyCriteria();
+ } else {
+ $criteria = new Criteria(self::DATABASE_NAME);
+ $criteria->add(RolesPeer::ID, (array) $values, Criteria::IN);
+ }
+
+ $criteria->setDbName(self::DATABASE_NAME);
+
+ $affectedRows = 0;
+ try {
+ $con->begin();
+
+ $affectedRows += BasePeer::doDelete($criteria, $con);
+ $con->commit();
+ return $affectedRows;
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+
+ public static function doValidate(Roles $obj, $cols = null)
+ {
+ $columns = array();
+
+ if ($cols) {
+ $dbMap = Propel::getDatabaseMap(RolesPeer::DATABASE_NAME);
+ $tableMap = $dbMap->getTable(RolesPeer::TABLE_NAME);
+
+ if (! is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ foreach($cols as $colName) {
+ if ($tableMap->containsColumn($colName)) {
+ $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
+ $columns[$colName] = $obj->$get();
+ }
+ }
+ } else {
+
+ }
+
+ $res = BasePeer::doValidate(RolesPeer::DATABASE_NAME, RolesPeer::TABLE_NAME, $columns);
+ if ($res !== true) {
+ $request = sfContext::getInstance()->getRequest();
+ foreach ($res as $failed) {
+ $col = RolesPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
+ $request->setError($col, $failed->getMessage());
+ }
+ }
+
+ return $res;
+ }
+
+
+ public static function retrieveByPK($pk, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $criteria = new Criteria(RolesPeer::DATABASE_NAME);
+
+ $criteria->add(RolesPeer::ID, $pk);
+
+
+ $v = RolesPeer::doSelect($criteria, $con);
+
+ return !empty($v) > 0 ? $v[0] : null;
+ }
+
+
+ public static function retrieveByPKs($pks, $con = null)
+ {
+ if ($con === null) {
+ $con = Propel::getConnection(self::DATABASE_NAME);
+ }
+
+ $objs = null;
+ if (empty($pks)) {
+ $objs = array();
+ } else {
+ $criteria = new Criteria();
+ $criteria->add(RolesPeer::ID, $pks, Criteria::IN);
+ $objs = RolesPeer::doSelect($criteria, $con);
+ }
+ return $objs;
+ }
+
+}
+if (Propel::isInit()) {
+ try {
+ BaseRolesPeer::getMapBuilder();
+ } catch (Exception $e) {
+ Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
+ }
+} else {
+ require_once 'lib/model/map/RolesMapBuilder.php';
+ Propel::registerMapBuilder('lib.model.map.RolesMapBuilder');
+}
Property changes on: prosistem/alba/trunk/alba/lib/model/om/BaseRolesPeer.php
___________________________________________________________________
Name: svn:keywords
+ Id Date Author Rev URL
Más información sobre la lista de distribución Alba-desarrollo