payment_id; } public function getOrdersId() { return $this->orders_id; } public function getPaymentNumber() { return $this->payment_number; } public function getPaymentName() { return $this->payment_name; } public function getPaymentAmount() { return $this->payment_amount; } public function getPaymentType() { return $this->payment_type; } public function getDatePosted($format = 'Y-m-d H:i:s') { if ($this->date_posted === null || $this->date_posted === '') { return null; } elseif (!is_int($this->date_posted)) { $ts = strtotime($this->date_posted); if ($ts === -1 || $ts === false) { throw new PropelException("Unable to parse value of [date_posted] as date/time value: " . var_export($this->date_posted, true)); } } else { $ts = $this->date_posted; } if ($format === null) { return $ts; } elseif (strpos($format, '%') !== false) { return strftime($format, $ts); } else { return date($format, $ts); } } 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 getPurchaseOrderId() { return $this->purchase_order_id; } public function setPaymentId($v) { if ($v !== null && !is_int($v) && is_numeric($v)) { $v = (int) $v; } if ($this->payment_id !== $v) { $this->payment_id = $v; $this->modifiedColumns[] = SoPaymentsPeer::PAYMENT_ID; } } 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[] = SoPaymentsPeer::ORDERS_ID; } } public function setPaymentNumber($v) { if ($v !== null && !is_string($v)) { $v = (string) $v; } if ($this->payment_number !== $v) { $this->payment_number = $v; $this->modifiedColumns[] = SoPaymentsPeer::PAYMENT_NUMBER; } } public function setPaymentName($v) { if ($v !== null && !is_string($v)) { $v = (string) $v; } if ($this->payment_name !== $v) { $this->payment_name = $v; $this->modifiedColumns[] = SoPaymentsPeer::PAYMENT_NAME; } } public function setPaymentAmount($v) { if ($this->payment_amount !== $v) { $this->payment_amount = $v; $this->modifiedColumns[] = SoPaymentsPeer::PAYMENT_AMOUNT; } } public function setPaymentType($v) { if ($v !== null && !is_string($v)) { $v = (string) $v; } if ($this->payment_type !== $v) { $this->payment_type = $v; $this->modifiedColumns[] = SoPaymentsPeer::PAYMENT_TYPE; } } public function setDatePosted($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 [date_posted] from input: " . var_export($v, true)); } } else { $ts = $v; } if ($this->date_posted !== $ts) { $this->date_posted = $ts; $this->modifiedColumns[] = SoPaymentsPeer::DATE_POSTED; } } 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[] = SoPaymentsPeer::LAST_MODIFIED; } } public function setPurchaseOrderId($v) { if ($v !== null && !is_int($v) && is_numeric($v)) { $v = (int) $v; } if ($this->purchase_order_id !== $v || $v === 0) { $this->purchase_order_id = $v; $this->modifiedColumns[] = SoPaymentsPeer::PURCHASE_ORDER_ID; } } public function hydrate(ResultSet $rs, $startcol = 1) { try { $this->payment_id = $rs->getInt($startcol + 0); $this->orders_id = $rs->getInt($startcol + 1); $this->payment_number = $rs->getString($startcol + 2); $this->payment_name = $rs->getString($startcol + 3); $this->payment_amount = $rs->getFloat($startcol + 4); $this->payment_type = $rs->getString($startcol + 5); $this->date_posted = $rs->getTimestamp($startcol + 6, null); $this->last_modified = $rs->getTimestamp($startcol + 7, null); $this->purchase_order_id = $rs->getInt($startcol + 8); $this->resetModified(); $this->setNew(false); return $startcol + 9; } catch (Exception $e) { throw new PropelException("Error populating SoPayments 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(SoPaymentsPeer::DATABASE_NAME); } try { $con->begin(); SoPaymentsPeer::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(SoPaymentsPeer::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 = SoPaymentsPeer::doInsert($this, $con); $affectedRows += 1; $this->setPaymentId($pk); $this->setNew(false); } else { $affectedRows += SoPaymentsPeer::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 = SoPaymentsPeer::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 = SoPaymentsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); return $this->getByPosition($pos); } public function getByPosition($pos) { switch($pos) { case 0: return $this->getPaymentId(); break; case 1: return $this->getOrdersId(); break; case 2: return $this->getPaymentNumber(); break; case 3: return $this->getPaymentName(); break; case 4: return $this->getPaymentAmount(); break; case 5: return $this->getPaymentType(); break; case 6: return $this->getDatePosted(); break; case 7: return $this->getLastModified(); break; case 8: return $this->getPurchaseOrderId(); break; default: return null; break; } } public function toArray($keyType = BasePeer::TYPE_PHPNAME) { $keys = SoPaymentsPeer::getFieldNames($keyType); $result = array( $keys[0] => $this->getPaymentId(), $keys[1] => $this->getOrdersId(), $keys[2] => $this->getPaymentNumber(), $keys[3] => $this->getPaymentName(), $keys[4] => $this->getPaymentAmount(), $keys[5] => $this->getPaymentType(), $keys[6] => $this->getDatePosted(), $keys[7] => $this->getLastModified(), $keys[8] => $this->getPurchaseOrderId(), ); return $result; } public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) { $pos = SoPaymentsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); return $this->setByPosition($pos, $value); } public function setByPosition($pos, $value) { switch($pos) { case 0: $this->setPaymentId($value); break; case 1: $this->setOrdersId($value); break; case 2: $this->setPaymentNumber($value); break; case 3: $this->setPaymentName($value); break; case 4: $this->setPaymentAmount($value); break; case 5: $this->setPaymentType($value); break; case 6: $this->setDatePosted($value); break; case 7: $this->setLastModified($value); break; case 8: $this->setPurchaseOrderId($value); break; } } public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = SoPaymentsPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) $this->setPaymentId($arr[$keys[0]]); if (array_key_exists($keys[1], $arr)) $this->setOrdersId($arr[$keys[1]]); if (array_key_exists($keys[2], $arr)) $this->setPaymentNumber($arr[$keys[2]]); if (array_key_exists($keys[3], $arr)) $this->setPaymentName($arr[$keys[3]]); if (array_key_exists($keys[4], $arr)) $this->setPaymentAmount($arr[$keys[4]]); if (array_key_exists($keys[5], $arr)) $this->setPaymentType($arr[$keys[5]]); if (array_key_exists($keys[6], $arr)) $this->setDatePosted($arr[$keys[6]]); if (array_key_exists($keys[7], $arr)) $this->setLastModified($arr[$keys[7]]); if (array_key_exists($keys[8], $arr)) $this->setPurchaseOrderId($arr[$keys[8]]); } public function buildCriteria() { $criteria = new Criteria(SoPaymentsPeer::DATABASE_NAME); if ($this->isColumnModified(SoPaymentsPeer::PAYMENT_ID)) $criteria->add(SoPaymentsPeer::PAYMENT_ID, $this->payment_id); if ($this->isColumnModified(SoPaymentsPeer::ORDERS_ID)) $criteria->add(SoPaymentsPeer::ORDERS_ID, $this->orders_id); if ($this->isColumnModified(SoPaymentsPeer::PAYMENT_NUMBER)) $criteria->add(SoPaymentsPeer::PAYMENT_NUMBER, $this->payment_number); if ($this->isColumnModified(SoPaymentsPeer::PAYMENT_NAME)) $criteria->add(SoPaymentsPeer::PAYMENT_NAME, $this->payment_name); if ($this->isColumnModified(SoPaymentsPeer::PAYMENT_AMOUNT)) $criteria->add(SoPaymentsPeer::PAYMENT_AMOUNT, $this->payment_amount); if ($this->isColumnModified(SoPaymentsPeer::PAYMENT_TYPE)) $criteria->add(SoPaymentsPeer::PAYMENT_TYPE, $this->payment_type); if ($this->isColumnModified(SoPaymentsPeer::DATE_POSTED)) $criteria->add(SoPaymentsPeer::DATE_POSTED, $this->date_posted); if ($this->isColumnModified(SoPaymentsPeer::LAST_MODIFIED)) $criteria->add(SoPaymentsPeer::LAST_MODIFIED, $this->last_modified); if ($this->isColumnModified(SoPaymentsPeer::PURCHASE_ORDER_ID)) $criteria->add(SoPaymentsPeer::PURCHASE_ORDER_ID, $this->purchase_order_id); return $criteria; } public function buildPkeyCriteria() { $criteria = new Criteria(SoPaymentsPeer::DATABASE_NAME); $criteria->add(SoPaymentsPeer::PAYMENT_ID, $this->payment_id); return $criteria; } public function getPrimaryKey() { return $this->getPaymentId(); } public function setPrimaryKey($key) { $this->setPaymentId($key); } public function copyInto($copyObj, $deepCopy = false) { $copyObj->setOrdersId($this->orders_id); $copyObj->setPaymentNumber($this->payment_number); $copyObj->setPaymentName($this->payment_name); $copyObj->setPaymentAmount($this->payment_amount); $copyObj->setPaymentType($this->payment_type); $copyObj->setDatePosted($this->date_posted); $copyObj->setLastModified($this->last_modified); $copyObj->setPurchaseOrderId($this->purchase_order_id); $copyObj->setNew(true); $copyObj->setPaymentId(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 SoPaymentsPeer(); } return self::$peer; } }