From 6b4daac1ccf586007dbc9e31c5b406f2af8161f8 Mon Sep 17 00:00:00 2001 From: Michael Wagner Date: Fri, 17 Oct 2025 17:21:33 +0200 Subject: [PATCH 1/4] changes for kivitendo_3.9.2 --- debian/kivitendo.control | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/kivitendo.control b/debian/kivitendo.control index bd14e58..77671cb 100644 --- a/debian/kivitendo.control +++ b/debian/kivitendo.control @@ -25,6 +25,7 @@ Depends: apache2, postgresql, libapache2-mod-fcgid, libarchive-zip-perl, libclon libfile-mimeinfo-perl, libpbkdf2-tiny-perl, libregexp-ipv6-perl, libdatetime-event-cron-perl, libexception-class-perl, libcam-pdf-perl, libmath-round-perl, librest-client-perl, - libimager-qrcode-perl, libipc-run-perl + libimager-qrcode-perl, libipc-run-perl, libencode-imaputf7-perl, + libmail-imapclient-perl, libuuid-tiny-perl Description: kivitendo-ERP -- 2.39.5 From 44eb47b422753bc1aa790741beb17912933c07cd Mon Sep 17 00:00:00 2001 From: Michael Wagner Date: Sat, 8 Nov 2025 12:59:45 +0100 Subject: [PATCH 2/4] mconnect new --- Configure | 22 ++++++++++++++- debian/libcob-ocesql.build | 4 +++ debian/libcob-ocesql.control | 10 +++++++ debian/libcob-ocesql.cp | 28 +++++++++++++++++++ debian/mconnect.changelog | 4 +++ debian/mconnect.control | 11 ++++++++ debian/mconnect.cp | 9 ++++++ etc/mconnect.toml | 10 +++++++ sh/mconnect | 5 ++++ verleihnix/Verleihnix/impl/data/build/.dummy | 0 .../Verleihnix/impl/data/build/classes/.dummy | 0 .../Verleihnix/impl/data/build/conf/.dummy | 0 .../Verleihnix/impl/data/build/sql/.dummy | 0 13 files changed, 102 insertions(+), 1 deletion(-) create mode 100755 debian/libcob-ocesql.build create mode 100644 debian/libcob-ocesql.control create mode 100755 debian/libcob-ocesql.cp create mode 100644 debian/mconnect.changelog create mode 100644 debian/mconnect.control create mode 100755 debian/mconnect.cp create mode 100644 etc/mconnect.toml create mode 100755 sh/mconnect create mode 100644 verleihnix/Verleihnix/impl/data/build/.dummy create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/.dummy create mode 100644 verleihnix/Verleihnix/impl/data/build/conf/.dummy create mode 100644 verleihnix/Verleihnix/impl/data/build/sql/.dummy diff --git a/Configure b/Configure index 9e8badc..325f710 100755 --- a/Configure +++ b/Configure @@ -4,7 +4,7 @@ set -e function usage { cat <debian/mconnect.conf +# generated by configure +compile_type=NONE +target_type=DEB +MCONNECT + mconfigure mconnect + ;; + +libcob-ocesql) + cat <debian/libcob-ocesql.conf +# generated by configure +compile_type=ANY +target_type=DEB +OCESQL + mconfigure -v 1.4 libcob-ocesql + ;; + webssh) cat <debian/webssh.conf # generated by configure @@ -23,6 +42,7 @@ target_type=DEB WEBSSH mconfigure -V webssh ;; + *) echo "Invalid project." usage diff --git a/debian/libcob-ocesql.build b/debian/libcob-ocesql.build new file mode 100755 index 0000000..1a51ab1 --- /dev/null +++ b/debian/libcob-ocesql.build @@ -0,0 +1,4 @@ +#!/bin/bash +set -e + +echo "NYI" diff --git a/debian/libcob-ocesql.control b/debian/libcob-ocesql.control new file mode 100644 index 0000000..24110ee --- /dev/null +++ b/debian/libcob-ocesql.control @@ -0,0 +1,10 @@ +Source: libcob-ocesql +Section: main +Priority: optional +Maintainer: Michael Wagner +Build-Depends: git, mbuild + +Package: libcob-ocesql +Architecture: _DEB_HOST_ARCH +Depends: postgresql +Description: OCESQL runtime diff --git a/debian/libcob-ocesql.cp b/debian/libcob-ocesql.cp new file mode 100755 index 0000000..51a20e4 --- /dev/null +++ b/debian/libcob-ocesql.cp @@ -0,0 +1,28 @@ +#!/bin/bash +set -e + +mkdir -p $1/usr/local/lib +cp ../Open-COBOL-ESQL-$version/dblib/.libs/libocesql.a $1/usr/local/lib +cp ../Open-COBOL-ESQL-$version/dblib/libocesql.la $1/usr/local/lib +cp ../Open-COBOL-ESQL-$version/dblib/.libs/libocesql.so.0.1.0 $1/usr/local/lib +pushd $1/usr/local/lib >/dev/null + ln -s libocesql.so.0.1.0 libocesql.so + ln -s libocesql.so.0.1.0 libocesql.so.0 +popd >/dev/null + +mkdir -p $1/usr/bin +cat << 'OCERUN' > $1/usr/bin/ocerun +#!/bin/bash +set -e + +if [ -z "$1" ] ;then + echo "Usage: ocerun DATEI" + exit 1 +fi + +export LD_LIBRARY_PATH="/usr/local/lib" +export OCDB_DB_CHAR=UTF-8 + +$1 +OCERUN +chmod 755 $1/usr/bin/ocerun diff --git a/debian/mconnect.changelog b/debian/mconnect.changelog new file mode 100644 index 0000000..fb21d60 --- /dev/null +++ b/debian/mconnect.changelog @@ -0,0 +1,4 @@ +projects (0.1-%BUILD%) unstable; urgency=medium + * initial version + -- Michael Wagner Sat, 08 Nov 2025 20:03:04 +0100 + diff --git a/debian/mconnect.control b/debian/mconnect.control new file mode 100644 index 0000000..46bb213 --- /dev/null +++ b/debian/mconnect.control @@ -0,0 +1,11 @@ +Source: projects +Section: main +Priority: optional +Maintainer: Michael Wagner +Build-Depends: git + +Package: mconnect +Architecture: all +Depends: frpc +Description: mconnect builds a ssh connectivity to local host via frps on wagnertech.de:6002 + diff --git a/debian/mconnect.cp b/debian/mconnect.cp new file mode 100755 index 0000000..eae83d7 --- /dev/null +++ b/debian/mconnect.cp @@ -0,0 +1,9 @@ +#!/bin/bash +set -e + +mkdir -p $1/usr/bin +cp sh/mconnect $1/usr/bin + +mkdir -p $1/etc +cp etc/mconnect.toml $1/etc/ + diff --git a/etc/mconnect.toml b/etc/mconnect.toml new file mode 100644 index 0000000..353c689 --- /dev/null +++ b/etc/mconnect.toml @@ -0,0 +1,10 @@ +serverAddr = "wagnertech.de" +serverPort = 7000 + +[[proxies]] +name = "mconnect-ssh" +type = "tcp" +localIP = "127.0.0.1" +localPort = 22 +remotePort = 6002 + diff --git a/sh/mconnect b/sh/mconnect new file mode 100755 index 0000000..21491e3 --- /dev/null +++ b/sh/mconnect @@ -0,0 +1,5 @@ +#!/bin/bash +set -e + +frpc -c /etc/mconnect.toml + diff --git a/verleihnix/Verleihnix/impl/data/build/.dummy b/verleihnix/Verleihnix/impl/data/build/.dummy new file mode 100644 index 0000000..e69de29 diff --git a/verleihnix/Verleihnix/impl/data/build/classes/.dummy b/verleihnix/Verleihnix/impl/data/build/classes/.dummy new file mode 100644 index 0000000..e69de29 diff --git a/verleihnix/Verleihnix/impl/data/build/conf/.dummy b/verleihnix/Verleihnix/impl/data/build/conf/.dummy new file mode 100644 index 0000000..e69de29 diff --git a/verleihnix/Verleihnix/impl/data/build/sql/.dummy b/verleihnix/Verleihnix/impl/data/build/sql/.dummy new file mode 100644 index 0000000..e69de29 -- 2.39.5 From b7dc2b69d6f7d354ddd82fc3f64fed711ceb317d Mon Sep 17 00:00:00 2001 From: Michael Wagner Date: Sat, 8 Nov 2025 13:02:09 +0100 Subject: [PATCH 3/4] verleihnix komplett eingescheckt --- .../impl/data/build/classes/propel/.dummy | 0 .../data/build/classes/propel/Horbuch.php | 27 + .../build/classes/propel/HorbuchQuery.php | 18 + .../impl/data/build/classes/propel/Krimi.php | 27 + .../data/build/classes/propel/KrimiQuery.php | 18 + .../impl/data/build/classes/propel/Medium.php | 28 + .../data/build/classes/propel/MediumPeer.php | 18 + .../data/build/classes/propel/MediumQuery.php | 18 + .../impl/data/build/classes/propel/Roman.php | 27 + .../data/build/classes/propel/RomanQuery.php | 18 + .../data/build/classes/propel/Werkzeug.php | 28 + .../build/classes/propel/WerkzeugPeer.php | 18 + .../build/classes/propel/WerkzeugQuery.php | 18 + .../impl/data/build/classes/propel/map/.dummy | 0 .../classes/propel/map/MediumTableMap.php | 60 + .../classes/propel/map/WerkzeugTableMap.php | 57 + .../impl/data/build/classes/propel/om/.dummy | 0 .../classes/propel/om/BaseHorbuchQuery.php | 109 ++ .../classes/propel/om/BaseKrimiQuery.php | 109 ++ .../build/classes/propel/om/BaseMedium.php | 1161 +++++++++++++++++ .../classes/propel/om/BaseMediumPeer.php | 850 ++++++++++++ .../classes/propel/om/BaseMediumQuery.php | 534 ++++++++ .../classes/propel/om/BaseRomanQuery.php | 109 ++ .../build/classes/propel/om/BaseWerkzeug.php | 1049 +++++++++++++++ .../classes/propel/om/BaseWerkzeugPeer.php | 781 +++++++++++ .../classes/propel/om/BaseWerkzeugQuery.php | 454 +++++++ .../data/build/conf/classmap-propel-conf.php | 27 + .../impl/data/build/conf/propel-conf.php | 29 + .../impl/data/build/sql/createDB.sh | 1 + .../Verleihnix/impl/data/build/sql/schema.sql | 43 + .../Verleihnix/impl/data/build/sql/sqldb.map | 2 + 31 files changed, 5638 insertions(+) create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/.dummy create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/Horbuch.php create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/HorbuchQuery.php create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/Krimi.php create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/KrimiQuery.php create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/Medium.php create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/MediumPeer.php create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/MediumQuery.php create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/Roman.php create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/RomanQuery.php create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/Werkzeug.php create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/WerkzeugPeer.php create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/WerkzeugQuery.php create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/map/.dummy create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/map/MediumTableMap.php create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/map/WerkzeugTableMap.php create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/om/.dummy create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseHorbuchQuery.php create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseKrimiQuery.php create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseMedium.php create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseMediumPeer.php create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseMediumQuery.php create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseRomanQuery.php create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseWerkzeug.php create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseWerkzeugPeer.php create mode 100644 verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseWerkzeugQuery.php create mode 100644 verleihnix/Verleihnix/impl/data/build/conf/classmap-propel-conf.php create mode 100644 verleihnix/Verleihnix/impl/data/build/conf/propel-conf.php create mode 100755 verleihnix/Verleihnix/impl/data/build/sql/createDB.sh create mode 100644 verleihnix/Verleihnix/impl/data/build/sql/schema.sql create mode 100644 verleihnix/Verleihnix/impl/data/build/sql/sqldb.map diff --git a/verleihnix/Verleihnix/impl/data/build/classes/propel/.dummy b/verleihnix/Verleihnix/impl/data/build/classes/propel/.dummy new file mode 100644 index 0000000..e69de29 diff --git a/verleihnix/Verleihnix/impl/data/build/classes/propel/Horbuch.php b/verleihnix/Verleihnix/impl/data/build/classes/propel/Horbuch.php new file mode 100644 index 0000000..91b1ae2 --- /dev/null +++ b/verleihnix/Verleihnix/impl/data/build/classes/propel/Horbuch.php @@ -0,0 +1,27 @@ +setClassKey(MediumPeer::CLASSKEY_2); + } + +} // Horbuch diff --git a/verleihnix/Verleihnix/impl/data/build/classes/propel/HorbuchQuery.php b/verleihnix/Verleihnix/impl/data/build/classes/propel/HorbuchQuery.php new file mode 100644 index 0000000..ad2c318 --- /dev/null +++ b/verleihnix/Verleihnix/impl/data/build/classes/propel/HorbuchQuery.php @@ -0,0 +1,18 @@ +setClassKey(MediumPeer::CLASSKEY_1); + } + +} // Krimi diff --git a/verleihnix/Verleihnix/impl/data/build/classes/propel/KrimiQuery.php b/verleihnix/Verleihnix/impl/data/build/classes/propel/KrimiQuery.php new file mode 100644 index 0000000..1ee9bd0 --- /dev/null +++ b/verleihnix/Verleihnix/impl/data/build/classes/propel/KrimiQuery.php @@ -0,0 +1,18 @@ +isNew() || $this->mod >= 999999) { + $this->setMod(0); + } else { + $this->setMod($this->mod + 1); + } + return parent::save($con); + } + +} diff --git a/verleihnix/Verleihnix/impl/data/build/classes/propel/MediumPeer.php b/verleihnix/Verleihnix/impl/data/build/classes/propel/MediumPeer.php new file mode 100644 index 0000000..52a4174 --- /dev/null +++ b/verleihnix/Verleihnix/impl/data/build/classes/propel/MediumPeer.php @@ -0,0 +1,18 @@ +setClassKey(MediumPeer::CLASSKEY_3); + } + +} // Roman diff --git a/verleihnix/Verleihnix/impl/data/build/classes/propel/RomanQuery.php b/verleihnix/Verleihnix/impl/data/build/classes/propel/RomanQuery.php new file mode 100644 index 0000000..ff248be --- /dev/null +++ b/verleihnix/Verleihnix/impl/data/build/classes/propel/RomanQuery.php @@ -0,0 +1,18 @@ +isNew() || $this->mod >= 999999) { + $this->setMod(0); + } else { + $this->setMod($this->mod + 1); + } + return parent::save($con); + } + +} diff --git a/verleihnix/Verleihnix/impl/data/build/classes/propel/WerkzeugPeer.php b/verleihnix/Verleihnix/impl/data/build/classes/propel/WerkzeugPeer.php new file mode 100644 index 0000000..67ba458 --- /dev/null +++ b/verleihnix/Verleihnix/impl/data/build/classes/propel/WerkzeugPeer.php @@ -0,0 +1,18 @@ +setName('medium'); + $this->setPhpName('Medium'); + $this->setClassname('Medium'); + $this->setPackage('propel'); + $this->setUseIdGenerator(true); + $this->setSingleTableInheritance(true); + // columns + $this->addPrimaryKey('id', 'Id', 'INTEGER', true, null, null); + $this->addColumn('mod', 'Mod', 'INTEGER', true, null, null); + $this->addColumn('autor', 'Autor', 'VARCHAR', true, 100, null); + $this->addColumn('titel', 'Titel', 'VARCHAR', true, 100, null); + $this->addColumn('eigentumer', 'Eigentumer', 'VARCHAR', true, 100, null); + $this->addColumn('zz_bei', 'ZzBei', 'VARCHAR', true, 100, null); + $this->addColumn('kommentar', 'Kommentar', 'VARCHAR', true, 100, null); + $this->addColumn('class_key', 'ClassKey', 'INTEGER', true, null, null); + // validators + } // initialize() + + /** + * Build the RelationMap objects for this table relationships + */ + public function buildRelations() + { + } // buildRelations() + +} // MediumTableMap diff --git a/verleihnix/Verleihnix/impl/data/build/classes/propel/map/WerkzeugTableMap.php b/verleihnix/Verleihnix/impl/data/build/classes/propel/map/WerkzeugTableMap.php new file mode 100644 index 0000000..6c8f178 --- /dev/null +++ b/verleihnix/Verleihnix/impl/data/build/classes/propel/map/WerkzeugTableMap.php @@ -0,0 +1,57 @@ +setName('werkzeug'); + $this->setPhpName('Werkzeug'); + $this->setClassname('Werkzeug'); + $this->setPackage('propel'); + $this->setUseIdGenerator(true); + // columns + $this->addPrimaryKey('id', 'Id', 'INTEGER', true, null, null); + $this->addColumn('mod', 'Mod', 'INTEGER', true, null, null); + $this->addColumn('typ', 'Typ', 'VARCHAR', true, 100, null); + $this->addColumn('beschreibung', 'Beschreibung', 'VARCHAR', true, 100, null); + $this->addColumn('eigentumer', 'Eigentumer', 'VARCHAR', true, 100, null); + $this->addColumn('zz_bei', 'ZzBei', 'VARCHAR', true, 100, null); + // validators + } // initialize() + + /** + * Build the RelationMap objects for this table relationships + */ + public function buildRelations() + { + } // buildRelations() + +} // WerkzeugTableMap diff --git a/verleihnix/Verleihnix/impl/data/build/classes/propel/om/.dummy b/verleihnix/Verleihnix/impl/data/build/classes/propel/om/.dummy new file mode 100644 index 0000000..e69de29 diff --git a/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseHorbuchQuery.php b/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseHorbuchQuery.php new file mode 100644 index 0000000..d731dd0 --- /dev/null +++ b/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseHorbuchQuery.php @@ -0,0 +1,109 @@ +setModelAlias($modelAlias); + } + if ($criteria instanceof Criteria) { + $query->mergeWith($criteria); + } + + return $query; + } + + /** + * Filters the query to target only Horbuch objects. + */ + public function preSelect(PropelPDO $con) + { + $this->addUsingAlias(MediumPeer::CLASS_KEY, MediumPeer::CLASSKEY_2); + } + + /** + * Filters the query to target only Horbuch objects. + */ + public function preUpdate(&$values, PropelPDO $con, $forceIndividualSaves = false) + { + $this->addUsingAlias(MediumPeer::CLASS_KEY, MediumPeer::CLASSKEY_2); + } + + /** + * Filters the query to target only Horbuch objects. + */ + public function preDelete(PropelPDO $con) + { + $this->addUsingAlias(MediumPeer::CLASS_KEY, MediumPeer::CLASSKEY_2); + } + + /** + * Issue a DELETE query based on the current ModelCriteria deleting all rows in the table + * Having the Horbuch class. + * This method is called by ModelCriteria::deleteAll() inside a transaction + * + * @param PropelPDO $con a connection object + * + * @return integer the number of deleted rows + */ + public function doDeleteAll($con) + { + // condition on class key is already added in preDelete() + return parent::doDelete($con); + } + + + /** + * Issue a SELECT ... LIMIT 1 query based on the current ModelCriteria + * and format the result with the current formatter + * By default, returns a model object + * + * @param PropelPDO $con an optional connection object + * + * @return mixed the result, formatted by the current formatter + * + * @throws PropelException + */ + public function findOneOrCreate($con = null) + { + if ($this->joins) { + throw new PropelException('findOneOrCreate() cannot be used on a query with a join, because Propel cannot transform a SQL JOIN into a subquery. You should split the query in two queries to avoid joins.'); + } + if (!$ret = $this->findOne($con)) { + $class = MediumPeer::CLASSNAME_2; + $obj = new $class; + foreach ($this->keys() as $key) { + $obj->setByName($key, $this->getValue($key), BasePeer::TYPE_COLNAME); + } + $ret = $this->getFormatter()->formatRecord($obj); + } + + return $ret; + } + +} // BaseHorbuchQuery diff --git a/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseKrimiQuery.php b/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseKrimiQuery.php new file mode 100644 index 0000000..f671bd6 --- /dev/null +++ b/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseKrimiQuery.php @@ -0,0 +1,109 @@ +setModelAlias($modelAlias); + } + if ($criteria instanceof Criteria) { + $query->mergeWith($criteria); + } + + return $query; + } + + /** + * Filters the query to target only Krimi objects. + */ + public function preSelect(PropelPDO $con) + { + $this->addUsingAlias(MediumPeer::CLASS_KEY, MediumPeer::CLASSKEY_1); + } + + /** + * Filters the query to target only Krimi objects. + */ + public function preUpdate(&$values, PropelPDO $con, $forceIndividualSaves = false) + { + $this->addUsingAlias(MediumPeer::CLASS_KEY, MediumPeer::CLASSKEY_1); + } + + /** + * Filters the query to target only Krimi objects. + */ + public function preDelete(PropelPDO $con) + { + $this->addUsingAlias(MediumPeer::CLASS_KEY, MediumPeer::CLASSKEY_1); + } + + /** + * Issue a DELETE query based on the current ModelCriteria deleting all rows in the table + * Having the Krimi class. + * This method is called by ModelCriteria::deleteAll() inside a transaction + * + * @param PropelPDO $con a connection object + * + * @return integer the number of deleted rows + */ + public function doDeleteAll($con) + { + // condition on class key is already added in preDelete() + return parent::doDelete($con); + } + + + /** + * Issue a SELECT ... LIMIT 1 query based on the current ModelCriteria + * and format the result with the current formatter + * By default, returns a model object + * + * @param PropelPDO $con an optional connection object + * + * @return mixed the result, formatted by the current formatter + * + * @throws PropelException + */ + public function findOneOrCreate($con = null) + { + if ($this->joins) { + throw new PropelException('findOneOrCreate() cannot be used on a query with a join, because Propel cannot transform a SQL JOIN into a subquery. You should split the query in two queries to avoid joins.'); + } + if (!$ret = $this->findOne($con)) { + $class = MediumPeer::CLASSNAME_1; + $obj = new $class; + foreach ($this->keys() as $key) { + $obj->setByName($key, $this->getValue($key), BasePeer::TYPE_COLNAME); + } + $ret = $this->getFormatter()->formatRecord($obj); + } + + return $ret; + } + +} // BaseKrimiQuery diff --git a/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseMedium.php b/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseMedium.php new file mode 100644 index 0000000..9b5fe47 --- /dev/null +++ b/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseMedium.php @@ -0,0 +1,1161 @@ +id; + } + + /** + * Get the [mod] column value. + * + * @return int + */ + public function getMod() + { + + return $this->mod; + } + + /** + * Get the [autor] column value. + * + * @return string + */ + public function getAutor() + { + + return $this->autor; + } + + /** + * Get the [titel] column value. + * + * @return string + */ + public function getTitel() + { + + return $this->titel; + } + + /** + * Get the [eigentumer] column value. + * + * @return string + */ + public function getEigentumer() + { + + return $this->eigentumer; + } + + /** + * Get the [zz_bei] column value. + * + * @return string + */ + public function getZzBei() + { + + return $this->zz_bei; + } + + /** + * Get the [kommentar] column value. + * + * @return string + */ + public function getKommentar() + { + + return $this->kommentar; + } + + /** + * Get the [class_key] column value. + * + * @return int + */ + public function getClassKey() + { + + return $this->class_key; + } + + /** + * Set the value of [id] column. + * + * @param int $v new value + * @return Medium The current object (for fluent API support) + */ + public function setId($v) + { + if ($v !== null && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->id !== $v) { + $this->id = $v; + $this->modifiedColumns[] = MediumPeer::ID; + } + + + return $this; + } // setId() + + /** + * Set the value of [mod] column. + * + * @param int $v new value + * @return Medium The current object (for fluent API support) + */ + public function setMod($v) + { + if ($v !== null && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->mod !== $v) { + $this->mod = $v; + $this->modifiedColumns[] = MediumPeer::MOD; + } + + + return $this; + } // setMod() + + /** + * Set the value of [autor] column. + * + * @param string $v new value + * @return Medium The current object (for fluent API support) + */ + public function setAutor($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->autor !== $v) { + $this->autor = $v; + $this->modifiedColumns[] = MediumPeer::AUTOR; + } + + + return $this; + } // setAutor() + + /** + * Set the value of [titel] column. + * + * @param string $v new value + * @return Medium The current object (for fluent API support) + */ + public function setTitel($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->titel !== $v) { + $this->titel = $v; + $this->modifiedColumns[] = MediumPeer::TITEL; + } + + + return $this; + } // setTitel() + + /** + * Set the value of [eigentumer] column. + * + * @param string $v new value + * @return Medium The current object (for fluent API support) + */ + public function setEigentumer($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->eigentumer !== $v) { + $this->eigentumer = $v; + $this->modifiedColumns[] = MediumPeer::EIGENTUMER; + } + + + return $this; + } // setEigentumer() + + /** + * Set the value of [zz_bei] column. + * + * @param string $v new value + * @return Medium The current object (for fluent API support) + */ + public function setZzBei($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->zz_bei !== $v) { + $this->zz_bei = $v; + $this->modifiedColumns[] = MediumPeer::ZZ_BEI; + } + + + return $this; + } // setZzBei() + + /** + * Set the value of [kommentar] column. + * + * @param string $v new value + * @return Medium The current object (for fluent API support) + */ + public function setKommentar($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->kommentar !== $v) { + $this->kommentar = $v; + $this->modifiedColumns[] = MediumPeer::KOMMENTAR; + } + + + return $this; + } // setKommentar() + + /** + * Set the value of [class_key] column. + * + * @param int $v new value + * @return Medium The current object (for fluent API support) + */ + public function setClassKey($v) + { + if ($v !== null && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->class_key !== $v) { + $this->class_key = $v; + $this->modifiedColumns[] = MediumPeer::CLASS_KEY; + } + + + return $this; + } // setClassKey() + + /** + * Indicates whether the columns in this object are only set to default values. + * + * This method can be used in conjunction with isModified() to indicate whether an object is both + * modified _and_ has some values set which are non-default. + * + * @return boolean Whether the columns in this object are only been set with default values. + */ + public function hasOnlyDefaultValues() + { + // otherwise, everything was equal, so return true + return true; + } // hasOnlyDefaultValues() + + /** + * Hydrates (populates) the object variables with values from the database resultset. + * + * An offset (0-based "start column") is specified so that objects can be hydrated + * with a subset of the columns in the resultset rows. This is needed, for example, + * for results of JOIN queries where the resultset row includes columns from two or + * more tables. + * + * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) + * @param int $startcol 0-based offset column which indicates which resultset column to start with. + * @param boolean $rehydrate Whether this object is being re-hydrated from the database. + * @return int next starting column + * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. + */ + public function hydrate($row, $startcol = 0, $rehydrate = false) + { + try { + + $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; + $this->mod = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; + $this->autor = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; + $this->titel = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; + $this->eigentumer = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; + $this->zz_bei = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; + $this->kommentar = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; + $this->class_key = ($row[$startcol + 7] !== null) ? (int) $row[$startcol + 7] : null; + $this->resetModified(); + + $this->setNew(false); + + if ($rehydrate) { + $this->ensureConsistency(); + } + $this->postHydrate($row, $startcol, $rehydrate); + + return $startcol + 8; // 8 = MediumPeer::NUM_HYDRATE_COLUMNS. + + } catch (Exception $e) { + throw new PropelException("Error populating Medium object", $e); + } + } + + /** + * Checks and repairs the internal consistency of the object. + * + * This method is executed after an already-instantiated object is re-hydrated + * from the database. It exists to check any foreign keys to make sure that + * the objects related to the current object are correct based on foreign key. + * + * You can override this method in the stub class, but you should always invoke + * the base method from the overridden method (i.e. parent::ensureConsistency()), + * in case your model changes. + * + * @throws PropelException + */ + public function ensureConsistency() + { + + } // ensureConsistency + + /** + * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. + * + * This will only work if the object has been saved and has a valid primary key set. + * + * @param boolean $deep (optional) Whether to also de-associated any related objects. + * @param PropelPDO $con (optional) The PropelPDO connection to use. + * @return void + * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db + */ + public function reload($deep = false, PropelPDO $con = null) + { + if ($this->isDeleted()) { + throw new PropelException("Cannot reload a deleted object."); + } + + if ($this->isNew()) { + throw new PropelException("Cannot reload an unsaved object."); + } + + if ($con === null) { + $con = Propel::getConnection(MediumPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + // We don't need to alter the object instance pool; we're just modifying this instance + // already in the pool. + + $stmt = MediumPeer::doSelectStmt($this->buildPkeyCriteria(), $con); + $row = $stmt->fetch(PDO::FETCH_NUM); + $stmt->closeCursor(); + if (!$row) { + throw new PropelException('Cannot find matching row in the database to reload object values.'); + } + $this->hydrate($row, 0, true); // rehydrate + + if ($deep) { // also de-associate any related objects? + + } // if (deep) + } + + /** + * Removes this object from datastore and sets delete attribute. + * + * @param PropelPDO $con + * @return void + * @throws PropelException + * @throws Exception + * @see BaseObject::setDeleted() + * @see BaseObject::isDeleted() + */ + public function delete(PropelPDO $con = null) + { + if ($this->isDeleted()) { + throw new PropelException("This object has already been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(MediumPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + + $con->beginTransaction(); + try { + $deleteQuery = MediumQuery::create() + ->filterByPrimaryKey($this->getPrimaryKey()); + $ret = $this->preDelete($con); + if ($ret) { + $deleteQuery->delete($con); + $this->postDelete($con); + $con->commit(); + $this->setDeleted(true); + } else { + $con->commit(); + } + } catch (Exception $e) { + $con->rollBack(); + throw $e; + } + } + + /** + * Persists this object to the database. + * + * If the object is new, it inserts it; otherwise an update is performed. + * All modified related objects will also be persisted in the doSave() + * method. This method wraps all precipitate database operations in a + * single transaction. + * + * @param PropelPDO $con + * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. + * @throws PropelException + * @throws Exception + * @see doSave() + */ + public function save(PropelPDO $con = null) + { + if ($this->isDeleted()) { + throw new PropelException("You cannot save an object that has been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(MediumPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + + $con->beginTransaction(); + $isInsert = $this->isNew(); + try { + $ret = $this->preSave($con); + if ($isInsert) { + $ret = $ret && $this->preInsert($con); + } else { + $ret = $ret && $this->preUpdate($con); + } + if ($ret) { + $affectedRows = $this->doSave($con); + if ($isInsert) { + $this->postInsert($con); + } else { + $this->postUpdate($con); + } + $this->postSave($con); + MediumPeer::addInstanceToPool($this); + } else { + $affectedRows = 0; + } + $con->commit(); + + return $affectedRows; + } catch (Exception $e) { + $con->rollBack(); + throw $e; + } + } + + /** + * Performs the work of inserting or updating the row in the database. + * + * If the object is new, it inserts it; otherwise an update is performed. + * All related objects are also updated in this method. + * + * @param PropelPDO $con + * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. + * @throws PropelException + * @see save() + */ + protected function doSave(PropelPDO $con) + { + $affectedRows = 0; // initialize var to track total num of affected rows + if (!$this->alreadyInSave) { + $this->alreadyInSave = true; + + if ($this->isNew() || $this->isModified()) { + // persist changes + if ($this->isNew()) { + $this->doInsert($con); + } else { + $this->doUpdate($con); + } + $affectedRows += 1; + $this->resetModified(); + } + + $this->alreadyInSave = false; + + } + + return $affectedRows; + } // doSave() + + /** + * Insert the row in the database. + * + * @param PropelPDO $con + * + * @throws PropelException + * @see doSave() + */ + protected function doInsert(PropelPDO $con) + { + $modifiedColumns = array(); + $index = 0; + + $this->modifiedColumns[] = MediumPeer::ID; + if (null !== $this->id) { + throw new PropelException('Cannot insert a value for auto-increment primary key (' . MediumPeer::ID . ')'); + } + + // check the columns in natural order for more readable SQL queries + if ($this->isColumnModified(MediumPeer::ID)) { + $modifiedColumns[':p' . $index++] = '`id`'; + } + if ($this->isColumnModified(MediumPeer::MOD)) { + $modifiedColumns[':p' . $index++] = '`mod`'; + } + if ($this->isColumnModified(MediumPeer::AUTOR)) { + $modifiedColumns[':p' . $index++] = '`autor`'; + } + if ($this->isColumnModified(MediumPeer::TITEL)) { + $modifiedColumns[':p' . $index++] = '`titel`'; + } + if ($this->isColumnModified(MediumPeer::EIGENTUMER)) { + $modifiedColumns[':p' . $index++] = '`eigentumer`'; + } + if ($this->isColumnModified(MediumPeer::ZZ_BEI)) { + $modifiedColumns[':p' . $index++] = '`zz_bei`'; + } + if ($this->isColumnModified(MediumPeer::KOMMENTAR)) { + $modifiedColumns[':p' . $index++] = '`kommentar`'; + } + if ($this->isColumnModified(MediumPeer::CLASS_KEY)) { + $modifiedColumns[':p' . $index++] = '`class_key`'; + } + + $sql = sprintf( + 'INSERT INTO `medium` (%s) VALUES (%s)', + implode(', ', $modifiedColumns), + implode(', ', array_keys($modifiedColumns)) + ); + + try { + $stmt = $con->prepare($sql); + foreach ($modifiedColumns as $identifier => $columnName) { + switch ($columnName) { + case '`id`': + $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); + break; + case '`mod`': + $stmt->bindValue($identifier, $this->mod, PDO::PARAM_INT); + break; + case '`autor`': + $stmt->bindValue($identifier, $this->autor, PDO::PARAM_STR); + break; + case '`titel`': + $stmt->bindValue($identifier, $this->titel, PDO::PARAM_STR); + break; + case '`eigentumer`': + $stmt->bindValue($identifier, $this->eigentumer, PDO::PARAM_STR); + break; + case '`zz_bei`': + $stmt->bindValue($identifier, $this->zz_bei, PDO::PARAM_STR); + break; + case '`kommentar`': + $stmt->bindValue($identifier, $this->kommentar, PDO::PARAM_STR); + break; + case '`class_key`': + $stmt->bindValue($identifier, $this->class_key, PDO::PARAM_INT); + break; + } + } + $stmt->execute(); + } catch (Exception $e) { + Propel::log($e->getMessage(), Propel::LOG_ERR); + throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e); + } + + try { + $pk = $con->lastInsertId(); + } catch (Exception $e) { + throw new PropelException('Unable to get autoincrement id.', $e); + } + $this->setId($pk); + + $this->setNew(false); + } + + /** + * Update the row in the database. + * + * @param PropelPDO $con + * + * @see doSave() + */ + protected function doUpdate(PropelPDO $con) + { + $selectCriteria = $this->buildPkeyCriteria(); + $valuesCriteria = $this->buildCriteria(); + BasePeer::doUpdate($selectCriteria, $valuesCriteria, $con); + } + + /** + * Array of ValidationFailed objects. + * @var array ValidationFailed[] + */ + protected $validationFailures = array(); + + /** + * Gets any ValidationFailed objects that resulted from last call to validate(). + * + * + * @return array ValidationFailed[] + * @see validate() + */ + public function getValidationFailures() + { + return $this->validationFailures; + } + + /** + * Validates the objects modified field values and all objects related to this table. + * + * If $columns is either a column name or an array of column names + * only those columns are validated. + * + * @param mixed $columns Column name or an array of column names. + * @return boolean Whether all columns pass validation. + * @see doValidate() + * @see getValidationFailures() + */ + public function validate($columns = null) + { + $res = $this->doValidate($columns); + if ($res === true) { + $this->validationFailures = array(); + + return true; + } + + $this->validationFailures = $res; + + return false; + } + + /** + * This function performs the validation work for complex object models. + * + * In addition to checking the current object, all related objects will + * also be validated. If all pass then true is returned; otherwise + * an aggregated array of ValidationFailed objects will be returned. + * + * @param array $columns Array of column names to validate. + * @return mixed true if all validations pass; array of ValidationFailed objects otherwise. + */ + protected function doValidate($columns = null) + { + if (!$this->alreadyInValidation) { + $this->alreadyInValidation = true; + $retval = null; + + $failureMap = array(); + + + if (($retval = MediumPeer::doValidate($this, $columns)) !== true) { + $failureMap = array_merge($failureMap, $retval); + } + + + + $this->alreadyInValidation = false; + } + + return (!empty($failureMap) ? $failureMap : true); + } + + /** + * Retrieves a field from the object by name passed in as a string. + * + * @param string $name name + * @param string $type The type of fieldname the $name is of: + * 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 + * @return mixed Value of field. + */ + public function getByName($name, $type = BasePeer::TYPE_PHPNAME) + { + $pos = MediumPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + $field = $this->getByPosition($pos); + + return $field; + } + + /** + * Retrieves a field from the object by Position as specified in the xml schema. + * Zero-based. + * + * @param int $pos position in xml schema + * @return mixed Value of field at $pos + */ + public function getByPosition($pos) + { + switch ($pos) { + case 0: + return $this->getId(); + break; + case 1: + return $this->getMod(); + break; + case 2: + return $this->getAutor(); + break; + case 3: + return $this->getTitel(); + break; + case 4: + return $this->getEigentumer(); + break; + case 5: + return $this->getZzBei(); + break; + case 6: + return $this->getKommentar(); + break; + case 7: + return $this->getClassKey(); + break; + default: + return null; + break; + } // switch() + } + + /** + * 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 + * + * @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()) + { + if (isset($alreadyDumpedObjects['Medium'][$this->getPrimaryKey()])) { + return '*RECURSION*'; + } + $alreadyDumpedObjects['Medium'][$this->getPrimaryKey()] = true; + $keys = MediumPeer::getFieldNames($keyType); + $result = array( + $keys[0] => $this->getId(), + $keys[1] => $this->getMod(), + $keys[2] => $this->getAutor(), + $keys[3] => $this->getTitel(), + $keys[4] => $this->getEigentumer(), + $keys[5] => $this->getZzBei(), + $keys[6] => $this->getKommentar(), + $keys[7] => $this->getClassKey(), + ); + $virtualColumns = $this->virtualColumns; + foreach ($virtualColumns as $key => $virtualColumn) { + $result[$key] = $virtualColumn; + } + + + return $result; + } + + /** + * Sets a field from the object by name passed in as a string. + * + * @param string $name peer name + * @param mixed $value field value + * @param string $type The type of fieldname the $name is of: + * 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 + * @return void + */ + public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) + { + $pos = MediumPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + + $this->setByPosition($pos, $value); + } + + /** + * Sets a field from the object by Position as specified in the xml schema. + * Zero-based. + * + * @param int $pos position in xml schema + * @param mixed $value field value + * @return void + */ + public function setByPosition($pos, $value) + { + switch ($pos) { + case 0: + $this->setId($value); + break; + case 1: + $this->setMod($value); + break; + case 2: + $this->setAutor($value); + break; + case 3: + $this->setTitel($value); + break; + case 4: + $this->setEigentumer($value); + break; + case 5: + $this->setZzBei($value); + break; + case 6: + $this->setKommentar($value); + break; + case 7: + $this->setClassKey($value); + break; + } // switch() + } + + /** + * Populates the object using an array. + * + * This is particularly useful when populating an object from one of the + * request arrays (e.g. $_POST). This method goes through the column + * names, checking to see whether a matching key exists in populated + * array. If so the setByName() method is called for that column. + * + * You can specify the key type of the array by additionally passing one + * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, + * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. + * The default key type is the column's BasePeer::TYPE_PHPNAME + * + * @param array $arr An array to populate the object from. + * @param string $keyType The type of keys the array uses. + * @return void + */ + public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) + { + $keys = MediumPeer::getFieldNames($keyType); + + if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); + if (array_key_exists($keys[1], $arr)) $this->setMod($arr[$keys[1]]); + if (array_key_exists($keys[2], $arr)) $this->setAutor($arr[$keys[2]]); + if (array_key_exists($keys[3], $arr)) $this->setTitel($arr[$keys[3]]); + if (array_key_exists($keys[4], $arr)) $this->setEigentumer($arr[$keys[4]]); + if (array_key_exists($keys[5], $arr)) $this->setZzBei($arr[$keys[5]]); + if (array_key_exists($keys[6], $arr)) $this->setKommentar($arr[$keys[6]]); + if (array_key_exists($keys[7], $arr)) $this->setClassKey($arr[$keys[7]]); + } + + /** + * Build a Criteria object containing the values of all modified columns in this object. + * + * @return Criteria The Criteria object containing all modified values. + */ + public function buildCriteria() + { + $criteria = new Criteria(MediumPeer::DATABASE_NAME); + + if ($this->isColumnModified(MediumPeer::ID)) $criteria->add(MediumPeer::ID, $this->id); + if ($this->isColumnModified(MediumPeer::MOD)) $criteria->add(MediumPeer::MOD, $this->mod); + if ($this->isColumnModified(MediumPeer::AUTOR)) $criteria->add(MediumPeer::AUTOR, $this->autor); + if ($this->isColumnModified(MediumPeer::TITEL)) $criteria->add(MediumPeer::TITEL, $this->titel); + if ($this->isColumnModified(MediumPeer::EIGENTUMER)) $criteria->add(MediumPeer::EIGENTUMER, $this->eigentumer); + if ($this->isColumnModified(MediumPeer::ZZ_BEI)) $criteria->add(MediumPeer::ZZ_BEI, $this->zz_bei); + if ($this->isColumnModified(MediumPeer::KOMMENTAR)) $criteria->add(MediumPeer::KOMMENTAR, $this->kommentar); + if ($this->isColumnModified(MediumPeer::CLASS_KEY)) $criteria->add(MediumPeer::CLASS_KEY, $this->class_key); + + return $criteria; + } + + /** + * Builds a Criteria object containing the primary key for this object. + * + * Unlike buildCriteria() this method includes the primary key values regardless + * of whether or not they have been modified. + * + * @return Criteria The Criteria object containing value(s) for primary key(s). + */ + public function buildPkeyCriteria() + { + $criteria = new Criteria(MediumPeer::DATABASE_NAME); + $criteria->add(MediumPeer::ID, $this->id); + + return $criteria; + } + + /** + * Returns the primary key for this object (row). + * @return int + */ + public function getPrimaryKey() + { + return $this->getId(); + } + + /** + * Generic method to set the primary key (id column). + * + * @param int $key Primary key. + * @return void + */ + public function setPrimaryKey($key) + { + $this->setId($key); + } + + /** + * Returns true if the primary key for this object is null. + * @return boolean + */ + public function isPrimaryKeyNull() + { + + return null === $this->getId(); + } + + /** + * Sets contents of passed object to values from current object. + * + * If desired, this method can also make copies of all associated (fkey referrers) + * objects. + * + * @param object $copyObj An object of Medium (or compatible) type. + * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. + * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new. + * @throws PropelException + */ + public function copyInto($copyObj, $deepCopy = false, $makeNew = true) + { + $copyObj->setMod($this->getMod()); + $copyObj->setAutor($this->getAutor()); + $copyObj->setTitel($this->getTitel()); + $copyObj->setEigentumer($this->getEigentumer()); + $copyObj->setZzBei($this->getZzBei()); + $copyObj->setKommentar($this->getKommentar()); + $copyObj->setClassKey($this->getClassKey()); + if ($makeNew) { + $copyObj->setNew(true); + $copyObj->setId(NULL); // this is a auto-increment column, so set to default value + } + } + + /** + * Makes a copy of this object that will be inserted as a new row in table when saved. + * It creates a new object filling in the simple attributes, but skipping any primary + * keys that are defined for the table. + * + * If desired, this method can also make copies of all associated (fkey referrers) + * objects. + * + * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. + * @return Medium Clone of current object. + * @throws PropelException + */ + public function copy($deepCopy = false) + { + // we use get_class(), because this might be a subclass + $clazz = get_class($this); + $copyObj = new $clazz(); + $this->copyInto($copyObj, $deepCopy); + + return $copyObj; + } + + /** + * Returns a peer instance associated with this om. + * + * Since Peer classes are not to have any instance attributes, this method returns the + * same instance for all member of this class. The method could therefore + * be static, but this would prevent one from overriding the behavior. + * + * @return MediumPeer + */ + public function getPeer() + { + if (self::$peer === null) { + self::$peer = new MediumPeer(); + } + + return self::$peer; + } + + /** + * Clears the current object and sets all attributes to their default values + */ + public function clear() + { + $this->id = null; + $this->mod = null; + $this->autor = null; + $this->titel = null; + $this->eigentumer = null; + $this->zz_bei = null; + $this->kommentar = null; + $this->class_key = null; + $this->alreadyInSave = false; + $this->alreadyInValidation = false; + $this->alreadyInClearAllReferencesDeep = false; + $this->clearAllReferences(); + $this->resetModified(); + $this->setNew(true); + $this->setDeleted(false); + } + + /** + * Resets all references to other model objects or collections of model objects. + * + * This method is a user-space workaround for PHP's inability to garbage collect + * objects with circular references (even in PHP 5.3). This is currently necessary + * when using Propel in certain daemon or large-volume/high-memory operations. + * + * @param boolean $deep Whether to also clear the references on all referrer objects. + */ + public function clearAllReferences($deep = false) + { + if ($deep && !$this->alreadyInClearAllReferencesDeep) { + $this->alreadyInClearAllReferencesDeep = true; + + $this->alreadyInClearAllReferencesDeep = false; + } // if ($deep) + + } + + /** + * return the string representation of this object + * + * @return string + */ + public function __toString() + { + return (string) $this->exportTo(MediumPeer::DEFAULT_STRING_FORMAT); + } + + /** + * return true is the object is in saving state + * + * @return boolean + */ + public function isAlreadyInSave() + { + return $this->alreadyInSave; + } + +} diff --git a/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseMediumPeer.php b/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseMediumPeer.php new file mode 100644 index 0000000..d9307e6 --- /dev/null +++ b/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseMediumPeer.php @@ -0,0 +1,850 @@ + array ('Id', 'Mod', 'Autor', 'Titel', 'Eigentumer', 'ZzBei', 'Kommentar', 'ClassKey', ), + BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'mod', 'autor', 'titel', 'eigentumer', 'zzBei', 'kommentar', 'classKey', ), + BasePeer::TYPE_COLNAME => array (MediumPeer::ID, MediumPeer::MOD, MediumPeer::AUTOR, MediumPeer::TITEL, MediumPeer::EIGENTUMER, MediumPeer::ZZ_BEI, MediumPeer::KOMMENTAR, MediumPeer::CLASS_KEY, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID', 'MOD', 'AUTOR', 'TITEL', 'EIGENTUMER', 'ZZ_BEI', 'KOMMENTAR', 'CLASS_KEY', ), + BasePeer::TYPE_FIELDNAME => array ('id', 'mod', 'autor', 'titel', 'eigentumer', 'zz_bei', 'kommentar', 'class_key', ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, ) + ); + + /** + * holds an array of keys for quick access to the fieldnames array + * + * first dimension keys are the type constants + * e.g. MediumPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 + */ + protected static $fieldKeys = array ( + BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Mod' => 1, 'Autor' => 2, 'Titel' => 3, 'Eigentumer' => 4, 'ZzBei' => 5, 'Kommentar' => 6, 'ClassKey' => 7, ), + BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'mod' => 1, 'autor' => 2, 'titel' => 3, 'eigentumer' => 4, 'zzBei' => 5, 'kommentar' => 6, 'classKey' => 7, ), + BasePeer::TYPE_COLNAME => array (MediumPeer::ID => 0, MediumPeer::MOD => 1, MediumPeer::AUTOR => 2, MediumPeer::TITEL => 3, MediumPeer::EIGENTUMER => 4, MediumPeer::ZZ_BEI => 5, MediumPeer::KOMMENTAR => 6, MediumPeer::CLASS_KEY => 7, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'MOD' => 1, 'AUTOR' => 2, 'TITEL' => 3, 'EIGENTUMER' => 4, 'ZZ_BEI' => 5, 'KOMMENTAR' => 6, 'CLASS_KEY' => 7, ), + BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'mod' => 1, 'autor' => 2, 'titel' => 3, 'eigentumer' => 4, 'zz_bei' => 5, 'kommentar' => 6, 'class_key' => 7, ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, ) + ); + + /** + * Translates a fieldname to another type + * + * @param string $name field name + * @param string $fromType One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME + * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM + * @param string $toType One of the class type constants + * @return string translated name of the field. + * @throws PropelException - if the specified name could not be found in the fieldname mappings. + */ + public static function translateFieldName($name, $fromType, $toType) + { + $toNames = MediumPeer::getFieldNames($toType); + $key = isset(MediumPeer::$fieldKeys[$fromType][$name]) ? MediumPeer::$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(MediumPeer::$fieldKeys[$fromType], true)); + } + + return $toNames[$key]; + } + + /** + * Returns an array of field names. + * + * @param string $type The type of fieldnames to return: + * One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME + * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM + * @return array A list of field names + * @throws PropelException - if the type is not valid. + */ + public static function getFieldNames($type = BasePeer::TYPE_PHPNAME) + { + if (!array_key_exists($type, MediumPeer::$fieldNames)) { + throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. ' . $type . ' was given.'); + } + + return MediumPeer::$fieldNames[$type]; + } + + /** + * Convenience method which changes table.column to alias.column. + * + * Using this method you can maintain SQL abstraction while using column aliases. + * + * $c->addAlias("alias1", TablePeer::TABLE_NAME); + * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); + * + * @param string $alias The alias for the current table. + * @param string $column The column name for current table. (i.e. MediumPeer::COLUMN_NAME). + * @return string + */ + public static function alias($alias, $column) + { + return str_replace(MediumPeer::TABLE_NAME.'.', $alias.'.', $column); + } + + /** + * Add all the columns needed to create a new object. + * + * Note: any columns that were marked with lazyLoad="true" in the + * XML schema will not be added to the select list and only loaded + * on demand. + * + * @param Criteria $criteria object containing the columns to add. + * @param string $alias optional table alias + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function addSelectColumns(Criteria $criteria, $alias = null) + { + if (null === $alias) { + $criteria->addSelectColumn(MediumPeer::ID); + $criteria->addSelectColumn(MediumPeer::MOD); + $criteria->addSelectColumn(MediumPeer::AUTOR); + $criteria->addSelectColumn(MediumPeer::TITEL); + $criteria->addSelectColumn(MediumPeer::EIGENTUMER); + $criteria->addSelectColumn(MediumPeer::ZZ_BEI); + $criteria->addSelectColumn(MediumPeer::KOMMENTAR); + $criteria->addSelectColumn(MediumPeer::CLASS_KEY); + } else { + $criteria->addSelectColumn($alias . '.id'); + $criteria->addSelectColumn($alias . '.mod'); + $criteria->addSelectColumn($alias . '.autor'); + $criteria->addSelectColumn($alias . '.titel'); + $criteria->addSelectColumn($alias . '.eigentumer'); + $criteria->addSelectColumn($alias . '.zz_bei'); + $criteria->addSelectColumn($alias . '.kommentar'); + $criteria->addSelectColumn($alias . '.class_key'); + } + } + + /** + * Returns the number of rows matching criteria. + * + * @param Criteria $criteria + * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead. + * @param PropelPDO $con + * @return int Number of matching rows. + */ + public static function doCount(Criteria $criteria, $distinct = false, PropelPDO $con = null) + { + // we may modify criteria, so copy it first + $criteria = clone $criteria; + + // We need to set the primary table name, since in the case that there are no WHERE columns + // it will be impossible for the BasePeer::createSelectSql() method to determine which + // tables go into the FROM clause. + $criteria->setPrimaryTableName(MediumPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + MediumPeer::addSelectColumns($criteria); + } + + $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count + $criteria->setDbName(MediumPeer::DATABASE_NAME); // Set the correct dbName + + if ($con === null) { + $con = Propel::getConnection(MediumPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + // BasePeer returns a PDOStatement + $stmt = BasePeer::doCount($criteria, $con); + + if ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $count = (int) $row[0]; + } else { + $count = 0; // no rows returned; we infer that means 0 matches. + } + $stmt->closeCursor(); + + return $count; + } + /** + * Selects one object from the DB. + * + * @param Criteria $criteria object used to create the SELECT statement. + * @param PropelPDO $con + * @return Medium + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectOne(Criteria $criteria, PropelPDO $con = null) + { + $critcopy = clone $criteria; + $critcopy->setLimit(1); + $objects = MediumPeer::doSelect($critcopy, $con); + if ($objects) { + return $objects[0]; + } + + return null; + } + /** + * Selects several row from the DB. + * + * @param Criteria $criteria The Criteria object used to build the SELECT statement. + * @param PropelPDO $con + * @return array Array of selected Objects + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelect(Criteria $criteria, PropelPDO $con = null) + { + return MediumPeer::populateObjects(MediumPeer::doSelectStmt($criteria, $con)); + } + /** + * Prepares the Criteria object and uses the parent doSelect() method to execute a PDOStatement. + * + * Use this method directly if you want to work with an executed statement directly (for example + * to perform your own object hydration). + * + * @param Criteria $criteria The Criteria object used to build the SELECT statement. + * @param PropelPDO $con The connection to use + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + * @return PDOStatement The executed PDOStatement object. + * @see BasePeer::doSelect() + */ + public static function doSelectStmt(Criteria $criteria, PropelPDO $con = null) + { + if ($con === null) { + $con = Propel::getConnection(MediumPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + if (!$criteria->hasSelectClause()) { + $criteria = clone $criteria; + MediumPeer::addSelectColumns($criteria); + } + + // Set the correct dbName + $criteria->setDbName(MediumPeer::DATABASE_NAME); + + // BasePeer returns a PDOStatement + return BasePeer::doSelect($criteria, $con); + } + /** + * Adds an object to the instance pool. + * + * Propel keeps cached copies of objects in an instance pool when they are retrieved + * from the database. In some cases -- especially when you override doSelect*() + * methods in your stub classes -- you may need to explicitly add objects + * to the cache in order to ensure that the same objects are always returned by doSelect*() + * and retrieveByPK*() calls. + * + * @param Medium $obj A Medium object. + * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). + */ + public static function addInstanceToPool($obj, $key = null) + { + if (Propel::isInstancePoolingEnabled()) { + if ($key === null) { + $key = (string) $obj->getId(); + } // if key === null + MediumPeer::$instances[$key] = $obj; + } + } + + /** + * Removes an object from the instance pool. + * + * Propel keeps cached copies of objects in an instance pool when they are retrieved + * from the database. In some cases -- especially when you override doDelete + * methods in your stub classes -- you may need to explicitly remove objects + * from the cache in order to prevent returning objects that no longer exist. + * + * @param mixed $value A Medium object or a primary key value. + * + * @return void + * @throws PropelException - if the value is invalid. + */ + public static function removeInstanceFromPool($value) + { + if (Propel::isInstancePoolingEnabled() && $value !== null) { + if (is_object($value) && $value instanceof Medium) { + $key = (string) $value->getId(); + } elseif (is_scalar($value)) { + // assume we've been passed a primary key + $key = (string) $value; + } else { + $e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or Medium object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value,true))); + throw $e; + } + + unset(MediumPeer::$instances[$key]); + } + } // removeInstanceFromPool() + + /** + * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table. + * + * For tables with a single-column primary key, that simple pkey value will be returned. For tables with + * a multi-column primary key, a serialize()d version of the primary key will be returned. + * + * @param string $key The key (@see getPrimaryKeyHash()) for this instance. + * @return Medium Found object or null if 1) no instance exists for specified key or 2) instance pooling has been disabled. + * @see getPrimaryKeyHash() + */ + public static function getInstanceFromPool($key) + { + if (Propel::isInstancePoolingEnabled()) { + if (isset(MediumPeer::$instances[$key])) { + return MediumPeer::$instances[$key]; + } + } + + return null; // just to be explicit + } + + /** + * Clear the instance pool. + * + * @return void + */ + public static function clearInstancePool($and_clear_all_references = false) + { + if ($and_clear_all_references) { + foreach (MediumPeer::$instances as $instance) { + $instance->clearAllReferences(true); + } + } + MediumPeer::$instances = array(); + } + + /** + * Method to invalidate the instance pool of all tables related to medium + * by a foreign key with ON DELETE CASCADE + */ + public static function clearRelatedInstancePool() + { + } + + /** + * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table. + * + * For tables with a single-column primary key, that simple pkey value will be returned. For tables with + * a multi-column primary key, a serialize()d version of the primary key will be returned. + * + * @param array $row PropelPDO resultset row. + * @param int $startcol The 0-based offset for reading from the resultset row. + * @return string A string version of PK or null if the components of primary key in result array are all null. + */ + public static function getPrimaryKeyHashFromRow($row, $startcol = 0) + { + // If the PK cannot be derived from the row, return null. + if ($row[$startcol] === null) { + return null; + } + + return (string) $row[$startcol]; + } + + /** + * Retrieves the primary key from the DB resultset row + * For tables with a single-column primary key, that simple pkey value will be returned. For tables with + * a multi-column primary key, an array of the primary key columns will be returned. + * + * @param array $row PropelPDO resultset row. + * @param int $startcol The 0-based offset for reading from the resultset row. + * @return mixed The primary key of the row + */ + public static function getPrimaryKeyFromRow($row, $startcol = 0) + { + + return (int) $row[$startcol]; + } + + /** + * The returned array will contain objects of the default type or + * objects that inherit from the default. + * + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function populateObjects(PDOStatement $stmt) + { + $results = array(); + + // populate the object(s) + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key = MediumPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj = MediumPeer::getInstanceFromPool($key))) { + // We no longer rehydrate the object, since this can cause data loss. + // See http://www.propelorm.org/ticket/509 + // $obj->hydrate($row, 0, true); // rehydrate + $results[] = $obj; + } else { + // class must be set each time from the record row + $cls = MediumPeer::getOMClass($row, 0); + $cls = substr('.'.$cls, strrpos('.'.$cls, '.') + 1); + $obj = new $cls(); + $obj->hydrate($row); + $results[] = $obj; + MediumPeer::addInstanceToPool($obj, $key); + } // if key exists + } + $stmt->closeCursor(); + + return $results; + } + /** + * Populates an object of the default type or an object that inherit from the default. + * + * @param array $row PropelPDO resultset row. + * @param int $startcol The 0-based offset for reading from the resultset row. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + * @return array (Medium object, last column rank) + */ + public static function populateObject($row, $startcol = 0) + { + $key = MediumPeer::getPrimaryKeyHashFromRow($row, $startcol); + if (null !== ($obj = MediumPeer::getInstanceFromPool($key))) { + // We no longer rehydrate the object, since this can cause data loss. + // See http://www.propelorm.org/ticket/509 + // $obj->hydrate($row, $startcol, true); // rehydrate + $col = $startcol + MediumPeer::NUM_HYDRATE_COLUMNS; + } else { + $cls = MediumPeer::getOMClass($row, $startcol); + $obj = new $cls(); + $col = $obj->hydrate($row, $startcol); + MediumPeer::addInstanceToPool($obj, $key); + } + + return array($obj, $col); + } + + /** + * Returns the TableMap related to this peer. + * This method is not needed for general use but a specific application could have a need. + * @return TableMap + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function getTableMap() + { + return Propel::getDatabaseMap(MediumPeer::DATABASE_NAME)->getTable(MediumPeer::TABLE_NAME); + } + + /** + * Add a TableMap instance to the database for this peer class. + */ + public static function buildTableMap() + { + $dbMap = Propel::getDatabaseMap(BaseMediumPeer::DATABASE_NAME); + if (!$dbMap->hasTable(BaseMediumPeer::TABLE_NAME)) { + $dbMap->addTableObject(new \MediumTableMap()); + } + } + + /** + * The returned Class will contain objects of the default type or + * objects that inherit from the default. + * + * @param array $row PropelPDO result row. + * @param int $colnum Column to examine for OM class information (first is 0). + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function getOMClass($row = 0, $colnum = 0) + { + try { + + $omClass = null; + $classKey = $row[$colnum + 7]; + + switch ($classKey) { + + case MediumPeer::CLASSKEY_1: + $omClass = MediumPeer::CLASSNAME_1; + break; + + case MediumPeer::CLASSKEY_2: + $omClass = MediumPeer::CLASSNAME_2; + break; + + case MediumPeer::CLASSKEY_3: + $omClass = MediumPeer::CLASSNAME_3; + break; + + default: + $omClass = MediumPeer::OM_CLASS; + + } // switch + + } catch (Exception $e) { + throw new PropelException('Unable to get OM class.', $e); + } + + return $omClass; + } + + /** + * Performs an INSERT on the database, given a Medium or Criteria object. + * + * @param mixed $values Criteria or Medium object containing data that is used to create the INSERT statement. + * @param PropelPDO $con the PropelPDO connection to use + * @return mixed The new primary key. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doInsert($values, PropelPDO $con = null) + { + if ($con === null) { + $con = Propel::getConnection(MediumPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; // rename for clarity + } else { + $criteria = $values->buildCriteria(); // build Criteria from Medium object + } + + if ($criteria->containsKey(MediumPeer::ID) && $criteria->keyContainsValue(MediumPeer::ID) ) { + throw new PropelException('Cannot insert a value for auto-increment primary key ('.MediumPeer::ID.')'); + } + + + // Set the correct dbName + $criteria->setDbName(MediumPeer::DATABASE_NAME); + + try { + // use transaction because $criteria could contain info + // for more than one table (I guess, conceivably) + $con->beginTransaction(); + $pk = BasePeer::doInsert($criteria, $con); + $con->commit(); + } catch (Exception $e) { + $con->rollBack(); + throw $e; + } + + return $pk; + } + + /** + * Performs an UPDATE on the database, given a Medium or Criteria object. + * + * @param mixed $values Criteria or Medium object containing data that is used to create the UPDATE statement. + * @param PropelPDO $con The connection to use (specify PropelPDO connection object to exert more control over transactions). + * @return int The number of affected rows (if supported by underlying database driver). + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doUpdate($values, PropelPDO $con = null) + { + if ($con === null) { + $con = Propel::getConnection(MediumPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + + $selectCriteria = new Criteria(MediumPeer::DATABASE_NAME); + + if ($values instanceof Criteria) { + $criteria = clone $values; // rename for clarity + + $comparison = $criteria->getComparison(MediumPeer::ID); + $value = $criteria->remove(MediumPeer::ID); + if ($value) { + $selectCriteria->add(MediumPeer::ID, $value, $comparison); + } else { + $selectCriteria->setPrimaryTableName(MediumPeer::TABLE_NAME); + } + + } else { // $values is Medium object + $criteria = $values->buildCriteria(); // gets full criteria + $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s) + } + + // set the correct dbName + $criteria->setDbName(MediumPeer::DATABASE_NAME); + + return BasePeer::doUpdate($selectCriteria, $criteria, $con); + } + + /** + * Deletes all rows from the medium table. + * + * @param PropelPDO $con the connection to use + * @return int The number of affected rows (if supported by underlying database driver). + * @throws PropelException + */ + public static function doDeleteAll(PropelPDO $con = null) + { + if ($con === null) { + $con = Propel::getConnection(MediumPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + $affectedRows = 0; // initialize var to track total num of affected rows + try { + // use transaction because $criteria could contain info + // for more than one table or we could emulating ON DELETE CASCADE, etc. + $con->beginTransaction(); + $affectedRows += BasePeer::doDeleteAll(MediumPeer::TABLE_NAME, $con, MediumPeer::DATABASE_NAME); + // Because this db requires some delete cascade/set null emulation, we have to + // clear the cached instance *after* the emulation has happened (since + // instances get re-added by the select statement contained therein). + MediumPeer::clearInstancePool(); + MediumPeer::clearRelatedInstancePool(); + $con->commit(); + + return $affectedRows; + } catch (Exception $e) { + $con->rollBack(); + throw $e; + } + } + + /** + * Performs a DELETE on the database, given a Medium or Criteria object OR a primary key value. + * + * @param mixed $values Criteria or Medium object or primary key or array of primary keys + * which is used to create the DELETE statement + * @param PropelPDO $con the connection to use + * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows + * if supported by native driver or if emulated using Propel. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doDelete($values, PropelPDO $con = null) + { + if ($con === null) { + $con = Propel::getConnection(MediumPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + + if ($values instanceof Criteria) { + // invalidate the cache for all objects of this type, since we have no + // way of knowing (without running a query) what objects should be invalidated + // from the cache based on this Criteria. + MediumPeer::clearInstancePool(); + // rename for clarity + $criteria = clone $values; + } elseif ($values instanceof Medium) { // it's a model object + // invalidate the cache for this single object + MediumPeer::removeInstanceFromPool($values); + // create criteria based on pk values + $criteria = $values->buildPkeyCriteria(); + } else { // it's a primary key, or an array of pks + $criteria = new Criteria(MediumPeer::DATABASE_NAME); + $criteria->add(MediumPeer::ID, (array) $values, Criteria::IN); + // invalidate the cache for this object(s) + foreach ((array) $values as $singleval) { + MediumPeer::removeInstanceFromPool($singleval); + } + } + + // Set the correct dbName + $criteria->setDbName(MediumPeer::DATABASE_NAME); + + $affectedRows = 0; // initialize var to track total num of affected rows + + try { + // use transaction because $criteria could contain info + // for more than one table or we could emulating ON DELETE CASCADE, etc. + $con->beginTransaction(); + + $affectedRows += BasePeer::doDelete($criteria, $con); + MediumPeer::clearRelatedInstancePool(); + $con->commit(); + + return $affectedRows; + } catch (Exception $e) { + $con->rollBack(); + throw $e; + } + } + + /** + * Validates all modified columns of given Medium object. + * If parameter $columns is either a single column name or an array of column names + * than only those columns are validated. + * + * NOTICE: This does not apply to primary or foreign keys for now. + * + * @param Medium $obj The object to validate. + * @param mixed $cols Column name or array of column names. + * + * @return mixed TRUE if all columns are valid or the error message of the first invalid column. + */ + public static function doValidate($obj, $cols = null) + { + $columns = array(); + + if ($cols) { + $dbMap = Propel::getDatabaseMap(MediumPeer::DATABASE_NAME); + $tableMap = $dbMap->getTable(MediumPeer::TABLE_NAME); + + if (! is_array($cols)) { + $cols = array($cols); + } + + foreach ($cols as $colName) { + if ($tableMap->hasColumn($colName)) { + $get = 'get' . $tableMap->getColumn($colName)->getPhpName(); + $columns[$colName] = $obj->$get(); + } + } + } else { + + } + + return BasePeer::doValidate(MediumPeer::DATABASE_NAME, MediumPeer::TABLE_NAME, $columns); + } + + /** + * Retrieve a single object by pkey. + * + * @param int $pk the primary key. + * @param PropelPDO $con the connection to use + * @return Medium + */ + public static function retrieveByPK($pk, PropelPDO $con = null) + { + + if (null !== ($obj = MediumPeer::getInstanceFromPool((string) $pk))) { + return $obj; + } + + if ($con === null) { + $con = Propel::getConnection(MediumPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria = new Criteria(MediumPeer::DATABASE_NAME); + $criteria->add(MediumPeer::ID, $pk); + + $v = MediumPeer::doSelect($criteria, $con); + + return !empty($v) > 0 ? $v[0] : null; + } + + /** + * Retrieve multiple objects by pkey. + * + * @param array $pks List of primary keys + * @param PropelPDO $con the connection to use + * @return Medium[] + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function retrieveByPKs($pks, PropelPDO $con = null) + { + if ($con === null) { + $con = Propel::getConnection(MediumPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $objs = null; + if (empty($pks)) { + $objs = array(); + } else { + $criteria = new Criteria(MediumPeer::DATABASE_NAME); + $criteria->add(MediumPeer::ID, $pks, Criteria::IN); + $objs = MediumPeer::doSelect($criteria, $con); + } + + return $objs; + } + +} // BaseMediumPeer + +// This is the static code needed to register the TableMap for this table with the main Propel class. +// +BaseMediumPeer::buildTableMap(); + diff --git a/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseMediumQuery.php b/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseMediumQuery.php new file mode 100644 index 0000000..280bc97 --- /dev/null +++ b/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseMediumQuery.php @@ -0,0 +1,534 @@ +mergeWith($criteria); + } + + return $query; + } + + /** + * Find object by primary key. + * Propel uses the instance pool to skip the database if the object exists. + * Go fast if the query is untouched. + * + * + * $obj = $c->findPk(12, $con); + * + * + * @param mixed $key Primary key to use for the query + * @param PropelPDO $con an optional connection object + * + * @return Medium|Medium[]|mixed the result, formatted by the current formatter + */ + public function findPk($key, $con = null) + { + if ($key === null) { + return null; + } + if ((null !== ($obj = MediumPeer::getInstanceFromPool((string) $key))) && !$this->formatter) { + // the object is already in the instance pool + return $obj; + } + if ($con === null) { + $con = Propel::getConnection(MediumPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + $this->basePreSelect($con); + if ($this->formatter || $this->modelAlias || $this->with || $this->select + || $this->selectColumns || $this->asColumns || $this->selectModifiers + || $this->map || $this->having || $this->joins) { + return $this->findPkComplex($key, $con); + } else { + return $this->findPkSimple($key, $con); + } + } + + /** + * Alias of findPk to use instance pooling + * + * @param mixed $key Primary key to use for the query + * @param PropelPDO $con A connection object + * + * @return Medium A model object, or null if the key is not found + * @throws PropelException + */ + public function findOneById($key, $con = null) + { + return $this->findPk($key, $con); + } + + /** + * Find object by primary key using raw SQL to go fast. + * Bypass doSelect() and the object formatter by using generated code. + * + * @param mixed $key Primary key to use for the query + * @param PropelPDO $con A connection object + * + * @return Medium A model object, or null if the key is not found + * @throws PropelException + */ + protected function findPkSimple($key, $con) + { + $sql = 'SELECT `id`, `mod`, `autor`, `titel`, `eigentumer`, `zz_bei`, `kommentar`, `class_key` FROM `medium` WHERE `id` = :p0'; + try { + $stmt = $con->prepare($sql); + $stmt->bindValue(':p0', $key, PDO::PARAM_INT); + $stmt->execute(); + } catch (Exception $e) { + Propel::log($e->getMessage(), Propel::LOG_ERR); + throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e); + } + $obj = null; + if ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $cls = MediumPeer::getOMClass($row, 0); + $obj = new $cls(); + $obj->hydrate($row); + MediumPeer::addInstanceToPool($obj, (string) $key); + } + $stmt->closeCursor(); + + return $obj; + } + + /** + * Find object by primary key. + * + * @param mixed $key Primary key to use for the query + * @param PropelPDO $con A connection object + * + * @return Medium|Medium[]|mixed the result, formatted by the current formatter + */ + protected function findPkComplex($key, $con) + { + // As the query uses a PK condition, no limit(1) is necessary. + $criteria = $this->isKeepQuery() ? clone $this : $this; + $stmt = $criteria + ->filterByPrimaryKey($key) + ->doSelect($con); + + return $criteria->getFormatter()->init($criteria)->formatOne($stmt); + } + + /** + * Find objects by primary key + * + * $objs = $c->findPks(array(12, 56, 832), $con); + * + * @param array $keys Primary keys to use for the query + * @param PropelPDO $con an optional connection object + * + * @return PropelObjectCollection|Medium[]|mixed the list of results, formatted by the current formatter + */ + public function findPks($keys, $con = null) + { + if ($con === null) { + $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ); + } + $this->basePreSelect($con); + $criteria = $this->isKeepQuery() ? clone $this : $this; + $stmt = $criteria + ->filterByPrimaryKeys($keys) + ->doSelect($con); + + return $criteria->getFormatter()->init($criteria)->format($stmt); + } + + /** + * Filter the query by primary key + * + * @param mixed $key Primary key to use for the query + * + * @return MediumQuery The current query, for fluid interface + */ + public function filterByPrimaryKey($key) + { + + return $this->addUsingAlias(MediumPeer::ID, $key, Criteria::EQUAL); + } + + /** + * Filter the query by a list of primary keys + * + * @param array $keys The list of primary key to use for the query + * + * @return MediumQuery The current query, for fluid interface + */ + public function filterByPrimaryKeys($keys) + { + + return $this->addUsingAlias(MediumPeer::ID, $keys, Criteria::IN); + } + + /** + * Filter the query on the id column + * + * Example usage: + * + * $query->filterById(1234); // WHERE id = 1234 + * $query->filterById(array(12, 34)); // WHERE id IN (12, 34) + * $query->filterById(array('min' => 12)); // WHERE id >= 12 + * $query->filterById(array('max' => 12)); // WHERE id <= 12 + * + * + * @param mixed $id The value to use as filter. + * Use scalar values for equality. + * Use array values for in_array() equivalent. + * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return MediumQuery The current query, for fluid interface + */ + public function filterById($id = null, $comparison = null) + { + if (is_array($id)) { + $useMinMax = false; + if (isset($id['min'])) { + $this->addUsingAlias(MediumPeer::ID, $id['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($id['max'])) { + $this->addUsingAlias(MediumPeer::ID, $id['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + + return $this->addUsingAlias(MediumPeer::ID, $id, $comparison); + } + + /** + * Filter the query on the mod column + * + * Example usage: + * + * $query->filterByMod(1234); // WHERE mod = 1234 + * $query->filterByMod(array(12, 34)); // WHERE mod IN (12, 34) + * $query->filterByMod(array('min' => 12)); // WHERE mod >= 12 + * $query->filterByMod(array('max' => 12)); // WHERE mod <= 12 + * + * + * @param mixed $mod The value to use as filter. + * Use scalar values for equality. + * Use array values for in_array() equivalent. + * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return MediumQuery The current query, for fluid interface + */ + public function filterByMod($mod = null, $comparison = null) + { + if (is_array($mod)) { + $useMinMax = false; + if (isset($mod['min'])) { + $this->addUsingAlias(MediumPeer::MOD, $mod['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($mod['max'])) { + $this->addUsingAlias(MediumPeer::MOD, $mod['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + + return $this->addUsingAlias(MediumPeer::MOD, $mod, $comparison); + } + + /** + * Filter the query on the autor column + * + * Example usage: + * + * $query->filterByAutor('fooValue'); // WHERE autor = 'fooValue' + * $query->filterByAutor('%fooValue%'); // WHERE autor LIKE '%fooValue%' + * + * + * @param string $autor The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return MediumQuery The current query, for fluid interface + */ + public function filterByAutor($autor = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($autor)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $autor)) { + $autor = str_replace('*', '%', $autor); + $comparison = Criteria::LIKE; + } + } + + return $this->addUsingAlias(MediumPeer::AUTOR, $autor, $comparison); + } + + /** + * Filter the query on the titel column + * + * Example usage: + * + * $query->filterByTitel('fooValue'); // WHERE titel = 'fooValue' + * $query->filterByTitel('%fooValue%'); // WHERE titel LIKE '%fooValue%' + * + * + * @param string $titel The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return MediumQuery The current query, for fluid interface + */ + public function filterByTitel($titel = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($titel)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $titel)) { + $titel = str_replace('*', '%', $titel); + $comparison = Criteria::LIKE; + } + } + + return $this->addUsingAlias(MediumPeer::TITEL, $titel, $comparison); + } + + /** + * Filter the query on the eigentumer column + * + * Example usage: + * + * $query->filterByEigentumer('fooValue'); // WHERE eigentumer = 'fooValue' + * $query->filterByEigentumer('%fooValue%'); // WHERE eigentumer LIKE '%fooValue%' + * + * + * @param string $eigentumer The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return MediumQuery The current query, for fluid interface + */ + public function filterByEigentumer($eigentumer = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($eigentumer)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $eigentumer)) { + $eigentumer = str_replace('*', '%', $eigentumer); + $comparison = Criteria::LIKE; + } + } + + return $this->addUsingAlias(MediumPeer::EIGENTUMER, $eigentumer, $comparison); + } + + /** + * Filter the query on the zz_bei column + * + * Example usage: + * + * $query->filterByZzBei('fooValue'); // WHERE zz_bei = 'fooValue' + * $query->filterByZzBei('%fooValue%'); // WHERE zz_bei LIKE '%fooValue%' + * + * + * @param string $zzBei The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return MediumQuery The current query, for fluid interface + */ + public function filterByZzBei($zzBei = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($zzBei)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $zzBei)) { + $zzBei = str_replace('*', '%', $zzBei); + $comparison = Criteria::LIKE; + } + } + + return $this->addUsingAlias(MediumPeer::ZZ_BEI, $zzBei, $comparison); + } + + /** + * Filter the query on the kommentar column + * + * Example usage: + * + * $query->filterByKommentar('fooValue'); // WHERE kommentar = 'fooValue' + * $query->filterByKommentar('%fooValue%'); // WHERE kommentar LIKE '%fooValue%' + * + * + * @param string $kommentar The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return MediumQuery The current query, for fluid interface + */ + public function filterByKommentar($kommentar = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($kommentar)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $kommentar)) { + $kommentar = str_replace('*', '%', $kommentar); + $comparison = Criteria::LIKE; + } + } + + return $this->addUsingAlias(MediumPeer::KOMMENTAR, $kommentar, $comparison); + } + + /** + * Filter the query on the class_key column + * + * Example usage: + * + * $query->filterByClassKey(1234); // WHERE class_key = 1234 + * $query->filterByClassKey(array(12, 34)); // WHERE class_key IN (12, 34) + * $query->filterByClassKey(array('min' => 12)); // WHERE class_key >= 12 + * $query->filterByClassKey(array('max' => 12)); // WHERE class_key <= 12 + * + * + * @param mixed $classKey The value to use as filter. + * Use scalar values for equality. + * Use array values for in_array() equivalent. + * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return MediumQuery The current query, for fluid interface + */ + public function filterByClassKey($classKey = null, $comparison = null) + { + if (is_array($classKey)) { + $useMinMax = false; + if (isset($classKey['min'])) { + $this->addUsingAlias(MediumPeer::CLASS_KEY, $classKey['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($classKey['max'])) { + $this->addUsingAlias(MediumPeer::CLASS_KEY, $classKey['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + + return $this->addUsingAlias(MediumPeer::CLASS_KEY, $classKey, $comparison); + } + + /** + * Exclude object from result + * + * @param Medium $medium Object to remove from the list of results + * + * @return MediumQuery The current query, for fluid interface + */ + public function prune($medium = null) + { + if ($medium) { + $this->addUsingAlias(MediumPeer::ID, $medium->getId(), Criteria::NOT_EQUAL); + } + + return $this; + } + +} diff --git a/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseRomanQuery.php b/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseRomanQuery.php new file mode 100644 index 0000000..0030857 --- /dev/null +++ b/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseRomanQuery.php @@ -0,0 +1,109 @@ +setModelAlias($modelAlias); + } + if ($criteria instanceof Criteria) { + $query->mergeWith($criteria); + } + + return $query; + } + + /** + * Filters the query to target only Roman objects. + */ + public function preSelect(PropelPDO $con) + { + $this->addUsingAlias(MediumPeer::CLASS_KEY, MediumPeer::CLASSKEY_3); + } + + /** + * Filters the query to target only Roman objects. + */ + public function preUpdate(&$values, PropelPDO $con, $forceIndividualSaves = false) + { + $this->addUsingAlias(MediumPeer::CLASS_KEY, MediumPeer::CLASSKEY_3); + } + + /** + * Filters the query to target only Roman objects. + */ + public function preDelete(PropelPDO $con) + { + $this->addUsingAlias(MediumPeer::CLASS_KEY, MediumPeer::CLASSKEY_3); + } + + /** + * Issue a DELETE query based on the current ModelCriteria deleting all rows in the table + * Having the Roman class. + * This method is called by ModelCriteria::deleteAll() inside a transaction + * + * @param PropelPDO $con a connection object + * + * @return integer the number of deleted rows + */ + public function doDeleteAll($con) + { + // condition on class key is already added in preDelete() + return parent::doDelete($con); + } + + + /** + * Issue a SELECT ... LIMIT 1 query based on the current ModelCriteria + * and format the result with the current formatter + * By default, returns a model object + * + * @param PropelPDO $con an optional connection object + * + * @return mixed the result, formatted by the current formatter + * + * @throws PropelException + */ + public function findOneOrCreate($con = null) + { + if ($this->joins) { + throw new PropelException('findOneOrCreate() cannot be used on a query with a join, because Propel cannot transform a SQL JOIN into a subquery. You should split the query in two queries to avoid joins.'); + } + if (!$ret = $this->findOne($con)) { + $class = MediumPeer::CLASSNAME_3; + $obj = new $class; + foreach ($this->keys() as $key) { + $obj->setByName($key, $this->getValue($key), BasePeer::TYPE_COLNAME); + } + $ret = $this->getFormatter()->formatRecord($obj); + } + + return $ret; + } + +} // BaseRomanQuery diff --git a/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseWerkzeug.php b/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseWerkzeug.php new file mode 100644 index 0000000..8a9812a --- /dev/null +++ b/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseWerkzeug.php @@ -0,0 +1,1049 @@ +id; + } + + /** + * Get the [mod] column value. + * + * @return int + */ + public function getMod() + { + + return $this->mod; + } + + /** + * Get the [typ] column value. + * + * @return string + */ + public function getTyp() + { + + return $this->typ; + } + + /** + * Get the [beschreibung] column value. + * + * @return string + */ + public function getBeschreibung() + { + + return $this->beschreibung; + } + + /** + * Get the [eigentumer] column value. + * + * @return string + */ + public function getEigentumer() + { + + return $this->eigentumer; + } + + /** + * Get the [zz_bei] column value. + * + * @return string + */ + public function getZzBei() + { + + return $this->zz_bei; + } + + /** + * Set the value of [id] column. + * + * @param int $v new value + * @return Werkzeug The current object (for fluent API support) + */ + public function setId($v) + { + if ($v !== null && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->id !== $v) { + $this->id = $v; + $this->modifiedColumns[] = WerkzeugPeer::ID; + } + + + return $this; + } // setId() + + /** + * Set the value of [mod] column. + * + * @param int $v new value + * @return Werkzeug The current object (for fluent API support) + */ + public function setMod($v) + { + if ($v !== null && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->mod !== $v) { + $this->mod = $v; + $this->modifiedColumns[] = WerkzeugPeer::MOD; + } + + + return $this; + } // setMod() + + /** + * Set the value of [typ] column. + * + * @param string $v new value + * @return Werkzeug The current object (for fluent API support) + */ + public function setTyp($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->typ !== $v) { + $this->typ = $v; + $this->modifiedColumns[] = WerkzeugPeer::TYP; + } + + + return $this; + } // setTyp() + + /** + * Set the value of [beschreibung] column. + * + * @param string $v new value + * @return Werkzeug The current object (for fluent API support) + */ + public function setBeschreibung($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->beschreibung !== $v) { + $this->beschreibung = $v; + $this->modifiedColumns[] = WerkzeugPeer::BESCHREIBUNG; + } + + + return $this; + } // setBeschreibung() + + /** + * Set the value of [eigentumer] column. + * + * @param string $v new value + * @return Werkzeug The current object (for fluent API support) + */ + public function setEigentumer($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->eigentumer !== $v) { + $this->eigentumer = $v; + $this->modifiedColumns[] = WerkzeugPeer::EIGENTUMER; + } + + + return $this; + } // setEigentumer() + + /** + * Set the value of [zz_bei] column. + * + * @param string $v new value + * @return Werkzeug The current object (for fluent API support) + */ + public function setZzBei($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->zz_bei !== $v) { + $this->zz_bei = $v; + $this->modifiedColumns[] = WerkzeugPeer::ZZ_BEI; + } + + + return $this; + } // setZzBei() + + /** + * Indicates whether the columns in this object are only set to default values. + * + * This method can be used in conjunction with isModified() to indicate whether an object is both + * modified _and_ has some values set which are non-default. + * + * @return boolean Whether the columns in this object are only been set with default values. + */ + public function hasOnlyDefaultValues() + { + // otherwise, everything was equal, so return true + return true; + } // hasOnlyDefaultValues() + + /** + * Hydrates (populates) the object variables with values from the database resultset. + * + * An offset (0-based "start column") is specified so that objects can be hydrated + * with a subset of the columns in the resultset rows. This is needed, for example, + * for results of JOIN queries where the resultset row includes columns from two or + * more tables. + * + * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) + * @param int $startcol 0-based offset column which indicates which resultset column to start with. + * @param boolean $rehydrate Whether this object is being re-hydrated from the database. + * @return int next starting column + * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. + */ + public function hydrate($row, $startcol = 0, $rehydrate = false) + { + try { + + $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; + $this->mod = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; + $this->typ = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; + $this->beschreibung = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; + $this->eigentumer = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; + $this->zz_bei = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; + $this->resetModified(); + + $this->setNew(false); + + if ($rehydrate) { + $this->ensureConsistency(); + } + $this->postHydrate($row, $startcol, $rehydrate); + + return $startcol + 6; // 6 = WerkzeugPeer::NUM_HYDRATE_COLUMNS. + + } catch (Exception $e) { + throw new PropelException("Error populating Werkzeug object", $e); + } + } + + /** + * Checks and repairs the internal consistency of the object. + * + * This method is executed after an already-instantiated object is re-hydrated + * from the database. It exists to check any foreign keys to make sure that + * the objects related to the current object are correct based on foreign key. + * + * You can override this method in the stub class, but you should always invoke + * the base method from the overridden method (i.e. parent::ensureConsistency()), + * in case your model changes. + * + * @throws PropelException + */ + public function ensureConsistency() + { + + } // ensureConsistency + + /** + * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. + * + * This will only work if the object has been saved and has a valid primary key set. + * + * @param boolean $deep (optional) Whether to also de-associated any related objects. + * @param PropelPDO $con (optional) The PropelPDO connection to use. + * @return void + * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db + */ + public function reload($deep = false, PropelPDO $con = null) + { + if ($this->isDeleted()) { + throw new PropelException("Cannot reload a deleted object."); + } + + if ($this->isNew()) { + throw new PropelException("Cannot reload an unsaved object."); + } + + if ($con === null) { + $con = Propel::getConnection(WerkzeugPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + // We don't need to alter the object instance pool; we're just modifying this instance + // already in the pool. + + $stmt = WerkzeugPeer::doSelectStmt($this->buildPkeyCriteria(), $con); + $row = $stmt->fetch(PDO::FETCH_NUM); + $stmt->closeCursor(); + if (!$row) { + throw new PropelException('Cannot find matching row in the database to reload object values.'); + } + $this->hydrate($row, 0, true); // rehydrate + + if ($deep) { // also de-associate any related objects? + + } // if (deep) + } + + /** + * Removes this object from datastore and sets delete attribute. + * + * @param PropelPDO $con + * @return void + * @throws PropelException + * @throws Exception + * @see BaseObject::setDeleted() + * @see BaseObject::isDeleted() + */ + public function delete(PropelPDO $con = null) + { + if ($this->isDeleted()) { + throw new PropelException("This object has already been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(WerkzeugPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + + $con->beginTransaction(); + try { + $deleteQuery = WerkzeugQuery::create() + ->filterByPrimaryKey($this->getPrimaryKey()); + $ret = $this->preDelete($con); + if ($ret) { + $deleteQuery->delete($con); + $this->postDelete($con); + $con->commit(); + $this->setDeleted(true); + } else { + $con->commit(); + } + } catch (Exception $e) { + $con->rollBack(); + throw $e; + } + } + + /** + * Persists this object to the database. + * + * If the object is new, it inserts it; otherwise an update is performed. + * All modified related objects will also be persisted in the doSave() + * method. This method wraps all precipitate database operations in a + * single transaction. + * + * @param PropelPDO $con + * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. + * @throws PropelException + * @throws Exception + * @see doSave() + */ + public function save(PropelPDO $con = null) + { + if ($this->isDeleted()) { + throw new PropelException("You cannot save an object that has been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(WerkzeugPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + + $con->beginTransaction(); + $isInsert = $this->isNew(); + try { + $ret = $this->preSave($con); + if ($isInsert) { + $ret = $ret && $this->preInsert($con); + } else { + $ret = $ret && $this->preUpdate($con); + } + if ($ret) { + $affectedRows = $this->doSave($con); + if ($isInsert) { + $this->postInsert($con); + } else { + $this->postUpdate($con); + } + $this->postSave($con); + WerkzeugPeer::addInstanceToPool($this); + } else { + $affectedRows = 0; + } + $con->commit(); + + return $affectedRows; + } catch (Exception $e) { + $con->rollBack(); + throw $e; + } + } + + /** + * Performs the work of inserting or updating the row in the database. + * + * If the object is new, it inserts it; otherwise an update is performed. + * All related objects are also updated in this method. + * + * @param PropelPDO $con + * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. + * @throws PropelException + * @see save() + */ + protected function doSave(PropelPDO $con) + { + $affectedRows = 0; // initialize var to track total num of affected rows + if (!$this->alreadyInSave) { + $this->alreadyInSave = true; + + if ($this->isNew() || $this->isModified()) { + // persist changes + if ($this->isNew()) { + $this->doInsert($con); + } else { + $this->doUpdate($con); + } + $affectedRows += 1; + $this->resetModified(); + } + + $this->alreadyInSave = false; + + } + + return $affectedRows; + } // doSave() + + /** + * Insert the row in the database. + * + * @param PropelPDO $con + * + * @throws PropelException + * @see doSave() + */ + protected function doInsert(PropelPDO $con) + { + $modifiedColumns = array(); + $index = 0; + + $this->modifiedColumns[] = WerkzeugPeer::ID; + if (null !== $this->id) { + throw new PropelException('Cannot insert a value for auto-increment primary key (' . WerkzeugPeer::ID . ')'); + } + + // check the columns in natural order for more readable SQL queries + if ($this->isColumnModified(WerkzeugPeer::ID)) { + $modifiedColumns[':p' . $index++] = '`id`'; + } + if ($this->isColumnModified(WerkzeugPeer::MOD)) { + $modifiedColumns[':p' . $index++] = '`mod`'; + } + if ($this->isColumnModified(WerkzeugPeer::TYP)) { + $modifiedColumns[':p' . $index++] = '`typ`'; + } + if ($this->isColumnModified(WerkzeugPeer::BESCHREIBUNG)) { + $modifiedColumns[':p' . $index++] = '`beschreibung`'; + } + if ($this->isColumnModified(WerkzeugPeer::EIGENTUMER)) { + $modifiedColumns[':p' . $index++] = '`eigentumer`'; + } + if ($this->isColumnModified(WerkzeugPeer::ZZ_BEI)) { + $modifiedColumns[':p' . $index++] = '`zz_bei`'; + } + + $sql = sprintf( + 'INSERT INTO `werkzeug` (%s) VALUES (%s)', + implode(', ', $modifiedColumns), + implode(', ', array_keys($modifiedColumns)) + ); + + try { + $stmt = $con->prepare($sql); + foreach ($modifiedColumns as $identifier => $columnName) { + switch ($columnName) { + case '`id`': + $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT); + break; + case '`mod`': + $stmt->bindValue($identifier, $this->mod, PDO::PARAM_INT); + break; + case '`typ`': + $stmt->bindValue($identifier, $this->typ, PDO::PARAM_STR); + break; + case '`beschreibung`': + $stmt->bindValue($identifier, $this->beschreibung, PDO::PARAM_STR); + break; + case '`eigentumer`': + $stmt->bindValue($identifier, $this->eigentumer, PDO::PARAM_STR); + break; + case '`zz_bei`': + $stmt->bindValue($identifier, $this->zz_bei, PDO::PARAM_STR); + break; + } + } + $stmt->execute(); + } catch (Exception $e) { + Propel::log($e->getMessage(), Propel::LOG_ERR); + throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e); + } + + try { + $pk = $con->lastInsertId(); + } catch (Exception $e) { + throw new PropelException('Unable to get autoincrement id.', $e); + } + $this->setId($pk); + + $this->setNew(false); + } + + /** + * Update the row in the database. + * + * @param PropelPDO $con + * + * @see doSave() + */ + protected function doUpdate(PropelPDO $con) + { + $selectCriteria = $this->buildPkeyCriteria(); + $valuesCriteria = $this->buildCriteria(); + BasePeer::doUpdate($selectCriteria, $valuesCriteria, $con); + } + + /** + * Array of ValidationFailed objects. + * @var array ValidationFailed[] + */ + protected $validationFailures = array(); + + /** + * Gets any ValidationFailed objects that resulted from last call to validate(). + * + * + * @return array ValidationFailed[] + * @see validate() + */ + public function getValidationFailures() + { + return $this->validationFailures; + } + + /** + * Validates the objects modified field values and all objects related to this table. + * + * If $columns is either a column name or an array of column names + * only those columns are validated. + * + * @param mixed $columns Column name or an array of column names. + * @return boolean Whether all columns pass validation. + * @see doValidate() + * @see getValidationFailures() + */ + public function validate($columns = null) + { + $res = $this->doValidate($columns); + if ($res === true) { + $this->validationFailures = array(); + + return true; + } + + $this->validationFailures = $res; + + return false; + } + + /** + * This function performs the validation work for complex object models. + * + * In addition to checking the current object, all related objects will + * also be validated. If all pass then true is returned; otherwise + * an aggregated array of ValidationFailed objects will be returned. + * + * @param array $columns Array of column names to validate. + * @return mixed true if all validations pass; array of ValidationFailed objects otherwise. + */ + protected function doValidate($columns = null) + { + if (!$this->alreadyInValidation) { + $this->alreadyInValidation = true; + $retval = null; + + $failureMap = array(); + + + if (($retval = WerkzeugPeer::doValidate($this, $columns)) !== true) { + $failureMap = array_merge($failureMap, $retval); + } + + + + $this->alreadyInValidation = false; + } + + return (!empty($failureMap) ? $failureMap : true); + } + + /** + * Retrieves a field from the object by name passed in as a string. + * + * @param string $name name + * @param string $type The type of fieldname the $name is of: + * 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 + * @return mixed Value of field. + */ + public function getByName($name, $type = BasePeer::TYPE_PHPNAME) + { + $pos = WerkzeugPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + $field = $this->getByPosition($pos); + + return $field; + } + + /** + * Retrieves a field from the object by Position as specified in the xml schema. + * Zero-based. + * + * @param int $pos position in xml schema + * @return mixed Value of field at $pos + */ + public function getByPosition($pos) + { + switch ($pos) { + case 0: + return $this->getId(); + break; + case 1: + return $this->getMod(); + break; + case 2: + return $this->getTyp(); + break; + case 3: + return $this->getBeschreibung(); + break; + case 4: + return $this->getEigentumer(); + break; + case 5: + return $this->getZzBei(); + break; + default: + return null; + break; + } // switch() + } + + /** + * 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 + * + * @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()) + { + if (isset($alreadyDumpedObjects['Werkzeug'][$this->getPrimaryKey()])) { + return '*RECURSION*'; + } + $alreadyDumpedObjects['Werkzeug'][$this->getPrimaryKey()] = true; + $keys = WerkzeugPeer::getFieldNames($keyType); + $result = array( + $keys[0] => $this->getId(), + $keys[1] => $this->getMod(), + $keys[2] => $this->getTyp(), + $keys[3] => $this->getBeschreibung(), + $keys[4] => $this->getEigentumer(), + $keys[5] => $this->getZzBei(), + ); + $virtualColumns = $this->virtualColumns; + foreach ($virtualColumns as $key => $virtualColumn) { + $result[$key] = $virtualColumn; + } + + + return $result; + } + + /** + * Sets a field from the object by name passed in as a string. + * + * @param string $name peer name + * @param mixed $value field value + * @param string $type The type of fieldname the $name is of: + * 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 + * @return void + */ + public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) + { + $pos = WerkzeugPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + + $this->setByPosition($pos, $value); + } + + /** + * Sets a field from the object by Position as specified in the xml schema. + * Zero-based. + * + * @param int $pos position in xml schema + * @param mixed $value field value + * @return void + */ + public function setByPosition($pos, $value) + { + switch ($pos) { + case 0: + $this->setId($value); + break; + case 1: + $this->setMod($value); + break; + case 2: + $this->setTyp($value); + break; + case 3: + $this->setBeschreibung($value); + break; + case 4: + $this->setEigentumer($value); + break; + case 5: + $this->setZzBei($value); + break; + } // switch() + } + + /** + * Populates the object using an array. + * + * This is particularly useful when populating an object from one of the + * request arrays (e.g. $_POST). This method goes through the column + * names, checking to see whether a matching key exists in populated + * array. If so the setByName() method is called for that column. + * + * You can specify the key type of the array by additionally passing one + * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, + * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. + * The default key type is the column's BasePeer::TYPE_PHPNAME + * + * @param array $arr An array to populate the object from. + * @param string $keyType The type of keys the array uses. + * @return void + */ + public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) + { + $keys = WerkzeugPeer::getFieldNames($keyType); + + if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); + if (array_key_exists($keys[1], $arr)) $this->setMod($arr[$keys[1]]); + if (array_key_exists($keys[2], $arr)) $this->setTyp($arr[$keys[2]]); + if (array_key_exists($keys[3], $arr)) $this->setBeschreibung($arr[$keys[3]]); + if (array_key_exists($keys[4], $arr)) $this->setEigentumer($arr[$keys[4]]); + if (array_key_exists($keys[5], $arr)) $this->setZzBei($arr[$keys[5]]); + } + + /** + * Build a Criteria object containing the values of all modified columns in this object. + * + * @return Criteria The Criteria object containing all modified values. + */ + public function buildCriteria() + { + $criteria = new Criteria(WerkzeugPeer::DATABASE_NAME); + + if ($this->isColumnModified(WerkzeugPeer::ID)) $criteria->add(WerkzeugPeer::ID, $this->id); + if ($this->isColumnModified(WerkzeugPeer::MOD)) $criteria->add(WerkzeugPeer::MOD, $this->mod); + if ($this->isColumnModified(WerkzeugPeer::TYP)) $criteria->add(WerkzeugPeer::TYP, $this->typ); + if ($this->isColumnModified(WerkzeugPeer::BESCHREIBUNG)) $criteria->add(WerkzeugPeer::BESCHREIBUNG, $this->beschreibung); + if ($this->isColumnModified(WerkzeugPeer::EIGENTUMER)) $criteria->add(WerkzeugPeer::EIGENTUMER, $this->eigentumer); + if ($this->isColumnModified(WerkzeugPeer::ZZ_BEI)) $criteria->add(WerkzeugPeer::ZZ_BEI, $this->zz_bei); + + return $criteria; + } + + /** + * Builds a Criteria object containing the primary key for this object. + * + * Unlike buildCriteria() this method includes the primary key values regardless + * of whether or not they have been modified. + * + * @return Criteria The Criteria object containing value(s) for primary key(s). + */ + public function buildPkeyCriteria() + { + $criteria = new Criteria(WerkzeugPeer::DATABASE_NAME); + $criteria->add(WerkzeugPeer::ID, $this->id); + + return $criteria; + } + + /** + * Returns the primary key for this object (row). + * @return int + */ + public function getPrimaryKey() + { + return $this->getId(); + } + + /** + * Generic method to set the primary key (id column). + * + * @param int $key Primary key. + * @return void + */ + public function setPrimaryKey($key) + { + $this->setId($key); + } + + /** + * Returns true if the primary key for this object is null. + * @return boolean + */ + public function isPrimaryKeyNull() + { + + return null === $this->getId(); + } + + /** + * Sets contents of passed object to values from current object. + * + * If desired, this method can also make copies of all associated (fkey referrers) + * objects. + * + * @param object $copyObj An object of Werkzeug (or compatible) type. + * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. + * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new. + * @throws PropelException + */ + public function copyInto($copyObj, $deepCopy = false, $makeNew = true) + { + $copyObj->setMod($this->getMod()); + $copyObj->setTyp($this->getTyp()); + $copyObj->setBeschreibung($this->getBeschreibung()); + $copyObj->setEigentumer($this->getEigentumer()); + $copyObj->setZzBei($this->getZzBei()); + if ($makeNew) { + $copyObj->setNew(true); + $copyObj->setId(NULL); // this is a auto-increment column, so set to default value + } + } + + /** + * Makes a copy of this object that will be inserted as a new row in table when saved. + * It creates a new object filling in the simple attributes, but skipping any primary + * keys that are defined for the table. + * + * If desired, this method can also make copies of all associated (fkey referrers) + * objects. + * + * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. + * @return Werkzeug Clone of current object. + * @throws PropelException + */ + public function copy($deepCopy = false) + { + // we use get_class(), because this might be a subclass + $clazz = get_class($this); + $copyObj = new $clazz(); + $this->copyInto($copyObj, $deepCopy); + + return $copyObj; + } + + /** + * Returns a peer instance associated with this om. + * + * Since Peer classes are not to have any instance attributes, this method returns the + * same instance for all member of this class. The method could therefore + * be static, but this would prevent one from overriding the behavior. + * + * @return WerkzeugPeer + */ + public function getPeer() + { + if (self::$peer === null) { + self::$peer = new WerkzeugPeer(); + } + + return self::$peer; + } + + /** + * Clears the current object and sets all attributes to their default values + */ + public function clear() + { + $this->id = null; + $this->mod = null; + $this->typ = null; + $this->beschreibung = null; + $this->eigentumer = null; + $this->zz_bei = null; + $this->alreadyInSave = false; + $this->alreadyInValidation = false; + $this->alreadyInClearAllReferencesDeep = false; + $this->clearAllReferences(); + $this->resetModified(); + $this->setNew(true); + $this->setDeleted(false); + } + + /** + * Resets all references to other model objects or collections of model objects. + * + * This method is a user-space workaround for PHP's inability to garbage collect + * objects with circular references (even in PHP 5.3). This is currently necessary + * when using Propel in certain daemon or large-volume/high-memory operations. + * + * @param boolean $deep Whether to also clear the references on all referrer objects. + */ + public function clearAllReferences($deep = false) + { + if ($deep && !$this->alreadyInClearAllReferencesDeep) { + $this->alreadyInClearAllReferencesDeep = true; + + $this->alreadyInClearAllReferencesDeep = false; + } // if ($deep) + + } + + /** + * return the string representation of this object + * + * @return string + */ + public function __toString() + { + return (string) $this->exportTo(WerkzeugPeer::DEFAULT_STRING_FORMAT); + } + + /** + * return true is the object is in saving state + * + * @return boolean + */ + public function isAlreadyInSave() + { + return $this->alreadyInSave; + } + +} diff --git a/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseWerkzeugPeer.php b/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseWerkzeugPeer.php new file mode 100644 index 0000000..43d28e0 --- /dev/null +++ b/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseWerkzeugPeer.php @@ -0,0 +1,781 @@ + array ('Id', 'Mod', 'Typ', 'Beschreibung', 'Eigentumer', 'ZzBei', ), + BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'mod', 'typ', 'beschreibung', 'eigentumer', 'zzBei', ), + BasePeer::TYPE_COLNAME => array (WerkzeugPeer::ID, WerkzeugPeer::MOD, WerkzeugPeer::TYP, WerkzeugPeer::BESCHREIBUNG, WerkzeugPeer::EIGENTUMER, WerkzeugPeer::ZZ_BEI, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID', 'MOD', 'TYP', 'BESCHREIBUNG', 'EIGENTUMER', 'ZZ_BEI', ), + BasePeer::TYPE_FIELDNAME => array ('id', 'mod', 'typ', 'beschreibung', 'eigentumer', 'zz_bei', ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, ) + ); + + /** + * holds an array of keys for quick access to the fieldnames array + * + * first dimension keys are the type constants + * e.g. WerkzeugPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 + */ + protected static $fieldKeys = array ( + BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Mod' => 1, 'Typ' => 2, 'Beschreibung' => 3, 'Eigentumer' => 4, 'ZzBei' => 5, ), + BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'mod' => 1, 'typ' => 2, 'beschreibung' => 3, 'eigentumer' => 4, 'zzBei' => 5, ), + BasePeer::TYPE_COLNAME => array (WerkzeugPeer::ID => 0, WerkzeugPeer::MOD => 1, WerkzeugPeer::TYP => 2, WerkzeugPeer::BESCHREIBUNG => 3, WerkzeugPeer::EIGENTUMER => 4, WerkzeugPeer::ZZ_BEI => 5, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'MOD' => 1, 'TYP' => 2, 'BESCHREIBUNG' => 3, 'EIGENTUMER' => 4, 'ZZ_BEI' => 5, ), + BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'mod' => 1, 'typ' => 2, 'beschreibung' => 3, 'eigentumer' => 4, 'zz_bei' => 5, ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, ) + ); + + /** + * Translates a fieldname to another type + * + * @param string $name field name + * @param string $fromType One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME + * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM + * @param string $toType One of the class type constants + * @return string translated name of the field. + * @throws PropelException - if the specified name could not be found in the fieldname mappings. + */ + public static function translateFieldName($name, $fromType, $toType) + { + $toNames = WerkzeugPeer::getFieldNames($toType); + $key = isset(WerkzeugPeer::$fieldKeys[$fromType][$name]) ? WerkzeugPeer::$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(WerkzeugPeer::$fieldKeys[$fromType], true)); + } + + return $toNames[$key]; + } + + /** + * Returns an array of field names. + * + * @param string $type The type of fieldnames to return: + * One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME + * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM + * @return array A list of field names + * @throws PropelException - if the type is not valid. + */ + public static function getFieldNames($type = BasePeer::TYPE_PHPNAME) + { + if (!array_key_exists($type, WerkzeugPeer::$fieldNames)) { + throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. ' . $type . ' was given.'); + } + + return WerkzeugPeer::$fieldNames[$type]; + } + + /** + * Convenience method which changes table.column to alias.column. + * + * Using this method you can maintain SQL abstraction while using column aliases. + * + * $c->addAlias("alias1", TablePeer::TABLE_NAME); + * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); + * + * @param string $alias The alias for the current table. + * @param string $column The column name for current table. (i.e. WerkzeugPeer::COLUMN_NAME). + * @return string + */ + public static function alias($alias, $column) + { + return str_replace(WerkzeugPeer::TABLE_NAME.'.', $alias.'.', $column); + } + + /** + * Add all the columns needed to create a new object. + * + * Note: any columns that were marked with lazyLoad="true" in the + * XML schema will not be added to the select list and only loaded + * on demand. + * + * @param Criteria $criteria object containing the columns to add. + * @param string $alias optional table alias + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function addSelectColumns(Criteria $criteria, $alias = null) + { + if (null === $alias) { + $criteria->addSelectColumn(WerkzeugPeer::ID); + $criteria->addSelectColumn(WerkzeugPeer::MOD); + $criteria->addSelectColumn(WerkzeugPeer::TYP); + $criteria->addSelectColumn(WerkzeugPeer::BESCHREIBUNG); + $criteria->addSelectColumn(WerkzeugPeer::EIGENTUMER); + $criteria->addSelectColumn(WerkzeugPeer::ZZ_BEI); + } else { + $criteria->addSelectColumn($alias . '.id'); + $criteria->addSelectColumn($alias . '.mod'); + $criteria->addSelectColumn($alias . '.typ'); + $criteria->addSelectColumn($alias . '.beschreibung'); + $criteria->addSelectColumn($alias . '.eigentumer'); + $criteria->addSelectColumn($alias . '.zz_bei'); + } + } + + /** + * Returns the number of rows matching criteria. + * + * @param Criteria $criteria + * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead. + * @param PropelPDO $con + * @return int Number of matching rows. + */ + public static function doCount(Criteria $criteria, $distinct = false, PropelPDO $con = null) + { + // we may modify criteria, so copy it first + $criteria = clone $criteria; + + // We need to set the primary table name, since in the case that there are no WHERE columns + // it will be impossible for the BasePeer::createSelectSql() method to determine which + // tables go into the FROM clause. + $criteria->setPrimaryTableName(WerkzeugPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + WerkzeugPeer::addSelectColumns($criteria); + } + + $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count + $criteria->setDbName(WerkzeugPeer::DATABASE_NAME); // Set the correct dbName + + if ($con === null) { + $con = Propel::getConnection(WerkzeugPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + // BasePeer returns a PDOStatement + $stmt = BasePeer::doCount($criteria, $con); + + if ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $count = (int) $row[0]; + } else { + $count = 0; // no rows returned; we infer that means 0 matches. + } + $stmt->closeCursor(); + + return $count; + } + /** + * Selects one object from the DB. + * + * @param Criteria $criteria object used to create the SELECT statement. + * @param PropelPDO $con + * @return Werkzeug + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectOne(Criteria $criteria, PropelPDO $con = null) + { + $critcopy = clone $criteria; + $critcopy->setLimit(1); + $objects = WerkzeugPeer::doSelect($critcopy, $con); + if ($objects) { + return $objects[0]; + } + + return null; + } + /** + * Selects several row from the DB. + * + * @param Criteria $criteria The Criteria object used to build the SELECT statement. + * @param PropelPDO $con + * @return array Array of selected Objects + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelect(Criteria $criteria, PropelPDO $con = null) + { + return WerkzeugPeer::populateObjects(WerkzeugPeer::doSelectStmt($criteria, $con)); + } + /** + * Prepares the Criteria object and uses the parent doSelect() method to execute a PDOStatement. + * + * Use this method directly if you want to work with an executed statement directly (for example + * to perform your own object hydration). + * + * @param Criteria $criteria The Criteria object used to build the SELECT statement. + * @param PropelPDO $con The connection to use + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + * @return PDOStatement The executed PDOStatement object. + * @see BasePeer::doSelect() + */ + public static function doSelectStmt(Criteria $criteria, PropelPDO $con = null) + { + if ($con === null) { + $con = Propel::getConnection(WerkzeugPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + if (!$criteria->hasSelectClause()) { + $criteria = clone $criteria; + WerkzeugPeer::addSelectColumns($criteria); + } + + // Set the correct dbName + $criteria->setDbName(WerkzeugPeer::DATABASE_NAME); + + // BasePeer returns a PDOStatement + return BasePeer::doSelect($criteria, $con); + } + /** + * Adds an object to the instance pool. + * + * Propel keeps cached copies of objects in an instance pool when they are retrieved + * from the database. In some cases -- especially when you override doSelect*() + * methods in your stub classes -- you may need to explicitly add objects + * to the cache in order to ensure that the same objects are always returned by doSelect*() + * and retrieveByPK*() calls. + * + * @param Werkzeug $obj A Werkzeug object. + * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). + */ + public static function addInstanceToPool($obj, $key = null) + { + if (Propel::isInstancePoolingEnabled()) { + if ($key === null) { + $key = (string) $obj->getId(); + } // if key === null + WerkzeugPeer::$instances[$key] = $obj; + } + } + + /** + * Removes an object from the instance pool. + * + * Propel keeps cached copies of objects in an instance pool when they are retrieved + * from the database. In some cases -- especially when you override doDelete + * methods in your stub classes -- you may need to explicitly remove objects + * from the cache in order to prevent returning objects that no longer exist. + * + * @param mixed $value A Werkzeug object or a primary key value. + * + * @return void + * @throws PropelException - if the value is invalid. + */ + public static function removeInstanceFromPool($value) + { + if (Propel::isInstancePoolingEnabled() && $value !== null) { + if (is_object($value) && $value instanceof Werkzeug) { + $key = (string) $value->getId(); + } elseif (is_scalar($value)) { + // assume we've been passed a primary key + $key = (string) $value; + } else { + $e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or Werkzeug object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value,true))); + throw $e; + } + + unset(WerkzeugPeer::$instances[$key]); + } + } // removeInstanceFromPool() + + /** + * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table. + * + * For tables with a single-column primary key, that simple pkey value will be returned. For tables with + * a multi-column primary key, a serialize()d version of the primary key will be returned. + * + * @param string $key The key (@see getPrimaryKeyHash()) for this instance. + * @return Werkzeug Found object or null if 1) no instance exists for specified key or 2) instance pooling has been disabled. + * @see getPrimaryKeyHash() + */ + public static function getInstanceFromPool($key) + { + if (Propel::isInstancePoolingEnabled()) { + if (isset(WerkzeugPeer::$instances[$key])) { + return WerkzeugPeer::$instances[$key]; + } + } + + return null; // just to be explicit + } + + /** + * Clear the instance pool. + * + * @return void + */ + public static function clearInstancePool($and_clear_all_references = false) + { + if ($and_clear_all_references) { + foreach (WerkzeugPeer::$instances as $instance) { + $instance->clearAllReferences(true); + } + } + WerkzeugPeer::$instances = array(); + } + + /** + * Method to invalidate the instance pool of all tables related to werkzeug + * by a foreign key with ON DELETE CASCADE + */ + public static function clearRelatedInstancePool() + { + } + + /** + * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table. + * + * For tables with a single-column primary key, that simple pkey value will be returned. For tables with + * a multi-column primary key, a serialize()d version of the primary key will be returned. + * + * @param array $row PropelPDO resultset row. + * @param int $startcol The 0-based offset for reading from the resultset row. + * @return string A string version of PK or null if the components of primary key in result array are all null. + */ + public static function getPrimaryKeyHashFromRow($row, $startcol = 0) + { + // If the PK cannot be derived from the row, return null. + if ($row[$startcol] === null) { + return null; + } + + return (string) $row[$startcol]; + } + + /** + * Retrieves the primary key from the DB resultset row + * For tables with a single-column primary key, that simple pkey value will be returned. For tables with + * a multi-column primary key, an array of the primary key columns will be returned. + * + * @param array $row PropelPDO resultset row. + * @param int $startcol The 0-based offset for reading from the resultset row. + * @return mixed The primary key of the row + */ + public static function getPrimaryKeyFromRow($row, $startcol = 0) + { + + return (int) $row[$startcol]; + } + + /** + * The returned array will contain objects of the default type or + * objects that inherit from the default. + * + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function populateObjects(PDOStatement $stmt) + { + $results = array(); + + // set the class once to avoid overhead in the loop + $cls = WerkzeugPeer::getOMClass(); + // populate the object(s) + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key = WerkzeugPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj = WerkzeugPeer::getInstanceFromPool($key))) { + // We no longer rehydrate the object, since this can cause data loss. + // See http://www.propelorm.org/ticket/509 + // $obj->hydrate($row, 0, true); // rehydrate + $results[] = $obj; + } else { + $obj = new $cls(); + $obj->hydrate($row); + $results[] = $obj; + WerkzeugPeer::addInstanceToPool($obj, $key); + } // if key exists + } + $stmt->closeCursor(); + + return $results; + } + /** + * Populates an object of the default type or an object that inherit from the default. + * + * @param array $row PropelPDO resultset row. + * @param int $startcol The 0-based offset for reading from the resultset row. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + * @return array (Werkzeug object, last column rank) + */ + public static function populateObject($row, $startcol = 0) + { + $key = WerkzeugPeer::getPrimaryKeyHashFromRow($row, $startcol); + if (null !== ($obj = WerkzeugPeer::getInstanceFromPool($key))) { + // We no longer rehydrate the object, since this can cause data loss. + // See http://www.propelorm.org/ticket/509 + // $obj->hydrate($row, $startcol, true); // rehydrate + $col = $startcol + WerkzeugPeer::NUM_HYDRATE_COLUMNS; + } else { + $cls = WerkzeugPeer::OM_CLASS; + $obj = new $cls(); + $col = $obj->hydrate($row, $startcol); + WerkzeugPeer::addInstanceToPool($obj, $key); + } + + return array($obj, $col); + } + + /** + * Returns the TableMap related to this peer. + * This method is not needed for general use but a specific application could have a need. + * @return TableMap + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function getTableMap() + { + return Propel::getDatabaseMap(WerkzeugPeer::DATABASE_NAME)->getTable(WerkzeugPeer::TABLE_NAME); + } + + /** + * Add a TableMap instance to the database for this peer class. + */ + public static function buildTableMap() + { + $dbMap = Propel::getDatabaseMap(BaseWerkzeugPeer::DATABASE_NAME); + if (!$dbMap->hasTable(BaseWerkzeugPeer::TABLE_NAME)) { + $dbMap->addTableObject(new \WerkzeugTableMap()); + } + } + + /** + * The class that the Peer will make instances of. + * + * + * @return string ClassName + */ + public static function getOMClass($row = 0, $colnum = 0) + { + return WerkzeugPeer::OM_CLASS; + } + + /** + * Performs an INSERT on the database, given a Werkzeug or Criteria object. + * + * @param mixed $values Criteria or Werkzeug object containing data that is used to create the INSERT statement. + * @param PropelPDO $con the PropelPDO connection to use + * @return mixed The new primary key. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doInsert($values, PropelPDO $con = null) + { + if ($con === null) { + $con = Propel::getConnection(WerkzeugPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; // rename for clarity + } else { + $criteria = $values->buildCriteria(); // build Criteria from Werkzeug object + } + + if ($criteria->containsKey(WerkzeugPeer::ID) && $criteria->keyContainsValue(WerkzeugPeer::ID) ) { + throw new PropelException('Cannot insert a value for auto-increment primary key ('.WerkzeugPeer::ID.')'); + } + + + // Set the correct dbName + $criteria->setDbName(WerkzeugPeer::DATABASE_NAME); + + try { + // use transaction because $criteria could contain info + // for more than one table (I guess, conceivably) + $con->beginTransaction(); + $pk = BasePeer::doInsert($criteria, $con); + $con->commit(); + } catch (Exception $e) { + $con->rollBack(); + throw $e; + } + + return $pk; + } + + /** + * Performs an UPDATE on the database, given a Werkzeug or Criteria object. + * + * @param mixed $values Criteria or Werkzeug object containing data that is used to create the UPDATE statement. + * @param PropelPDO $con The connection to use (specify PropelPDO connection object to exert more control over transactions). + * @return int The number of affected rows (if supported by underlying database driver). + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doUpdate($values, PropelPDO $con = null) + { + if ($con === null) { + $con = Propel::getConnection(WerkzeugPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + + $selectCriteria = new Criteria(WerkzeugPeer::DATABASE_NAME); + + if ($values instanceof Criteria) { + $criteria = clone $values; // rename for clarity + + $comparison = $criteria->getComparison(WerkzeugPeer::ID); + $value = $criteria->remove(WerkzeugPeer::ID); + if ($value) { + $selectCriteria->add(WerkzeugPeer::ID, $value, $comparison); + } else { + $selectCriteria->setPrimaryTableName(WerkzeugPeer::TABLE_NAME); + } + + } else { // $values is Werkzeug object + $criteria = $values->buildCriteria(); // gets full criteria + $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s) + } + + // set the correct dbName + $criteria->setDbName(WerkzeugPeer::DATABASE_NAME); + + return BasePeer::doUpdate($selectCriteria, $criteria, $con); + } + + /** + * Deletes all rows from the werkzeug table. + * + * @param PropelPDO $con the connection to use + * @return int The number of affected rows (if supported by underlying database driver). + * @throws PropelException + */ + public static function doDeleteAll(PropelPDO $con = null) + { + if ($con === null) { + $con = Propel::getConnection(WerkzeugPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + $affectedRows = 0; // initialize var to track total num of affected rows + try { + // use transaction because $criteria could contain info + // for more than one table or we could emulating ON DELETE CASCADE, etc. + $con->beginTransaction(); + $affectedRows += BasePeer::doDeleteAll(WerkzeugPeer::TABLE_NAME, $con, WerkzeugPeer::DATABASE_NAME); + // Because this db requires some delete cascade/set null emulation, we have to + // clear the cached instance *after* the emulation has happened (since + // instances get re-added by the select statement contained therein). + WerkzeugPeer::clearInstancePool(); + WerkzeugPeer::clearRelatedInstancePool(); + $con->commit(); + + return $affectedRows; + } catch (Exception $e) { + $con->rollBack(); + throw $e; + } + } + + /** + * Performs a DELETE on the database, given a Werkzeug or Criteria object OR a primary key value. + * + * @param mixed $values Criteria or Werkzeug object or primary key or array of primary keys + * which is used to create the DELETE statement + * @param PropelPDO $con the connection to use + * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows + * if supported by native driver or if emulated using Propel. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doDelete($values, PropelPDO $con = null) + { + if ($con === null) { + $con = Propel::getConnection(WerkzeugPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + + if ($values instanceof Criteria) { + // invalidate the cache for all objects of this type, since we have no + // way of knowing (without running a query) what objects should be invalidated + // from the cache based on this Criteria. + WerkzeugPeer::clearInstancePool(); + // rename for clarity + $criteria = clone $values; + } elseif ($values instanceof Werkzeug) { // it's a model object + // invalidate the cache for this single object + WerkzeugPeer::removeInstanceFromPool($values); + // create criteria based on pk values + $criteria = $values->buildPkeyCriteria(); + } else { // it's a primary key, or an array of pks + $criteria = new Criteria(WerkzeugPeer::DATABASE_NAME); + $criteria->add(WerkzeugPeer::ID, (array) $values, Criteria::IN); + // invalidate the cache for this object(s) + foreach ((array) $values as $singleval) { + WerkzeugPeer::removeInstanceFromPool($singleval); + } + } + + // Set the correct dbName + $criteria->setDbName(WerkzeugPeer::DATABASE_NAME); + + $affectedRows = 0; // initialize var to track total num of affected rows + + try { + // use transaction because $criteria could contain info + // for more than one table or we could emulating ON DELETE CASCADE, etc. + $con->beginTransaction(); + + $affectedRows += BasePeer::doDelete($criteria, $con); + WerkzeugPeer::clearRelatedInstancePool(); + $con->commit(); + + return $affectedRows; + } catch (Exception $e) { + $con->rollBack(); + throw $e; + } + } + + /** + * Validates all modified columns of given Werkzeug object. + * If parameter $columns is either a single column name or an array of column names + * than only those columns are validated. + * + * NOTICE: This does not apply to primary or foreign keys for now. + * + * @param Werkzeug $obj The object to validate. + * @param mixed $cols Column name or array of column names. + * + * @return mixed TRUE if all columns are valid or the error message of the first invalid column. + */ + public static function doValidate($obj, $cols = null) + { + $columns = array(); + + if ($cols) { + $dbMap = Propel::getDatabaseMap(WerkzeugPeer::DATABASE_NAME); + $tableMap = $dbMap->getTable(WerkzeugPeer::TABLE_NAME); + + if (! is_array($cols)) { + $cols = array($cols); + } + + foreach ($cols as $colName) { + if ($tableMap->hasColumn($colName)) { + $get = 'get' . $tableMap->getColumn($colName)->getPhpName(); + $columns[$colName] = $obj->$get(); + } + } + } else { + + } + + return BasePeer::doValidate(WerkzeugPeer::DATABASE_NAME, WerkzeugPeer::TABLE_NAME, $columns); + } + + /** + * Retrieve a single object by pkey. + * + * @param int $pk the primary key. + * @param PropelPDO $con the connection to use + * @return Werkzeug + */ + public static function retrieveByPK($pk, PropelPDO $con = null) + { + + if (null !== ($obj = WerkzeugPeer::getInstanceFromPool((string) $pk))) { + return $obj; + } + + if ($con === null) { + $con = Propel::getConnection(WerkzeugPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria = new Criteria(WerkzeugPeer::DATABASE_NAME); + $criteria->add(WerkzeugPeer::ID, $pk); + + $v = WerkzeugPeer::doSelect($criteria, $con); + + return !empty($v) > 0 ? $v[0] : null; + } + + /** + * Retrieve multiple objects by pkey. + * + * @param array $pks List of primary keys + * @param PropelPDO $con the connection to use + * @return Werkzeug[] + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function retrieveByPKs($pks, PropelPDO $con = null) + { + if ($con === null) { + $con = Propel::getConnection(WerkzeugPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $objs = null; + if (empty($pks)) { + $objs = array(); + } else { + $criteria = new Criteria(WerkzeugPeer::DATABASE_NAME); + $criteria->add(WerkzeugPeer::ID, $pks, Criteria::IN); + $objs = WerkzeugPeer::doSelect($criteria, $con); + } + + return $objs; + } + +} // BaseWerkzeugPeer + +// This is the static code needed to register the TableMap for this table with the main Propel class. +// +BaseWerkzeugPeer::buildTableMap(); + diff --git a/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseWerkzeugQuery.php b/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseWerkzeugQuery.php new file mode 100644 index 0000000..812687a --- /dev/null +++ b/verleihnix/Verleihnix/impl/data/build/classes/propel/om/BaseWerkzeugQuery.php @@ -0,0 +1,454 @@ +mergeWith($criteria); + } + + return $query; + } + + /** + * Find object by primary key. + * Propel uses the instance pool to skip the database if the object exists. + * Go fast if the query is untouched. + * + * + * $obj = $c->findPk(12, $con); + * + * + * @param mixed $key Primary key to use for the query + * @param PropelPDO $con an optional connection object + * + * @return Werkzeug|Werkzeug[]|mixed the result, formatted by the current formatter + */ + public function findPk($key, $con = null) + { + if ($key === null) { + return null; + } + if ((null !== ($obj = WerkzeugPeer::getInstanceFromPool((string) $key))) && !$this->formatter) { + // the object is already in the instance pool + return $obj; + } + if ($con === null) { + $con = Propel::getConnection(WerkzeugPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + $this->basePreSelect($con); + if ($this->formatter || $this->modelAlias || $this->with || $this->select + || $this->selectColumns || $this->asColumns || $this->selectModifiers + || $this->map || $this->having || $this->joins) { + return $this->findPkComplex($key, $con); + } else { + return $this->findPkSimple($key, $con); + } + } + + /** + * Alias of findPk to use instance pooling + * + * @param mixed $key Primary key to use for the query + * @param PropelPDO $con A connection object + * + * @return Werkzeug A model object, or null if the key is not found + * @throws PropelException + */ + public function findOneById($key, $con = null) + { + return $this->findPk($key, $con); + } + + /** + * Find object by primary key using raw SQL to go fast. + * Bypass doSelect() and the object formatter by using generated code. + * + * @param mixed $key Primary key to use for the query + * @param PropelPDO $con A connection object + * + * @return Werkzeug A model object, or null if the key is not found + * @throws PropelException + */ + protected function findPkSimple($key, $con) + { + $sql = 'SELECT `id`, `mod`, `typ`, `beschreibung`, `eigentumer`, `zz_bei` FROM `werkzeug` WHERE `id` = :p0'; + try { + $stmt = $con->prepare($sql); + $stmt->bindValue(':p0', $key, PDO::PARAM_INT); + $stmt->execute(); + } catch (Exception $e) { + Propel::log($e->getMessage(), Propel::LOG_ERR); + throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e); + } + $obj = null; + if ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $obj = new Werkzeug(); + $obj->hydrate($row); + WerkzeugPeer::addInstanceToPool($obj, (string) $key); + } + $stmt->closeCursor(); + + return $obj; + } + + /** + * Find object by primary key. + * + * @param mixed $key Primary key to use for the query + * @param PropelPDO $con A connection object + * + * @return Werkzeug|Werkzeug[]|mixed the result, formatted by the current formatter + */ + protected function findPkComplex($key, $con) + { + // As the query uses a PK condition, no limit(1) is necessary. + $criteria = $this->isKeepQuery() ? clone $this : $this; + $stmt = $criteria + ->filterByPrimaryKey($key) + ->doSelect($con); + + return $criteria->getFormatter()->init($criteria)->formatOne($stmt); + } + + /** + * Find objects by primary key + * + * $objs = $c->findPks(array(12, 56, 832), $con); + * + * @param array $keys Primary keys to use for the query + * @param PropelPDO $con an optional connection object + * + * @return PropelObjectCollection|Werkzeug[]|mixed the list of results, formatted by the current formatter + */ + public function findPks($keys, $con = null) + { + if ($con === null) { + $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ); + } + $this->basePreSelect($con); + $criteria = $this->isKeepQuery() ? clone $this : $this; + $stmt = $criteria + ->filterByPrimaryKeys($keys) + ->doSelect($con); + + return $criteria->getFormatter()->init($criteria)->format($stmt); + } + + /** + * Filter the query by primary key + * + * @param mixed $key Primary key to use for the query + * + * @return WerkzeugQuery The current query, for fluid interface + */ + public function filterByPrimaryKey($key) + { + + return $this->addUsingAlias(WerkzeugPeer::ID, $key, Criteria::EQUAL); + } + + /** + * Filter the query by a list of primary keys + * + * @param array $keys The list of primary key to use for the query + * + * @return WerkzeugQuery The current query, for fluid interface + */ + public function filterByPrimaryKeys($keys) + { + + return $this->addUsingAlias(WerkzeugPeer::ID, $keys, Criteria::IN); + } + + /** + * Filter the query on the id column + * + * Example usage: + * + * $query->filterById(1234); // WHERE id = 1234 + * $query->filterById(array(12, 34)); // WHERE id IN (12, 34) + * $query->filterById(array('min' => 12)); // WHERE id >= 12 + * $query->filterById(array('max' => 12)); // WHERE id <= 12 + * + * + * @param mixed $id The value to use as filter. + * Use scalar values for equality. + * Use array values for in_array() equivalent. + * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return WerkzeugQuery The current query, for fluid interface + */ + public function filterById($id = null, $comparison = null) + { + if (is_array($id)) { + $useMinMax = false; + if (isset($id['min'])) { + $this->addUsingAlias(WerkzeugPeer::ID, $id['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($id['max'])) { + $this->addUsingAlias(WerkzeugPeer::ID, $id['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + + return $this->addUsingAlias(WerkzeugPeer::ID, $id, $comparison); + } + + /** + * Filter the query on the mod column + * + * Example usage: + * + * $query->filterByMod(1234); // WHERE mod = 1234 + * $query->filterByMod(array(12, 34)); // WHERE mod IN (12, 34) + * $query->filterByMod(array('min' => 12)); // WHERE mod >= 12 + * $query->filterByMod(array('max' => 12)); // WHERE mod <= 12 + * + * + * @param mixed $mod The value to use as filter. + * Use scalar values for equality. + * Use array values for in_array() equivalent. + * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return WerkzeugQuery The current query, for fluid interface + */ + public function filterByMod($mod = null, $comparison = null) + { + if (is_array($mod)) { + $useMinMax = false; + if (isset($mod['min'])) { + $this->addUsingAlias(WerkzeugPeer::MOD, $mod['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($mod['max'])) { + $this->addUsingAlias(WerkzeugPeer::MOD, $mod['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + + return $this->addUsingAlias(WerkzeugPeer::MOD, $mod, $comparison); + } + + /** + * Filter the query on the typ column + * + * Example usage: + * + * $query->filterByTyp('fooValue'); // WHERE typ = 'fooValue' + * $query->filterByTyp('%fooValue%'); // WHERE typ LIKE '%fooValue%' + * + * + * @param string $typ The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return WerkzeugQuery The current query, for fluid interface + */ + public function filterByTyp($typ = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($typ)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $typ)) { + $typ = str_replace('*', '%', $typ); + $comparison = Criteria::LIKE; + } + } + + return $this->addUsingAlias(WerkzeugPeer::TYP, $typ, $comparison); + } + + /** + * Filter the query on the beschreibung column + * + * Example usage: + * + * $query->filterByBeschreibung('fooValue'); // WHERE beschreibung = 'fooValue' + * $query->filterByBeschreibung('%fooValue%'); // WHERE beschreibung LIKE '%fooValue%' + * + * + * @param string $beschreibung The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return WerkzeugQuery The current query, for fluid interface + */ + public function filterByBeschreibung($beschreibung = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($beschreibung)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $beschreibung)) { + $beschreibung = str_replace('*', '%', $beschreibung); + $comparison = Criteria::LIKE; + } + } + + return $this->addUsingAlias(WerkzeugPeer::BESCHREIBUNG, $beschreibung, $comparison); + } + + /** + * Filter the query on the eigentumer column + * + * Example usage: + * + * $query->filterByEigentumer('fooValue'); // WHERE eigentumer = 'fooValue' + * $query->filterByEigentumer('%fooValue%'); // WHERE eigentumer LIKE '%fooValue%' + * + * + * @param string $eigentumer The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return WerkzeugQuery The current query, for fluid interface + */ + public function filterByEigentumer($eigentumer = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($eigentumer)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $eigentumer)) { + $eigentumer = str_replace('*', '%', $eigentumer); + $comparison = Criteria::LIKE; + } + } + + return $this->addUsingAlias(WerkzeugPeer::EIGENTUMER, $eigentumer, $comparison); + } + + /** + * Filter the query on the zz_bei column + * + * Example usage: + * + * $query->filterByZzBei('fooValue'); // WHERE zz_bei = 'fooValue' + * $query->filterByZzBei('%fooValue%'); // WHERE zz_bei LIKE '%fooValue%' + * + * + * @param string $zzBei The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return WerkzeugQuery The current query, for fluid interface + */ + public function filterByZzBei($zzBei = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($zzBei)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $zzBei)) { + $zzBei = str_replace('*', '%', $zzBei); + $comparison = Criteria::LIKE; + } + } + + return $this->addUsingAlias(WerkzeugPeer::ZZ_BEI, $zzBei, $comparison); + } + + /** + * Exclude object from result + * + * @param Werkzeug $werkzeug Object to remove from the list of results + * + * @return WerkzeugQuery The current query, for fluid interface + */ + public function prune($werkzeug = null) + { + if ($werkzeug) { + $this->addUsingAlias(WerkzeugPeer::ID, $werkzeug->getId(), Criteria::NOT_EQUAL); + } + + return $this; + } + +} diff --git a/verleihnix/Verleihnix/impl/data/build/conf/classmap-propel-conf.php b/verleihnix/Verleihnix/impl/data/build/conf/classmap-propel-conf.php new file mode 100644 index 0000000..399939c --- /dev/null +++ b/verleihnix/Verleihnix/impl/data/build/conf/classmap-propel-conf.php @@ -0,0 +1,27 @@ + 'propel/om/BaseHorbuchQuery.php', + 'BaseKrimiQuery' => 'propel/om/BaseKrimiQuery.php', + 'BaseMedium' => 'propel/om/BaseMedium.php', + 'BaseMediumPeer' => 'propel/om/BaseMediumPeer.php', + 'BaseMediumQuery' => 'propel/om/BaseMediumQuery.php', + 'BaseRomanQuery' => 'propel/om/BaseRomanQuery.php', + 'BaseWerkzeug' => 'propel/om/BaseWerkzeug.php', + 'BaseWerkzeugPeer' => 'propel/om/BaseWerkzeugPeer.php', + 'BaseWerkzeugQuery' => 'propel/om/BaseWerkzeugQuery.php', + 'Horbuch' => 'propel/Horbuch.php', + 'HorbuchQuery' => 'propel/HorbuchQuery.php', + 'Krimi' => 'propel/Krimi.php', + 'KrimiQuery' => 'propel/KrimiQuery.php', + 'Medium' => 'propel/Medium.php', + 'MediumPeer' => 'propel/MediumPeer.php', + 'MediumQuery' => 'propel/MediumQuery.php', + 'MediumTableMap' => 'propel/map/MediumTableMap.php', + 'Roman' => 'propel/Roman.php', + 'RomanQuery' => 'propel/RomanQuery.php', + 'Werkzeug' => 'propel/Werkzeug.php', + 'WerkzeugPeer' => 'propel/WerkzeugPeer.php', + 'WerkzeugQuery' => 'propel/WerkzeugQuery.php', + 'WerkzeugTableMap' => 'propel/map/WerkzeugTableMap.php', +); \ No newline at end of file diff --git a/verleihnix/Verleihnix/impl/data/build/conf/propel-conf.php b/verleihnix/Verleihnix/impl/data/build/conf/propel-conf.php new file mode 100644 index 0000000..1cf25a8 --- /dev/null +++ b/verleihnix/Verleihnix/impl/data/build/conf/propel-conf.php @@ -0,0 +1,29 @@ + + array ( + 'mkrimi' => + array ( + 'adapter' => 'mysql', + 'connection' => + array ( + 'dsn' => 'mysql:host=localhost;dbname=mkrimi', + 'user' => 'mkrimi', + 'password' => 'mkrimi', + 'settings' => + array ( + 'charset' => + array ( + 'value' => 'utf8', + ), + ), + ), + ), + 'default' => 'mkrimi', + ), + 'generator_version' => '1.7.2-dev', +); +$conf['classmap'] = include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'classmap-propel-conf.php'); +return $conf; \ No newline at end of file diff --git a/verleihnix/Verleihnix/impl/data/build/sql/createDB.sh b/verleihnix/Verleihnix/impl/data/build/sql/createDB.sh new file mode 100755 index 0000000..e8fc384 --- /dev/null +++ b/verleihnix/Verleihnix/impl/data/build/sql/createDB.sh @@ -0,0 +1 @@ +mysql -umkrimi -pmkrimi mkrimi = 4.1.x +# It "suspends judgement" for fkey relationships until are tables are set. +SET FOREIGN_KEY_CHECKS = 0; + +-- --------------------------------------------------------------------- +-- medium +-- --------------------------------------------------------------------- + +DROP TABLE IF EXISTS `medium`; + +CREATE TABLE `medium` +( + `id` INTEGER NOT NULL AUTO_INCREMENT, + `mod` INTEGER NOT NULL, + `autor` VARCHAR(100) NOT NULL, + `titel` VARCHAR(100) NOT NULL, + `eigentumer` VARCHAR(100) NOT NULL, + `zz_bei` VARCHAR(100) NOT NULL, + `kommentar` VARCHAR(100) NOT NULL, + `class_key` INTEGER NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM; + +-- --------------------------------------------------------------------- +-- werkzeug +-- --------------------------------------------------------------------- + +DROP TABLE IF EXISTS `werkzeug`; + +CREATE TABLE `werkzeug` +( + `id` INTEGER NOT NULL AUTO_INCREMENT, + `mod` INTEGER NOT NULL, + `typ` VARCHAR(100) NOT NULL, + `beschreibung` VARCHAR(100) NOT NULL, + `eigentumer` VARCHAR(100) NOT NULL, + `zz_bei` VARCHAR(100) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM; + +# This restores the fkey checks, after having unset them earlier +SET FOREIGN_KEY_CHECKS = 1; diff --git a/verleihnix/Verleihnix/impl/data/build/sql/sqldb.map b/verleihnix/Verleihnix/impl/data/build/sql/sqldb.map new file mode 100644 index 0000000..5e129b7 --- /dev/null +++ b/verleihnix/Verleihnix/impl/data/build/sql/sqldb.map @@ -0,0 +1,2 @@ +# Sqlfile -> Database map +schema.sql=mkrimi -- 2.39.5 From 996b5fdc6f6aa459d079154b3025cc4c24e802b4 Mon Sep 17 00:00:00 2001 From: Michael Wagner Date: Sat, 6 Dec 2025 16:11:40 +0100 Subject: [PATCH 4/4] eclipse-cpp added --- Configure | 53 +++++++++++++++++++++++-------------- debian/eclipse-cpp.control | 11 ++++++++ debian/eclipse-cpp.cp | 6 +++++ debian/eclipse-cpp.postinst | 23 ++++++++++++++++ debian/eclipse-cpp.prepare | 33 +++++++++++++++++++++++ 5 files changed, 106 insertions(+), 20 deletions(-) create mode 100644 debian/eclipse-cpp.control create mode 100755 debian/eclipse-cpp.cp create mode 100755 debian/eclipse-cpp.postinst create mode 100755 debian/eclipse-cpp.prepare diff --git a/Configure b/Configure index 325f710..9eddd7d 100755 --- a/Configure +++ b/Configure @@ -8,38 +8,50 @@ PROJECT = libcob-ocesql mconnect webssh USAGE } -if [ -z "$1" ] -then +function write_deb { + # $1: package name + # $2: compile_typ + cat <debian/$1.conf +# generated by configure +compile_type=$2 +target_type=DEB +ANY_DEB +} + +function write_changelog { + # $1: package name + cat <debian/$1.changelog +projects (%VERSION%-%BUILD%) unstable; urgency=medium + * generated by configure + -- Michael Wagner Fri, 05 Dec 2025 20:03:04 +0100 +CHANGELOG +} + +if [ -z "$1" ]; then usage exit 7 fi case $1 in -mconnect) - cat <debian/mconnect.conf -# generated by configure -compile_type=NONE -target_type=DEB -MCONNECT - mconfigure mconnect +eclipse-cpp) + write_deb eclipse-cpp NONE + write_changelog eclipse-cpp + mconfigure -V eclipse-cpp ;; - + libcob-ocesql) - cat <debian/libcob-ocesql.conf -# generated by configure -compile_type=ANY -target_type=DEB -OCESQL + write_deb libcob-ocesql ANY mconfigure -v 1.4 libcob-ocesql ;; +mconnect) + write_deb mconnect ANY + mconfigure mconnect + ;; + webssh) - cat <debian/webssh.conf -# generated by configure -compile_type=ANY -target_type=DEB -WEBSSH + write_deb webssh ANY mconfigure -V webssh ;; @@ -49,3 +61,4 @@ WEBSSH exit 25 ;; esac + diff --git a/debian/eclipse-cpp.control b/debian/eclipse-cpp.control new file mode 100644 index 0000000..7fa2a84 --- /dev/null +++ b/debian/eclipse-cpp.control @@ -0,0 +1,11 @@ +Source: projects +Section: main +Priority: optional +Maintainer: Michael Wagner +Build-Depends: git, mbuild + +Package: eclipse-cpp +Architecture: _DEB_HOST_ARCH +Depends: build-essential, gdb +Description: http://eclipse.org + diff --git a/debian/eclipse-cpp.cp b/debian/eclipse-cpp.cp new file mode 100755 index 0000000..f1c5305 --- /dev/null +++ b/debian/eclipse-cpp.cp @@ -0,0 +1,6 @@ +#!/bin/bash +set -e + +mkdir -p $1/opt/eclipse-cpp/ +cp -a Downloads/eclipse/* $1/opt/eclipse-cpp/ + diff --git a/debian/eclipse-cpp.postinst b/debian/eclipse-cpp.postinst new file mode 100755 index 0000000..83b1889 --- /dev/null +++ b/debian/eclipse-cpp.postinst @@ -0,0 +1,23 @@ +#!/bin/bash +set -e + +for user in user nutzer kurs; do + if [ -d /home/$user ]; then + echo "Install eclipse for user $user" + pushd /home/$user >/dev/null + + if [ -d Schreibtisch ]; then + pushd Schreibtisch >/dev/null + su $user -c "ln -sf /opt/eclipse-cpp/eclipse ." + popd >/dev/null + fi + + if [ -d Desktop ]; then + pushd Desktop >/dev/null + su $user -c "ln -sf /opt/eclipse-cpp/eclipse ." + popd >/dev/null + fi + popd >/dev/null + fi +done + diff --git a/debian/eclipse-cpp.prepare b/debian/eclipse-cpp.prepare new file mode 100755 index 0000000..169b64f --- /dev/null +++ b/debian/eclipse-cpp.prepare @@ -0,0 +1,33 @@ +#!/bin/bash +set -e + +ECPP_PATTERN="eclipse-cpp*.tar.gz" + +# check, if there is exactly 1 eclipse-cpp*.tar.gz in Downloads +pushd Downloads >/dev/null + if [ $(ls $ECPP_PATTERN| wc -l) -ne 1 ]; then + echo "Es muss genau ein $ECPP_PATTERN in Downloads sein." + exit 8 + fi + eclipse_cpp_tgz=$(ls $ECPP_PATTERN) + + # entpacke tar.gz + if [ -d eclipse ]; then + rm -r eclipse + fi + tar xf $eclipse_cpp_tgz +popd >/dev/null + +# bestimme eclipse version +eversion=${eclipse_cpp_tgz#eclipse-cpp-} +eversion=${eversion%-linux*} +echo "version=$eversion" >> debian/rules.pre +echo "export version=$eversion" >> debian/setenv.sh + +# bestimme arch +arch=${eclipse_cpp_tgz#*gtk-} +arch=${arch%.tar.gz} +echo "arch=$arch" >> debian/rules.pre +echo "export arch=$arch" >> debian/setenv.sh + + -- 2.39.5