/** * Exports the object as an array. * * You can specify the key type of the array by passing one of the class * type constants. * * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. * Defaults to BasePeer::TYPE_PHPNAME. * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to true. * @param array $alreadyDumpedObjects List of objects to skip to avoid recursion * @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE. * * @return array an associative array containing the field names (as keys) and field values */ public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false) { if (isset($alreadyDumpedObjects['Rolmodulo'][$this->getPrimaryKey()])) { return '*RECURSION*'; } $alreadyDumpedObjects['Rolmodulo'][$this->getPrimaryKey()] = true; $keys = RolmoduloPeer::getFieldNames($keyType); $result = array($keys[0] => $this->getIdrolmodulo(), $keys[1] => $this->getIdrol(), $keys[2] => $this->getIdmodulo()); $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { $result[$key] = $virtualColumn; } if ($includeForeignObjects) { if (null !== $this->aModulo) { $result['Modulo'] = $this->aModulo->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->aRol) { $result['Rol'] = $this->aRol->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } } return $result; }
/** * Exports the object as an array. * * You can specify the key type of the array by passing one of the class * type constants. * * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. * Defaults to BasePeer::TYPE_PHPNAME. * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to true. * @param array $alreadyDumpedObjects List of objects to skip to avoid recursion * @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE. * * @return array an associative array containing the field names (as keys) and field values */ public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false) { if (isset($alreadyDumpedObjects['Empleado'][$this->getPrimaryKey()])) { return '*RECURSION*'; } $alreadyDumpedObjects['Empleado'][$this->getPrimaryKey()] = true; $keys = EmpleadoPeer::getFieldNames($keyType); $result = array($keys[0] => $this->getIdempleado(), $keys[1] => $this->getIdrol(), $keys[2] => $this->getEmpleadoNombre(), $keys[3] => $this->getEmpleadoApellidopaterno(), $keys[4] => $this->getEmpleadoApellidomaterno(), $keys[5] => $this->getEmpleadoNombreusuario(), $keys[6] => $this->getEmpleadoPassword(), $keys[7] => $this->getEmpleadoEmail(), $keys[8] => $this->getEmpleadoImagen()); $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { $result[$key] = $virtualColumn; } if ($includeForeignObjects) { if (null !== $this->aRol) { $result['Rol'] = $this->aRol->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->collEmpleadofacturacions) { $result['Empleadofacturacions'] = $this->collEmpleadofacturacions->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); } } return $result; }