orders_id; } public function getOrdersStatus() { return $this->orders_status; } public function getLastModified($format = 'Y-m-d H:i:s') { if ($this->last_modified === null || $this->last_modified === '') { return null; } elseif (!is_int($this->last_modified)) { $ts = strtotime($this->last_modified); if ($ts === -1 || $ts === false) { throw new PropelException("Unable to parse value of [last_modified] as date/time value: " . var_export($this->last_modified, true)); } } else { $ts = $this->last_modified; } if ($format === null) { return $ts; } elseif (strpos($format, '%') !== false) { return strftime($format, $ts); } else { return date($format, $ts); } } public function setOrdersId($v) { if ($v !== null && !is_int($v) && is_numeric($v)) { $v = (int) $v; } if ($this->orders_id !== $v) { $this->orders_id = $v; $this->modifiedColumns[] = OrdersPeer::ORDERS_ID; } } public function setOrdersStatus($v) { if ($v !== null && !is_int($v) && is_numeric($v)) { $v = (int) $v; } if ($this->orders_status !== $v) { $this->orders_status = $v; $this->modifiedColumns[] = OrdersPeer::ORDERS_STATUS; } } public function setLastModified($v) { if ($v !== null && !is_int($v)) { $ts = strtotime($v); if ($ts === -1 || $ts === false) { throw new PropelException("Unable to parse date/time value for [last_modified] from input: " . var_export($v, true)); } } else { $ts = $v; } if ($this->last_modified !== $ts) { $this->last_modified = $ts; $this->modifiedColumns[] = OrdersPeer::LAST_MODIFIED; } } public function hydrate(ResultSet $rs, $startcol = 1) { try { $this->orders_id = $rs->getInt($startcol + 0); $this->orders_status = $rs->getInt($startcol + 1); $this->last_modified = $rs->getTimestamp($startcol + 2, null); $this->resetModified(); $this->setNew(false); return $startcol + 3; } catch (Exception $e) { throw new PropelException("Error populating Orders 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(OrdersPeer::DATABASE_NAME); } try { $con->begin(); OrdersPeer::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(OrdersPeer::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 = OrdersPeer::doInsert($this, $con); $affectedRows += 1; $this->setOrdersId($pk); $this->setNew(false); } else { $affectedRows += OrdersPeer::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 = OrdersPeer::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 = OrdersPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); return $this->getByPosition($pos); } public function getByPosition($pos) { switch($pos) { case 0: return $this->getOrdersId(); break; case 1: return $this->getOrdersStatus(); break; case 2: return $this->getLastModified(); break; default: return null; break; } } public function toArray($keyType = BasePeer::TYPE_PHPNAME) { $keys = OrdersPeer::getFieldNames($keyType); $result = array( $keys[0] => $this->getOrdersId(), $keys[1] => $this->getOrdersStatus(), $keys[2] => $this->getLastModified(), ); return $result; } public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) { $pos = OrdersPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); return $this->setByPosition($pos, $value); } public function setByPosition($pos, $value) { switch($pos) { case 0: $this->setOrdersId($value); break; case 1: $this->setOrdersStatus($value); break; case 2: $this->setLastModified($value); break; } } public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = OrdersPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) $this->setOrdersId($arr[$keys[0]]); if (array_key_exists($keys[1], $arr)) $this->setOrdersStatus($arr[$keys[1]]); if (array_key_exists($keys[2], $arr)) $this->setLastModified($arr[$keys[2]]); } public function buildCriteria() { $criteria = new Criteria(OrdersPeer::DATABASE_NAME); if ($this->isColumnModified(OrdersPeer::ORDERS_ID)) $criteria->add(OrdersPeer::ORDERS_ID, $this->orders_id); if ($this->isColumnModified(OrdersPeer::ORDERS_STATUS)) $criteria->add(OrdersPeer::ORDERS_STATUS, $this->orders_status); if ($this->isColumnModified(OrdersPeer::LAST_MODIFIED)) $criteria->add(OrdersPeer::LAST_MODIFIED, $this->last_modified); return $criteria; } public function buildPkeyCriteria() { $criteria = new Criteria(OrdersPeer::DATABASE_NAME); $criteria->add(OrdersPeer::ORDERS_ID, $this->orders_id); return $criteria; } public function getPrimaryKey() { return $this->getOrdersId(); } public function setPrimaryKey($key) { $this->setOrdersId($key); } public function copyInto($copyObj, $deepCopy = false) { $copyObj->setOrdersStatus($this->orders_status); $copyObj->setLastModified($this->last_modified); $copyObj->setNew(true); $copyObj->setOrdersId(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 OrdersPeer(); } return self::$peer; } }