5 * Base class that represents a row from the 'medium' table.
9 * @package propel.generator.propel.om
11 abstract class BaseMedium extends BaseObject implements Persistent
16 const PEER = 'MediumPeer';
20 * Instance provides a convenient way of calling static methods on a class
21 * that calling code may not be able to identify.
24 protected static $peer;
27 * The flag var to prevent infinite loop in deep copy
30 protected $startCopy = false;
33 * The value for the id field.
39 * The value for the mod field.
45 * The value for the autor field.
51 * The value for the titel field.
57 * The value for the eigentumer field.
60 protected $eigentumer;
63 * The value for the zz_bei field.
69 * The value for the kommentar field.
75 * The value for the class_key field.
81 * Flag to prevent endless save loop, if this object is referenced
82 * by another object which falls in this transaction.
85 protected $alreadyInSave = false;
88 * Flag to prevent endless validation loop, if this object is referenced
89 * by another object which falls in this transaction.
92 protected $alreadyInValidation = false;
95 * Flag to prevent endless clearAllReferences($deep=true) loop, if this object is referenced
98 protected $alreadyInClearAllReferencesDeep = false;
101 * Get the [id] column value.
105 public function getId()
112 * Get the [mod] column value.
116 public function getMod()
123 * Get the [autor] column value.
127 public function getAutor()
134 * Get the [titel] column value.
138 public function getTitel()
145 * Get the [eigentumer] column value.
149 public function getEigentumer()
152 return $this->eigentumer;
156 * Get the [zz_bei] column value.
160 public function getZzBei()
163 return $this->zz_bei;
167 * Get the [kommentar] column value.
171 public function getKommentar()
174 return $this->kommentar;
178 * Get the [class_key] column value.
182 public function getClassKey()
185 return $this->class_key;
189 * Set the value of [id] column.
191 * @param int $v new value
192 * @return Medium The current object (for fluent API support)
194 public function setId($v)
196 if ($v !== null && is_numeric($v)) {
200 if ($this->id !== $v) {
202 $this->modifiedColumns[] = MediumPeer::ID;
210 * Set the value of [mod] column.
212 * @param int $v new value
213 * @return Medium The current object (for fluent API support)
215 public function setMod($v)
217 if ($v !== null && is_numeric($v)) {
221 if ($this->mod !== $v) {
223 $this->modifiedColumns[] = MediumPeer::MOD;
231 * Set the value of [autor] column.
233 * @param string $v new value
234 * @return Medium The current object (for fluent API support)
236 public function setAutor($v)
242 if ($this->autor !== $v) {
244 $this->modifiedColumns[] = MediumPeer::AUTOR;
252 * Set the value of [titel] column.
254 * @param string $v new value
255 * @return Medium The current object (for fluent API support)
257 public function setTitel($v)
263 if ($this->titel !== $v) {
265 $this->modifiedColumns[] = MediumPeer::TITEL;
273 * Set the value of [eigentumer] column.
275 * @param string $v new value
276 * @return Medium The current object (for fluent API support)
278 public function setEigentumer($v)
284 if ($this->eigentumer !== $v) {
285 $this->eigentumer = $v;
286 $this->modifiedColumns[] = MediumPeer::EIGENTUMER;
294 * Set the value of [zz_bei] column.
296 * @param string $v new value
297 * @return Medium The current object (for fluent API support)
299 public function setZzBei($v)
305 if ($this->zz_bei !== $v) {
307 $this->modifiedColumns[] = MediumPeer::ZZ_BEI;
315 * Set the value of [kommentar] column.
317 * @param string $v new value
318 * @return Medium The current object (for fluent API support)
320 public function setKommentar($v)
326 if ($this->kommentar !== $v) {
327 $this->kommentar = $v;
328 $this->modifiedColumns[] = MediumPeer::KOMMENTAR;
336 * Set the value of [class_key] column.
338 * @param int $v new value
339 * @return Medium The current object (for fluent API support)
341 public function setClassKey($v)
343 if ($v !== null && is_numeric($v)) {
347 if ($this->class_key !== $v) {
348 $this->class_key = $v;
349 $this->modifiedColumns[] = MediumPeer::CLASS_KEY;
357 * Indicates whether the columns in this object are only set to default values.
359 * This method can be used in conjunction with isModified() to indicate whether an object is both
360 * modified _and_ has some values set which are non-default.
362 * @return boolean Whether the columns in this object are only been set with default values.
364 public function hasOnlyDefaultValues()
366 // otherwise, everything was equal, so return true
368 } // hasOnlyDefaultValues()
371 * Hydrates (populates) the object variables with values from the database resultset.
373 * An offset (0-based "start column") is specified so that objects can be hydrated
374 * with a subset of the columns in the resultset rows. This is needed, for example,
375 * for results of JOIN queries where the resultset row includes columns from two or
378 * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
379 * @param int $startcol 0-based offset column which indicates which resultset column to start with.
380 * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
381 * @return int next starting column
382 * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
384 public function hydrate($row, $startcol = 0, $rehydrate = false)
388 $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
389 $this->mod = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
390 $this->autor = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
391 $this->titel = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
392 $this->eigentumer = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
393 $this->zz_bei = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
394 $this->kommentar = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
395 $this->class_key = ($row[$startcol + 7] !== null) ? (int) $row[$startcol + 7] : null;
396 $this->resetModified();
398 $this->setNew(false);
401 $this->ensureConsistency();
403 $this->postHydrate($row, $startcol, $rehydrate);
405 return $startcol + 8; // 8 = MediumPeer::NUM_HYDRATE_COLUMNS.
407 } catch (Exception $e) {
408 throw new PropelException("Error populating Medium object", $e);
413 * Checks and repairs the internal consistency of the object.
415 * This method is executed after an already-instantiated object is re-hydrated
416 * from the database. It exists to check any foreign keys to make sure that
417 * the objects related to the current object are correct based on foreign key.
419 * You can override this method in the stub class, but you should always invoke
420 * the base method from the overridden method (i.e. parent::ensureConsistency()),
421 * in case your model changes.
423 * @throws PropelException
425 public function ensureConsistency()
428 } // ensureConsistency
431 * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
433 * This will only work if the object has been saved and has a valid primary key set.
435 * @param boolean $deep (optional) Whether to also de-associated any related objects.
436 * @param PropelPDO $con (optional) The PropelPDO connection to use.
438 * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
440 public function reload($deep = false, PropelPDO $con = null)
442 if ($this->isDeleted()) {
443 throw new PropelException("Cannot reload a deleted object.");
446 if ($this->isNew()) {
447 throw new PropelException("Cannot reload an unsaved object.");
451 $con = Propel::getConnection(MediumPeer::DATABASE_NAME, Propel::CONNECTION_READ);
454 // We don't need to alter the object instance pool; we're just modifying this instance
455 // already in the pool.
457 $stmt = MediumPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
458 $row = $stmt->fetch(PDO::FETCH_NUM);
459 $stmt->closeCursor();
461 throw new PropelException('Cannot find matching row in the database to reload object values.');
463 $this->hydrate($row, 0, true); // rehydrate
465 if ($deep) { // also de-associate any related objects?
471 * Removes this object from datastore and sets delete attribute.
473 * @param PropelPDO $con
475 * @throws PropelException
477 * @see BaseObject::setDeleted()
478 * @see BaseObject::isDeleted()
480 public function delete(PropelPDO $con = null)
482 if ($this->isDeleted()) {
483 throw new PropelException("This object has already been deleted.");
487 $con = Propel::getConnection(MediumPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
490 $con->beginTransaction();
492 $deleteQuery = MediumQuery::create()
493 ->filterByPrimaryKey($this->getPrimaryKey());
494 $ret = $this->preDelete($con);
496 $deleteQuery->delete($con);
497 $this->postDelete($con);
499 $this->setDeleted(true);
503 } catch (Exception $e) {
510 * Persists this object to the database.
512 * If the object is new, it inserts it; otherwise an update is performed.
513 * All modified related objects will also be persisted in the doSave()
514 * method. This method wraps all precipitate database operations in a
515 * single transaction.
517 * @param PropelPDO $con
518 * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
519 * @throws PropelException
523 public function save(PropelPDO $con = null)
525 if ($this->isDeleted()) {
526 throw new PropelException("You cannot save an object that has been deleted.");
530 $con = Propel::getConnection(MediumPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
533 $con->beginTransaction();
534 $isInsert = $this->isNew();
536 $ret = $this->preSave($con);
538 $ret = $ret && $this->preInsert($con);
540 $ret = $ret && $this->preUpdate($con);
543 $affectedRows = $this->doSave($con);
545 $this->postInsert($con);
547 $this->postUpdate($con);
549 $this->postSave($con);
550 MediumPeer::addInstanceToPool($this);
556 return $affectedRows;
557 } catch (Exception $e) {
564 * Performs the work of inserting or updating the row in the database.
566 * If the object is new, it inserts it; otherwise an update is performed.
567 * All related objects are also updated in this method.
569 * @param PropelPDO $con
570 * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
571 * @throws PropelException
574 protected function doSave(PropelPDO $con)
576 $affectedRows = 0; // initialize var to track total num of affected rows
577 if (!$this->alreadyInSave) {
578 $this->alreadyInSave = true;
580 if ($this->isNew() || $this->isModified()) {
582 if ($this->isNew()) {
583 $this->doInsert($con);
585 $this->doUpdate($con);
588 $this->resetModified();
591 $this->alreadyInSave = false;
595 return $affectedRows;
599 * Insert the row in the database.
601 * @param PropelPDO $con
603 * @throws PropelException
606 protected function doInsert(PropelPDO $con)
608 $modifiedColumns = array();
611 $this->modifiedColumns[] = MediumPeer::ID;
612 if (null !== $this->id) {
613 throw new PropelException('Cannot insert a value for auto-increment primary key (' . MediumPeer::ID . ')');
616 // check the columns in natural order for more readable SQL queries
617 if ($this->isColumnModified(MediumPeer::ID)) {
618 $modifiedColumns[':p' . $index++] = '`id`';
620 if ($this->isColumnModified(MediumPeer::MOD)) {
621 $modifiedColumns[':p' . $index++] = '`mod`';
623 if ($this->isColumnModified(MediumPeer::AUTOR)) {
624 $modifiedColumns[':p' . $index++] = '`autor`';
626 if ($this->isColumnModified(MediumPeer::TITEL)) {
627 $modifiedColumns[':p' . $index++] = '`titel`';
629 if ($this->isColumnModified(MediumPeer::EIGENTUMER)) {
630 $modifiedColumns[':p' . $index++] = '`eigentumer`';
632 if ($this->isColumnModified(MediumPeer::ZZ_BEI)) {
633 $modifiedColumns[':p' . $index++] = '`zz_bei`';
635 if ($this->isColumnModified(MediumPeer::KOMMENTAR)) {
636 $modifiedColumns[':p' . $index++] = '`kommentar`';
638 if ($this->isColumnModified(MediumPeer::CLASS_KEY)) {
639 $modifiedColumns[':p' . $index++] = '`class_key`';
643 'INSERT INTO `medium` (%s) VALUES (%s)',
644 implode(', ', $modifiedColumns),
645 implode(', ', array_keys($modifiedColumns))
649 $stmt = $con->prepare($sql);
650 foreach ($modifiedColumns as $identifier => $columnName) {
651 switch ($columnName) {
653 $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
656 $stmt->bindValue($identifier, $this->mod, PDO::PARAM_INT);
659 $stmt->bindValue($identifier, $this->autor, PDO::PARAM_STR);
662 $stmt->bindValue($identifier, $this->titel, PDO::PARAM_STR);
665 $stmt->bindValue($identifier, $this->eigentumer, PDO::PARAM_STR);
668 $stmt->bindValue($identifier, $this->zz_bei, PDO::PARAM_STR);
671 $stmt->bindValue($identifier, $this->kommentar, PDO::PARAM_STR);
674 $stmt->bindValue($identifier, $this->class_key, PDO::PARAM_INT);
679 } catch (Exception $e) {
680 Propel::log($e->getMessage(), Propel::LOG_ERR);
681 throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
685 $pk = $con->lastInsertId();
686 } catch (Exception $e) {
687 throw new PropelException('Unable to get autoincrement id.', $e);
691 $this->setNew(false);
695 * Update the row in the database.
697 * @param PropelPDO $con
701 protected function doUpdate(PropelPDO $con)
703 $selectCriteria = $this->buildPkeyCriteria();
704 $valuesCriteria = $this->buildCriteria();
705 BasePeer::doUpdate($selectCriteria, $valuesCriteria, $con);
709 * Array of ValidationFailed objects.
710 * @var array ValidationFailed[]
712 protected $validationFailures = array();
715 * Gets any ValidationFailed objects that resulted from last call to validate().
718 * @return array ValidationFailed[]
721 public function getValidationFailures()
723 return $this->validationFailures;
727 * Validates the objects modified field values and all objects related to this table.
729 * If $columns is either a column name or an array of column names
730 * only those columns are validated.
732 * @param mixed $columns Column name or an array of column names.
733 * @return boolean Whether all columns pass validation.
735 * @see getValidationFailures()
737 public function validate($columns = null)
739 $res = $this->doValidate($columns);
741 $this->validationFailures = array();
746 $this->validationFailures = $res;
752 * This function performs the validation work for complex object models.
754 * In addition to checking the current object, all related objects will
755 * also be validated. If all pass then <code>true</code> is returned; otherwise
756 * an aggregated array of ValidationFailed objects will be returned.
758 * @param array $columns Array of column names to validate.
759 * @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objects otherwise.
761 protected function doValidate($columns = null)
763 if (!$this->alreadyInValidation) {
764 $this->alreadyInValidation = true;
767 $failureMap = array();
770 if (($retval = MediumPeer::doValidate($this, $columns)) !== true) {
771 $failureMap = array_merge($failureMap, $retval);
776 $this->alreadyInValidation = false;
779 return (!empty($failureMap) ? $failureMap : true);
783 * Retrieves a field from the object by name passed in as a string.
785 * @param string $name name
786 * @param string $type The type of fieldname the $name is of:
787 * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
788 * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
789 * Defaults to BasePeer::TYPE_PHPNAME
790 * @return mixed Value of field.
792 public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
794 $pos = MediumPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
795 $field = $this->getByPosition($pos);
801 * Retrieves a field from the object by Position as specified in the xml schema.
804 * @param int $pos position in xml schema
805 * @return mixed Value of field at $pos
807 public function getByPosition($pos)
811 return $this->getId();
814 return $this->getMod();
817 return $this->getAutor();
820 return $this->getTitel();
823 return $this->getEigentumer();
826 return $this->getZzBei();
829 return $this->getKommentar();
832 return $this->getClassKey();
841 * Exports the object as an array.
843 * You can specify the key type of the array by passing one of the class
846 * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
847 * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
848 * Defaults to BasePeer::TYPE_PHPNAME.
849 * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to true.
850 * @param array $alreadyDumpedObjects List of objects to skip to avoid recursion
852 * @return array an associative array containing the field names (as keys) and field values
854 public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array())
856 if (isset($alreadyDumpedObjects['Medium'][$this->getPrimaryKey()])) {
857 return '*RECURSION*';
859 $alreadyDumpedObjects['Medium'][$this->getPrimaryKey()] = true;
860 $keys = MediumPeer::getFieldNames($keyType);
862 $keys[0] => $this->getId(),
863 $keys[1] => $this->getMod(),
864 $keys[2] => $this->getAutor(),
865 $keys[3] => $this->getTitel(),
866 $keys[4] => $this->getEigentumer(),
867 $keys[5] => $this->getZzBei(),
868 $keys[6] => $this->getKommentar(),
869 $keys[7] => $this->getClassKey(),
871 $virtualColumns = $this->virtualColumns;
872 foreach ($virtualColumns as $key => $virtualColumn) {
873 $result[$key] = $virtualColumn;
881 * Sets a field from the object by name passed in as a string.
883 * @param string $name peer name
884 * @param mixed $value field value
885 * @param string $type The type of fieldname the $name is of:
886 * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
887 * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
888 * Defaults to BasePeer::TYPE_PHPNAME
891 public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
893 $pos = MediumPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
895 $this->setByPosition($pos, $value);
899 * Sets a field from the object by Position as specified in the xml schema.
902 * @param int $pos position in xml schema
903 * @param mixed $value field value
906 public function setByPosition($pos, $value)
910 $this->setId($value);
913 $this->setMod($value);
916 $this->setAutor($value);
919 $this->setTitel($value);
922 $this->setEigentumer($value);
925 $this->setZzBei($value);
928 $this->setKommentar($value);
931 $this->setClassKey($value);
937 * Populates the object using an array.
939 * This is particularly useful when populating an object from one of the
940 * request arrays (e.g. $_POST). This method goes through the column
941 * names, checking to see whether a matching key exists in populated
942 * array. If so the setByName() method is called for that column.
944 * You can specify the key type of the array by additionally passing one
945 * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
946 * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
947 * The default key type is the column's BasePeer::TYPE_PHPNAME
949 * @param array $arr An array to populate the object from.
950 * @param string $keyType The type of keys the array uses.
953 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
955 $keys = MediumPeer::getFieldNames($keyType);
957 if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
958 if (array_key_exists($keys[1], $arr)) $this->setMod($arr[$keys[1]]);
959 if (array_key_exists($keys[2], $arr)) $this->setAutor($arr[$keys[2]]);
960 if (array_key_exists($keys[3], $arr)) $this->setTitel($arr[$keys[3]]);
961 if (array_key_exists($keys[4], $arr)) $this->setEigentumer($arr[$keys[4]]);
962 if (array_key_exists($keys[5], $arr)) $this->setZzBei($arr[$keys[5]]);
963 if (array_key_exists($keys[6], $arr)) $this->setKommentar($arr[$keys[6]]);
964 if (array_key_exists($keys[7], $arr)) $this->setClassKey($arr[$keys[7]]);
968 * Build a Criteria object containing the values of all modified columns in this object.
970 * @return Criteria The Criteria object containing all modified values.
972 public function buildCriteria()
974 $criteria = new Criteria(MediumPeer::DATABASE_NAME);
976 if ($this->isColumnModified(MediumPeer::ID)) $criteria->add(MediumPeer::ID, $this->id);
977 if ($this->isColumnModified(MediumPeer::MOD)) $criteria->add(MediumPeer::MOD, $this->mod);
978 if ($this->isColumnModified(MediumPeer::AUTOR)) $criteria->add(MediumPeer::AUTOR, $this->autor);
979 if ($this->isColumnModified(MediumPeer::TITEL)) $criteria->add(MediumPeer::TITEL, $this->titel);
980 if ($this->isColumnModified(MediumPeer::EIGENTUMER)) $criteria->add(MediumPeer::EIGENTUMER, $this->eigentumer);
981 if ($this->isColumnModified(MediumPeer::ZZ_BEI)) $criteria->add(MediumPeer::ZZ_BEI, $this->zz_bei);
982 if ($this->isColumnModified(MediumPeer::KOMMENTAR)) $criteria->add(MediumPeer::KOMMENTAR, $this->kommentar);
983 if ($this->isColumnModified(MediumPeer::CLASS_KEY)) $criteria->add(MediumPeer::CLASS_KEY, $this->class_key);
989 * Builds a Criteria object containing the primary key for this object.
991 * Unlike buildCriteria() this method includes the primary key values regardless
992 * of whether or not they have been modified.
994 * @return Criteria The Criteria object containing value(s) for primary key(s).
996 public function buildPkeyCriteria()
998 $criteria = new Criteria(MediumPeer::DATABASE_NAME);
999 $criteria->add(MediumPeer::ID, $this->id);
1005 * Returns the primary key for this object (row).
1008 public function getPrimaryKey()
1010 return $this->getId();
1014 * Generic method to set the primary key (id column).
1016 * @param int $key Primary key.
1019 public function setPrimaryKey($key)
1025 * Returns true if the primary key for this object is null.
1028 public function isPrimaryKeyNull()
1031 return null === $this->getId();
1035 * Sets contents of passed object to values from current object.
1037 * If desired, this method can also make copies of all associated (fkey referrers)
1040 * @param object $copyObj An object of Medium (or compatible) type.
1041 * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
1042 * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
1043 * @throws PropelException
1045 public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
1047 $copyObj->setMod($this->getMod());
1048 $copyObj->setAutor($this->getAutor());
1049 $copyObj->setTitel($this->getTitel());
1050 $copyObj->setEigentumer($this->getEigentumer());
1051 $copyObj->setZzBei($this->getZzBei());
1052 $copyObj->setKommentar($this->getKommentar());
1053 $copyObj->setClassKey($this->getClassKey());
1055 $copyObj->setNew(true);
1056 $copyObj->setId(NULL); // this is a auto-increment column, so set to default value
1061 * Makes a copy of this object that will be inserted as a new row in table when saved.
1062 * It creates a new object filling in the simple attributes, but skipping any primary
1063 * keys that are defined for the table.
1065 * If desired, this method can also make copies of all associated (fkey referrers)
1068 * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
1069 * @return Medium Clone of current object.
1070 * @throws PropelException
1072 public function copy($deepCopy = false)
1074 // we use get_class(), because this might be a subclass
1075 $clazz = get_class($this);
1076 $copyObj = new $clazz();
1077 $this->copyInto($copyObj, $deepCopy);
1083 * Returns a peer instance associated with this om.
1085 * Since Peer classes are not to have any instance attributes, this method returns the
1086 * same instance for all member of this class. The method could therefore
1087 * be static, but this would prevent one from overriding the behavior.
1089 * @return MediumPeer
1091 public function getPeer()
1093 if (self::$peer === null) {
1094 self::$peer = new MediumPeer();
1101 * Clears the current object and sets all attributes to their default values
1103 public function clear()
1107 $this->autor = null;
1108 $this->titel = null;
1109 $this->eigentumer = null;
1110 $this->zz_bei = null;
1111 $this->kommentar = null;
1112 $this->class_key = null;
1113 $this->alreadyInSave = false;
1114 $this->alreadyInValidation = false;
1115 $this->alreadyInClearAllReferencesDeep = false;
1116 $this->clearAllReferences();
1117 $this->resetModified();
1118 $this->setNew(true);
1119 $this->setDeleted(false);
1123 * Resets all references to other model objects or collections of model objects.
1125 * This method is a user-space workaround for PHP's inability to garbage collect
1126 * objects with circular references (even in PHP 5.3). This is currently necessary
1127 * when using Propel in certain daemon or large-volume/high-memory operations.
1129 * @param boolean $deep Whether to also clear the references on all referrer objects.
1131 public function clearAllReferences($deep = false)
1133 if ($deep && !$this->alreadyInClearAllReferencesDeep) {
1134 $this->alreadyInClearAllReferencesDeep = true;
1136 $this->alreadyInClearAllReferencesDeep = false;
1142 * return the string representation of this object
1146 public function __toString()
1148 return (string) $this->exportTo(MediumPeer::DEFAULT_STRING_FORMAT);
1152 * return true is the object is in saving state
1156 public function isAlreadyInSave()
1158 return $this->alreadyInSave;