From 05bb769be02e21bd99808d96587c6d04b582abd8 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 25 Nov 2015 18:28:10 +0100 Subject: [PATCH] upgrade trinity + js cookie alert --- .../BlogBundle/Resources/public/js/main.js | 2 +- vendor/trinity/src/Trinity/.svn/wc.db | Bin 1787904 -> 1793024 bytes .../Controller/DefaultController.php | 1 + .../DependencyInjection/Configuration.php | 1 + .../views/Default/mainMenu.html.twig | 2 +- .../Resources/config/services.xml | 1 + .../Bundle/MediaBundle/Model/Media.php | 12 +- .../Bundle/MediaBundle/Model/TypePeer.php | 3 + .../Model/map/CategoryTableMap.php | 2 +- .../MediaBundle/Model/map/MediaTableMap.php | 4 +- .../MediaBundle/Model/map/TypeTableMap.php | 2 +- .../MediaBundle/Model/om/BaseTypePeer.php | 63 +- .../MediaBundle/Resources/config/schema.xml | 8 +- .../views/MediaTinyMCEAdmin/index.html.twig | 5 +- .../Model/map/BlockTableMap.php | 100 - .../Model/map/BlockVersionTableMap.php | 85 - .../Model/map/ModelTableMap.php | 99 - .../Model/map/ModelVersionTableMap.php | 84 - .../map/NewsletterRecipientsTableMap.php | 76 - .../Model/map/NewsletterTableMap.php | 88 - .../NewsletterBundle/Model/om/BaseBlock.php | 2275 -------------- .../Model/om/BaseBlockPeer.php | 1158 ------- .../Model/om/BaseBlockQuery.php | 992 ------ .../Model/om/BaseBlockVersion.php | 1660 ---------- .../Model/om/BaseBlockVersionPeer.php | 1065 ------- .../Model/om/BaseBlockVersionQuery.php | 896 ------ .../NewsletterBundle/Model/om/BaseModel.php | 2658 ----------------- .../Model/om/BaseModelPeer.php | 915 ------ .../Model/om/BaseModelQuery.php | 988 ------ .../Model/om/BaseModelVersion.php | 1722 ----------- .../Model/om/BaseModelVersionPeer.php | 1060 ------- .../Model/om/BaseModelVersionQuery.php | 941 ------ .../Model/om/BaseNewsletter.php | 2058 ------------- .../Model/om/BaseNewsletterPeer.php | 1053 ------- .../Model/om/BaseNewsletterQuery.php | 931 ------ .../Model/om/BaseNewsletterRecipients.php | 1063 ------- .../Model/om/BaseNewsletterRecipientsPeer.php | 1392 --------- .../om/BaseNewsletterRecipientsQuery.php | 581 ---- .../Resources/config/propel/schema.xml | 4 +- .../Trinity/Bundle/UserBundle/Flash/Flash.php | 51 +- .../VarsEditorBundle/Service/Config.php | 32 +- 41 files changed, 134 insertions(+), 23999 deletions(-) delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/BlockTableMap.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/BlockVersionTableMap.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/ModelTableMap.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/ModelVersionTableMap.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/NewsletterRecipientsTableMap.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/NewsletterTableMap.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlock.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlockPeer.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlockQuery.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlockVersion.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlockVersionPeer.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlockVersionQuery.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModel.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModelPeer.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModelQuery.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModelVersion.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModelVersionPeer.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModelVersionQuery.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletter.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletterPeer.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletterQuery.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletterRecipients.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletterRecipientsPeer.php delete mode 100644 vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletterRecipientsQuery.php diff --git a/src/Deblan/Bundle/BlogBundle/Resources/public/js/main.js b/src/Deblan/Bundle/BlogBundle/Resources/public/js/main.js index 7cca30e..7a4ae32 100644 --- a/src/Deblan/Bundle/BlogBundle/Resources/public/js/main.js +++ b/src/Deblan/Bundle/BlogBundle/Resources/public/js/main.js @@ -143,7 +143,7 @@ if (!readCookie('private_life')) { createCookie('private_life', '1', 365); $('#cookie').removeClass('hide').css({ - top: 57, + bottom: 0, position: 'absolute', width: '100%' }); diff --git a/vendor/trinity/src/Trinity/.svn/wc.db b/vendor/trinity/src/Trinity/.svn/wc.db index 6cd32bbf60aad6a2749cd4b57b58fbbe462e50b1..1aaf2929e31d40b1823683c895f94c0fbc7c10c9 100644 GIT binary patch delta 57745 zcma&P349dA@;E*{GdsJpcTTbikVGICBTfY0V5et1Vj))0Yy*|0ewDHR8TygqUKlClLY*}_xbxeg3wi^yz+nSTk9Ck%4E9t<~}Y_L>_^wU?*>=_t zHaB_ytQMkeP;%6)bog#Tll0`tSzScis$|aWR_tD^wn(%sNgkfvQnan5M$lnSmepvx z{uV{;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endor/trinity/src/Trinity/Bundle/AdminMenuBundle/Controller/DefaultController.php index d93f20b..22a96a1 100644 --- a/vendor/trinity/src/Trinity/Bundle/AdminMenuBundle/Controller/DefaultController.php +++ b/vendor/trinity/src/Trinity/Bundle/AdminMenuBundle/Controller/DefaultController.php @@ -72,6 +72,7 @@ class DefaultController extends Controller 'menu_render' => $renderer->render($menu), 'menu' => $menu, 'logo' => $this->config['logo'], + 'route_name' => $this->config['route_name'], ) ); } diff --git a/vendor/trinity/src/Trinity/Bundle/AdminMenuBundle/DependencyInjection/Configuration.php b/vendor/trinity/src/Trinity/Bundle/AdminMenuBundle/DependencyInjection/Configuration.php index e11e074..e665717 100644 --- a/vendor/trinity/src/Trinity/Bundle/AdminMenuBundle/DependencyInjection/Configuration.php +++ b/vendor/trinity/src/Trinity/Bundle/AdminMenuBundle/DependencyInjection/Configuration.php @@ -27,6 +27,7 @@ class Configuration implements ConfigurationInterface ->scalarNode('template')->defaultValue('TrinityAdminMenuBundle:Default:mainMenu.html.twig')->end() ->scalarNode('title')->defaultValue('Admin menu')->end() ->scalarNode('logo')->defaultValue('/bundles/trinityadminmenu/img/logo.png')->end() + ->scalarNode('route_name')->defaultValue('TrinityDashBoardBundle_index')->end() ->arrayNode('items') ->prototype('array') diff --git a/vendor/trinity/src/Trinity/Bundle/AdminMenuBundle/Resources/views/Default/mainMenu.html.twig b/vendor/trinity/src/Trinity/Bundle/AdminMenuBundle/Resources/views/Default/mainMenu.html.twig index a77afbe..8781f8d 100644 --- a/vendor/trinity/src/Trinity/Bundle/AdminMenuBundle/Resources/views/Default/mainMenu.html.twig +++ b/vendor/trinity/src/Trinity/Bundle/AdminMenuBundle/Resources/views/Default/mainMenu.html.twig @@ -3,7 +3,7 @@

{% if logo %} - + {% if logo|slice(0, 4) == 'Trinity\Bundle\ContentManagerBundle\Routing\NodeLoader Trinity\Bundle\ContentManagerBundle\Routing\Cache Trinity\Bundle\ContentManagerBundle\Twig\Extension\ObjectExtension + Trinity\Bundle\ContentManagerBundle\Twig\Extension\SeasonsExtension Trinity\Bundle\ContentManagerBundle\Twig\Extension\PageExtension Trinity\Bundle\ContentManagerBundle\Twig\Extension\UrlExtension Trinity\Bundle\ContentManagerBundle\Twig\Extension\BlockExtension diff --git a/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/Media.php b/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/Media.php index 11ce462..9b736d5 100644 --- a/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/Media.php +++ b/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/Media.php @@ -57,17 +57,21 @@ class Media extends BaseMedia return basename($this->getFile()); } - public function save(\PropelPDO $con = null) + public function setTypeId($id) { - if (!$this->getTypeId() && $this->getFileAsFile()) { - $this->setTypeId(TypePeer::getTypeFor($this->getFileAsFile())); + if ($id === '') { + $id = null; } - return parent::save($con); + parent::setTypeId($id); } public function postSave(\PropelPDO $con = null) { + // if (!$this->getTypeId() && $this->getFileAsFile()) { + // $this->setTypeId(TypePeer::getTypeFor($this->getFileAsFile())); + // } + if ($this->hasUploadedFile()) { if (@getimagesize($this->getWebPathForFile())) { Image::create($this->getWebPathForFile()) diff --git a/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/TypePeer.php b/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/TypePeer.php index d4d3ab7..e99c9fe 100644 --- a/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/TypePeer.php +++ b/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/TypePeer.php @@ -9,7 +9,10 @@ class TypePeer extends BaseTypePeer { public static function getTypeFor(File $file) { + var_dump($file->getMimeType()); $type = TypeQuery::create()->findOneByMimes('%'.$file->getMimeType().'%'); + var_dump($type); + die; return count($type) ? $type->getId() : null; } diff --git a/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/map/CategoryTableMap.php b/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/map/CategoryTableMap.php index 694482f..7f6e078 100644 --- a/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/map/CategoryTableMap.php +++ b/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/map/CategoryTableMap.php @@ -60,7 +60,7 @@ class CategoryTableMap extends TableMap public function buildRelations() { $this->addRelation('CategoryRelatedByCategoryId', 'Trinity\\Bundle\\MediaBundle\\Model\\Category', RelationMap::MANY_TO_ONE, array('category_id' => 'id', ), null, 'CASCADE'); - $this->addRelation('Media', 'Trinity\\Bundle\\MediaBundle\\Model\\Media', RelationMap::ONE_TO_MANY, array('id' => 'category_id', ), null, 'CASCADE', 'Medias'); + $this->addRelation('Media', 'Trinity\\Bundle\\MediaBundle\\Model\\Media', RelationMap::ONE_TO_MANY, array('id' => 'category_id', ), null, null, 'Medias'); $this->addRelation('CategoryRelatedById', 'Trinity\\Bundle\\MediaBundle\\Model\\Category', RelationMap::ONE_TO_MANY, array('id' => 'category_id', ), null, 'CASCADE', 'CategoriesRelatedById'); } // buildRelations() diff --git a/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/map/MediaTableMap.php b/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/map/MediaTableMap.php index 9c1759f..c16d730 100644 --- a/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/map/MediaTableMap.php +++ b/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/map/MediaTableMap.php @@ -56,8 +56,8 @@ class MediaTableMap extends TableMap */ public function buildRelations() { - $this->addRelation('Type', 'Trinity\\Bundle\\MediaBundle\\Model\\Type', RelationMap::MANY_TO_ONE, array('type_id' => 'id', ), null, 'CASCADE'); - $this->addRelation('Category', 'Trinity\\Bundle\\MediaBundle\\Model\\Category', RelationMap::MANY_TO_ONE, array('category_id' => 'id', ), null, 'CASCADE'); + $this->addRelation('Type', 'Trinity\\Bundle\\MediaBundle\\Model\\Type', RelationMap::MANY_TO_ONE, array('type_id' => 'id', ), 'SET NULL', 'SET NULL'); + $this->addRelation('Category', 'Trinity\\Bundle\\MediaBundle\\Model\\Category', RelationMap::MANY_TO_ONE, array('category_id' => 'id', ), null, null); } // buildRelations() /** diff --git a/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/map/TypeTableMap.php b/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/map/TypeTableMap.php index 0e91ed9..dd2295a 100644 --- a/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/map/TypeTableMap.php +++ b/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/map/TypeTableMap.php @@ -59,7 +59,7 @@ class TypeTableMap extends TableMap */ public function buildRelations() { - $this->addRelation('Media', 'Trinity\\Bundle\\MediaBundle\\Model\\Media', RelationMap::ONE_TO_MANY, array('id' => 'type_id', ), null, 'CASCADE', 'Medias'); + $this->addRelation('Media', 'Trinity\\Bundle\\MediaBundle\\Model\\Media', RelationMap::ONE_TO_MANY, array('id' => 'type_id', ), 'SET NULL', 'SET NULL', 'Medias'); } // buildRelations() /** diff --git a/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/om/BaseTypePeer.php b/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/om/BaseTypePeer.php index 5fa15dc..0165a59 100644 --- a/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/om/BaseTypePeer.php +++ b/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/om/BaseTypePeer.php @@ -9,6 +9,7 @@ use \PDOStatement; use \Propel; use \PropelException; use \PropelPDO; +use Trinity\Bundle\MediaBundle\Model\MediaPeer; use Trinity\Bundle\MediaBundle\Model\Type; use Trinity\Bundle\MediaBundle\Model\TypePeer; use Trinity\Bundle\MediaBundle\Model\TypeQuery; @@ -417,6 +418,9 @@ abstract class BaseTypePeer */ public static function clearRelatedInstancePool() { + // Invalidate objects in MediaPeer instance pool, + // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. + MediaPeer::clearInstancePool(); } /** @@ -646,6 +650,7 @@ abstract class BaseTypePeer // use transaction because $criteria could contain info // for more than one table or we could emulating ON DELETE CASCADE, etc. $con->beginTransaction(); + TypePeer::doOnDeleteSetNull(new Criteria(TypePeer::DATABASE_NAME), $con); $affectedRows += BasePeer::doDeleteAll(TypePeer::TABLE_NAME, $con, TypePeer::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 @@ -679,24 +684,14 @@ abstract class BaseTypePeer } 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. - TypePeer::clearInstancePool(); // rename for clarity $criteria = clone $values; } elseif ($values instanceof Type) { // it's a model object - // invalidate the cache for this single object - TypePeer::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(TypePeer::DATABASE_NAME); $criteria->add(TypePeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - TypePeer::removeInstanceFromPool($singleval); - } } // Set the correct dbName @@ -709,6 +704,23 @@ abstract class BaseTypePeer // for more than one table or we could emulating ON DELETE CASCADE, etc. $con->beginTransaction(); + // cloning the Criteria in case it's modified by doSelect() or doSelectStmt() + $c = clone $criteria; + TypePeer::doOnDeleteSetNull($c, $con); + + // 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). + if ($values instanceof Criteria) { + TypePeer::clearInstancePool(); + } elseif ($values instanceof Type) { // it's a model object + TypePeer::removeInstanceFromPool($values); + } else { // it's a primary key, or an array of pks + foreach ((array) $values as $singleval) { + TypePeer::removeInstanceFromPool($singleval); + } + } + $affectedRows += BasePeer::doDelete($criteria, $con); TypePeer::clearRelatedInstancePool(); $con->commit(); @@ -720,6 +732,37 @@ abstract class BaseTypePeer } } + /** + * This is a method for emulating ON DELETE SET NULL DBs that don't support this + * feature (like MySQL or SQLite). + * + * This method is not very speedy because it must perform a query first to get + * the implicated records and then perform the deletes by calling those Peer classes. + * + * This method should be used within a transaction if possible. + * + * @param Criteria $criteria + * @param PropelPDO $con + * @return void + */ + protected static function doOnDeleteSetNull(Criteria $criteria, PropelPDO $con) + { + + // first find the objects that are implicated by the $criteria + $objects = TypePeer::doSelect($criteria, $con); + foreach ($objects as $obj) { + + // set fkey col in related Media rows to null + $selectCriteria = new Criteria(TypePeer::DATABASE_NAME); + $updateValues = new Criteria(TypePeer::DATABASE_NAME); + $selectCriteria->add(MediaPeer::TYPE_ID, $obj->getId()); + $updateValues->add(MediaPeer::TYPE_ID, null); + + BasePeer::doUpdate($selectCriteria, $updateValues, $con); // use BasePeer because generated Peer doUpdate() methods only update using pkey + + } + } + /** * Validates all modified columns of given Type object. * If parameter $columns is either a single column name or an array of column names diff --git a/vendor/trinity/src/Trinity/Bundle/MediaBundle/Resources/config/schema.xml b/vendor/trinity/src/Trinity/Bundle/MediaBundle/Resources/config/schema.xml index 8b92397..e71b1c4 100644 --- a/vendor/trinity/src/Trinity/Bundle/MediaBundle/Resources/config/schema.xml +++ b/vendor/trinity/src/Trinity/Bundle/MediaBundle/Resources/config/schema.xml @@ -2,13 +2,13 @@ - - + + - + - + diff --git a/vendor/trinity/src/Trinity/Bundle/MediaBundle/Resources/views/MediaTinyMCEAdmin/index.html.twig b/vendor/trinity/src/Trinity/Bundle/MediaBundle/Resources/views/MediaTinyMCEAdmin/index.html.twig index 9bbcd84..0c48d32 100644 --- a/vendor/trinity/src/Trinity/Bundle/MediaBundle/Resources/views/MediaTinyMCEAdmin/index.html.twig +++ b/vendor/trinity/src/Trinity/Bundle/MediaBundle/Resources/views/MediaTinyMCEAdmin/index.html.twig @@ -145,13 +145,12 @@ var mimes = $(this).data('mime'); var iconType = $(this).data('icon'); - if(mimes) { + if (mimes) { tinymce.EditorManager.activeEditor.insertContent(''); - }else{ + } else{ tinymce.EditorManager.activeEditor.insertContent(''); } - close(); }); diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/BlockTableMap.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/BlockTableMap.php deleted file mode 100644 index 8729ab9..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/BlockTableMap.php +++ /dev/null @@ -1,100 +0,0 @@ -setName('nws_block'); - $this->setPhpName('Block'); - $this->setClassname('Trinity\\Bundle\\NewsletterBundle\\Model\\Block'); - $this->setPackage('vendor.trinity.src.Trinity.Bundle.NewsletterBundle.Model'); - $this->setUseIdGenerator(true); - $this->setSingleTableInheritance(true); - // columns - $this->addPrimaryKey('id', 'Id', 'INTEGER', true, null, null); - $this->addColumn('name', 'Name', 'VARCHAR', true, 255, null); - $this->addColumn('value', 'Value', 'LONGVARCHAR', false, null, null); - $this->addColumn('class_key', 'ClassKey', 'VARCHAR', false, 255, null); - $this->addColumn('template', 'Template', 'VARCHAR', false, 255, null); - $this->addForeignKey('model_id', 'ModelId', 'INTEGER', 'nws_model', 'id', false, null, null); - $this->addColumn('created_at', 'CreatedAt', 'TIMESTAMP', false, null, null); - $this->addColumn('updated_at', 'UpdatedAt', 'TIMESTAMP', false, null, null); - $this->addColumn('version', 'Version', 'INTEGER', false, null, 0); - $this->addColumn('version_created_at', 'VersionCreatedAt', 'TIMESTAMP', false, null, null); - $this->addColumn('version_created_by', 'VersionCreatedBy', 'VARCHAR', false, 100, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('Model', 'Trinity\\Bundle\\NewsletterBundle\\Model\\Model', RelationMap::MANY_TO_ONE, array('model_id' => 'id', ), 'CASCADE', null); - $this->addRelation('BlockVersion', 'Trinity\\Bundle\\NewsletterBundle\\Model\\BlockVersion', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'BlockVersions'); - } // buildRelations() - - /** - * - * Gets the list of behaviors registered for this table - * - * @return array Associative array (name => parameters) of behaviors - */ - public function getBehaviors() - { - return array( - 'timestampable' => array ( - 'create_column' => 'created_at', - 'update_column' => 'updated_at', - 'disable_updated_at' => 'false', -), - 'versionable' => array ( - 'version_column' => 'version', - 'version_table' => '', - 'log_created_at' => 'true', - 'log_created_by' => 'true', - 'log_comment' => 'false', - 'version_created_at_column' => 'version_created_at', - 'version_created_by_column' => 'version_created_by', - 'version_comment_column' => 'version_comment', -), - 'event' => array ( -), - 'extend' => array ( -), - ); - } // getBehaviors() - -} // BlockTableMap diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/BlockVersionTableMap.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/BlockVersionTableMap.php deleted file mode 100644 index a7ea326..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/BlockVersionTableMap.php +++ /dev/null @@ -1,85 +0,0 @@ -setName('nws_block_version'); - $this->setPhpName('BlockVersion'); - $this->setClassname('Trinity\\Bundle\\NewsletterBundle\\Model\\BlockVersion'); - $this->setPackage('vendor.trinity.src.Trinity.Bundle.NewsletterBundle.Model'); - $this->setUseIdGenerator(false); - $this->setSingleTableInheritance(true); - // columns - $this->addForeignPrimaryKey('id', 'Id', 'INTEGER' , 'nws_block', 'id', true, null, null); - $this->addColumn('name', 'Name', 'VARCHAR', true, 255, null); - $this->addColumn('value', 'Value', 'LONGVARCHAR', false, null, null); - $this->addColumn('class_key', 'ClassKey', 'VARCHAR', false, 255, null); - $this->addColumn('template', 'Template', 'VARCHAR', false, 255, null); - $this->addColumn('model_id', 'ModelId', 'INTEGER', false, null, null); - $this->addColumn('created_at', 'CreatedAt', 'TIMESTAMP', false, null, null); - $this->addColumn('updated_at', 'UpdatedAt', 'TIMESTAMP', false, null, null); - $this->addPrimaryKey('version', 'Version', 'INTEGER', true, null, 0); - $this->addColumn('version_created_at', 'VersionCreatedAt', 'TIMESTAMP', false, null, null); - $this->addColumn('version_created_by', 'VersionCreatedBy', 'VARCHAR', false, 100, null); - $this->addColumn('model_id_version', 'ModelIdVersion', 'INTEGER', false, null, 0); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('Block', 'Trinity\\Bundle\\NewsletterBundle\\Model\\Block', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null); - } // buildRelations() - - /** - * - * Gets the list of behaviors registered for this table - * - * @return array Associative array (name => parameters) of behaviors - */ - public function getBehaviors() - { - return array( - 'event' => array ( -), - 'extend' => array ( -), - ); - } // getBehaviors() - -} // BlockVersionTableMap diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/ModelTableMap.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/ModelTableMap.php deleted file mode 100644 index 6f98869..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/ModelTableMap.php +++ /dev/null @@ -1,99 +0,0 @@ -setName('nws_model'); - $this->setPhpName('Model'); - $this->setClassname('Trinity\\Bundle\\NewsletterBundle\\Model\\Model'); - $this->setPackage('vendor.trinity.src.Trinity.Bundle.NewsletterBundle.Model'); - $this->setUseIdGenerator(true); - $this->setSingleTableInheritance(true); - // columns - $this->addPrimaryKey('id', 'Id', 'INTEGER', true, null, null); - $this->addColumn('name', 'Name', 'VARCHAR', true, 255, null); - $this->addColumn('template', 'Template', 'VARCHAR', true, 255, null); - $this->addColumn('class_key', 'ClassKey', 'VARCHAR', false, 255, null); - $this->addColumn('created_at', 'CreatedAt', 'TIMESTAMP', false, null, null); - $this->addColumn('updated_at', 'UpdatedAt', 'TIMESTAMP', false, null, null); - $this->addColumn('version', 'Version', 'INTEGER', false, null, 0); - $this->addColumn('version_created_at', 'VersionCreatedAt', 'TIMESTAMP', false, null, null); - $this->addColumn('version_created_by', 'VersionCreatedBy', 'VARCHAR', false, 100, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('Newsletter', 'Trinity\\Bundle\\NewsletterBundle\\Model\\Newsletter', RelationMap::ONE_TO_MANY, array('id' => 'model_id', ), null, null, 'Newsletters'); - $this->addRelation('Block', 'Trinity\\Bundle\\NewsletterBundle\\Model\\Block', RelationMap::ONE_TO_MANY, array('id' => 'model_id', ), 'CASCADE', null, 'Blocks'); - $this->addRelation('ModelVersion', 'Trinity\\Bundle\\NewsletterBundle\\Model\\ModelVersion', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ModelVersions'); - } // buildRelations() - - /** - * - * Gets the list of behaviors registered for this table - * - * @return array Associative array (name => parameters) of behaviors - */ - public function getBehaviors() - { - return array( - 'timestampable' => array ( - 'create_column' => 'created_at', - 'update_column' => 'updated_at', - 'disable_updated_at' => 'false', -), - 'versionable' => array ( - 'version_column' => 'version', - 'version_table' => '', - 'log_created_at' => 'true', - 'log_created_by' => 'true', - 'log_comment' => 'false', - 'version_created_at_column' => 'version_created_at', - 'version_created_by_column' => 'version_created_by', - 'version_comment_column' => 'version_comment', -), - 'event' => array ( -), - 'extend' => array ( -), - ); - } // getBehaviors() - -} // ModelTableMap diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/ModelVersionTableMap.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/ModelVersionTableMap.php deleted file mode 100644 index 7a4d5db..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/ModelVersionTableMap.php +++ /dev/null @@ -1,84 +0,0 @@ -setName('nws_model_version'); - $this->setPhpName('ModelVersion'); - $this->setClassname('Trinity\\Bundle\\NewsletterBundle\\Model\\ModelVersion'); - $this->setPackage('vendor.trinity.src.Trinity.Bundle.NewsletterBundle.Model'); - $this->setUseIdGenerator(false); - $this->setSingleTableInheritance(true); - // columns - $this->addForeignPrimaryKey('id', 'Id', 'INTEGER' , 'nws_model', 'id', true, null, null); - $this->addColumn('name', 'Name', 'VARCHAR', true, 255, null); - $this->addColumn('template', 'Template', 'VARCHAR', true, 255, null); - $this->addColumn('class_key', 'ClassKey', 'VARCHAR', false, 255, null); - $this->addColumn('created_at', 'CreatedAt', 'TIMESTAMP', false, null, null); - $this->addColumn('updated_at', 'UpdatedAt', 'TIMESTAMP', false, null, null); - $this->addPrimaryKey('version', 'Version', 'INTEGER', true, null, 0); - $this->addColumn('version_created_at', 'VersionCreatedAt', 'TIMESTAMP', false, null, null); - $this->addColumn('version_created_by', 'VersionCreatedBy', 'VARCHAR', false, 100, null); - $this->addColumn('nws_block_ids', 'NwsBlockIds', 'ARRAY', false, null, null); - $this->addColumn('nws_block_versions', 'NwsBlockVersions', 'ARRAY', false, null, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('Model', 'Trinity\\Bundle\\NewsletterBundle\\Model\\Model', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null); - } // buildRelations() - - /** - * - * Gets the list of behaviors registered for this table - * - * @return array Associative array (name => parameters) of behaviors - */ - public function getBehaviors() - { - return array( - 'event' => array ( -), - 'extend' => array ( -), - ); - } // getBehaviors() - -} // ModelVersionTableMap diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/NewsletterRecipientsTableMap.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/NewsletterRecipientsTableMap.php deleted file mode 100644 index b2a966b..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/NewsletterRecipientsTableMap.php +++ /dev/null @@ -1,76 +0,0 @@ -setName('nws_newsletter_recipients'); - $this->setPhpName('NewsletterRecipients'); - $this->setClassname('Trinity\\Bundle\\NewsletterBundle\\Model\\NewsletterRecipients'); - $this->setPackage('vendor.trinity.src.Trinity.Bundle.NewsletterBundle.Model'); - $this->setUseIdGenerator(false); - $this->setIsCrossRef(true); - // columns - $this->addForeignPrimaryKey('nws_newsletter_id', 'NwsNewsletterId', 'INTEGER' , 'nws_newsletter', 'id', true, null, null); - $this->addForeignPrimaryKey('fos_group_id', 'FosGroupId', 'INTEGER' , 'fos_group', 'id', true, null, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('Newsletter', 'Trinity\\Bundle\\NewsletterBundle\\Model\\Newsletter', RelationMap::MANY_TO_ONE, array('nws_newsletter_id' => 'id', ), null, null); - $this->addRelation('Group', 'FOS\\UserBundle\\Propel\\Group', RelationMap::MANY_TO_ONE, array('fos_group_id' => 'id', ), null, null); - } // buildRelations() - - /** - * - * Gets the list of behaviors registered for this table - * - * @return array Associative array (name => parameters) of behaviors - */ - public function getBehaviors() - { - return array( - 'event' => array ( -), - 'extend' => array ( -), - ); - } // getBehaviors() - -} // NewsletterRecipientsTableMap diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/NewsletterTableMap.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/NewsletterTableMap.php deleted file mode 100644 index 5208738..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/map/NewsletterTableMap.php +++ /dev/null @@ -1,88 +0,0 @@ -setName('nws_newsletter'); - $this->setPhpName('Newsletter'); - $this->setClassname('Trinity\\Bundle\\NewsletterBundle\\Model\\Newsletter'); - $this->setPackage('vendor.trinity.src.Trinity.Bundle.NewsletterBundle.Model'); - $this->setUseIdGenerator(true); - // columns - $this->addPrimaryKey('id', 'Id', 'INTEGER', true, null, null); - $this->addColumn('name', 'Name', 'VARCHAR', true, 255, null); - $this->addColumn('sender_name', 'SenderName', 'VARCHAR', false, 255, null); - $this->addColumn('sender_email', 'SenderEmail', 'VARCHAR', false, 255, null); - $this->addForeignKey('model_id', 'ModelId', 'INTEGER', 'nws_model', 'id', false, null, null); - $this->addColumn('email_listing', 'EmailListing', 'LONGVARCHAR', false, null, null); - $this->addColumn('sent_at', 'SentAt', 'TIMESTAMP', false, null, null); - $this->addColumn('created_at', 'CreatedAt', 'TIMESTAMP', false, null, null); - $this->addColumn('updated_at', 'UpdatedAt', 'TIMESTAMP', false, null, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('Model', 'Trinity\\Bundle\\NewsletterBundle\\Model\\Model', RelationMap::MANY_TO_ONE, array('model_id' => 'id', ), null, null); - $this->addRelation('NewsletterRecipients', 'Trinity\\Bundle\\NewsletterBundle\\Model\\NewsletterRecipients', RelationMap::ONE_TO_MANY, array('id' => 'nws_newsletter_id', ), null, null, 'NewsletterRecipientss'); - $this->addRelation('Group', 'FOS\\UserBundle\\Propel\\Group', RelationMap::MANY_TO_MANY, array(), null, null, 'Groups'); - } // buildRelations() - - /** - * - * Gets the list of behaviors registered for this table - * - * @return array Associative array (name => parameters) of behaviors - */ - public function getBehaviors() - { - return array( - 'timestampable' => array ( - 'create_column' => 'created_at', - 'update_column' => 'updated_at', - 'disable_updated_at' => 'false', -), - 'event' => array ( -), - 'extend' => array ( -), - ); - } // getBehaviors() - -} // NewsletterTableMap diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlock.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlock.php deleted file mode 100644 index c53aa78..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlock.php +++ /dev/null @@ -1,2275 +0,0 @@ -version = 0; - } - - /** - * Initializes internal state of BaseBlock object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - EventDispatcherProxy::trigger(array('construct','model.construct'), new ModelEvent($this)); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getId() - { - - return $this->id; - } - - /** - * Get the [name] column value. - * - * @return string - */ - public function getName() - { - - return $this->name; - } - - /** - * Get the [value] column value. - * - * @return string - */ - public function getValue() - { - - return $this->value; - } - - /** - * Get the [class_key] column value. - * - * @return string - */ - public function getClassKey() - { - - return $this->class_key; - } - - /** - * Get the [template] column value. - * - * @return string - */ - public function getTemplate() - { - - return $this->template; - } - - /** - * Get the [model_id] column value. - * - * @return int - */ - public function getModelId() - { - - return $this->model_id; - } - - /** - * Get the [optionally formatted] temporal [created_at] column value. - * - * - * @param string $format The date/time format string (either date()-style or strftime()-style). - * If format is null, then the raw DateTime object will be returned. - * @return mixed Formatted date/time value as string or DateTime object (if format is null), null if column is null, and 0 if column value is 0000-00-00 00:00:00 - * @throws PropelException - if unable to parse/validate the date/time value. - */ - public function getCreatedAt($format = null) - { - if ($this->created_at === null) { - return null; - } - - if ($this->created_at === '0000-00-00 00:00:00') { - // while technically this is not a default value of null, - // this seems to be closest in meaning. - return null; - } - - try { - $dt = new DateTime($this->created_at); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->created_at, true), $x); - } - - if ($format === null) { - // Because propel.useDateTimeClass is true, we return a DateTime object. - return $dt; - } - - if (strpos($format, '%') !== false) { - return strftime($format, $dt->format('U')); - } - - return $dt->format($format); - - } - - /** - * Get the [optionally formatted] temporal [updated_at] column value. - * - * - * @param string $format The date/time format string (either date()-style or strftime()-style). - * If format is null, then the raw DateTime object will be returned. - * @return mixed Formatted date/time value as string or DateTime object (if format is null), null if column is null, and 0 if column value is 0000-00-00 00:00:00 - * @throws PropelException - if unable to parse/validate the date/time value. - */ - public function getUpdatedAt($format = null) - { - if ($this->updated_at === null) { - return null; - } - - if ($this->updated_at === '0000-00-00 00:00:00') { - // while technically this is not a default value of null, - // this seems to be closest in meaning. - return null; - } - - try { - $dt = new DateTime($this->updated_at); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->updated_at, true), $x); - } - - if ($format === null) { - // Because propel.useDateTimeClass is true, we return a DateTime object. - return $dt; - } - - if (strpos($format, '%') !== false) { - return strftime($format, $dt->format('U')); - } - - return $dt->format($format); - - } - - /** - * Get the [version] column value. - * - * @return int - */ - public function getVersion() - { - - return $this->version; - } - - /** - * Get the [optionally formatted] temporal [version_created_at] column value. - * - * - * @param string $format The date/time format string (either date()-style or strftime()-style). - * If format is null, then the raw DateTime object will be returned. - * @return mixed Formatted date/time value as string or DateTime object (if format is null), null if column is null, and 0 if column value is 0000-00-00 00:00:00 - * @throws PropelException - if unable to parse/validate the date/time value. - */ - public function getVersionCreatedAt($format = null) - { - if ($this->version_created_at === null) { - return null; - } - - if ($this->version_created_at === '0000-00-00 00:00:00') { - // while technically this is not a default value of null, - // this seems to be closest in meaning. - return null; - } - - try { - $dt = new DateTime($this->version_created_at); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->version_created_at, true), $x); - } - - if ($format === null) { - // Because propel.useDateTimeClass is true, we return a DateTime object. - return $dt; - } - - if (strpos($format, '%') !== false) { - return strftime($format, $dt->format('U')); - } - - return $dt->format($format); - - } - - /** - * Get the [version_created_by] column value. - * - * @return string - */ - public function getVersionCreatedBy() - { - - return $this->version_created_by; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return Block 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[] = BlockPeer::ID; - } - - - return $this; - } // setId() - - /** - * Set the value of [name] column. - * - * @param string $v new value - * @return Block The current object (for fluent API support) - */ - public function setName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->name !== $v) { - $this->name = $v; - $this->modifiedColumns[] = BlockPeer::NAME; - } - - - return $this; - } // setName() - - /** - * Set the value of [value] column. - * - * @param string $v new value - * @return Block The current object (for fluent API support) - */ - public function setValue($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->value !== $v) { - $this->value = $v; - $this->modifiedColumns[] = BlockPeer::VALUE; - } - - - return $this; - } // setValue() - - /** - * Set the value of [class_key] column. - * - * @param string $v new value - * @return Block The current object (for fluent API support) - */ - public function setClassKey($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->class_key !== $v) { - $this->class_key = $v; - $this->modifiedColumns[] = BlockPeer::CLASS_KEY; - } - - - return $this; - } // setClassKey() - - /** - * Set the value of [template] column. - * - * @param string $v new value - * @return Block The current object (for fluent API support) - */ - public function setTemplate($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->template !== $v) { - $this->template = $v; - $this->modifiedColumns[] = BlockPeer::TEMPLATE; - } - - - return $this; - } // setTemplate() - - /** - * Set the value of [model_id] column. - * - * @param int $v new value - * @return Block The current object (for fluent API support) - */ - public function setModelId($v) - { - if ($v !== null && is_numeric($v)) { - $v = (int) $v; - } - - if ($this->model_id !== $v) { - $this->model_id = $v; - $this->modifiedColumns[] = BlockPeer::MODEL_ID; - } - - if ($this->aModel !== null && $this->aModel->getId() !== $v) { - $this->aModel = null; - } - - - return $this; - } // setModelId() - - /** - * Sets the value of [created_at] column to a normalized version of the date/time value specified. - * - * @param mixed $v string, integer (timestamp), or DateTime value. - * Empty strings are treated as null. - * @return Block The current object (for fluent API support) - */ - public function setCreatedAt($v) - { - $dt = PropelDateTime::newInstance($v, null, 'DateTime'); - if ($this->created_at !== null || $dt !== null) { - $currentDateAsString = ($this->created_at !== null && $tmpDt = new DateTime($this->created_at)) ? $tmpDt->format('Y-m-d H:i:s') : null; - $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null; - if ($currentDateAsString !== $newDateAsString) { - $this->created_at = $newDateAsString; - $this->modifiedColumns[] = BlockPeer::CREATED_AT; - } - } // if either are not null - - - return $this; - } // setCreatedAt() - - /** - * Sets the value of [updated_at] column to a normalized version of the date/time value specified. - * - * @param mixed $v string, integer (timestamp), or DateTime value. - * Empty strings are treated as null. - * @return Block The current object (for fluent API support) - */ - public function setUpdatedAt($v) - { - $dt = PropelDateTime::newInstance($v, null, 'DateTime'); - if ($this->updated_at !== null || $dt !== null) { - $currentDateAsString = ($this->updated_at !== null && $tmpDt = new DateTime($this->updated_at)) ? $tmpDt->format('Y-m-d H:i:s') : null; - $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null; - if ($currentDateAsString !== $newDateAsString) { - $this->updated_at = $newDateAsString; - $this->modifiedColumns[] = BlockPeer::UPDATED_AT; - } - } // if either are not null - - - return $this; - } // setUpdatedAt() - - /** - * Set the value of [version] column. - * - * @param int $v new value - * @return Block The current object (for fluent API support) - */ - public function setVersion($v) - { - if ($v !== null && is_numeric($v)) { - $v = (int) $v; - } - - if ($this->version !== $v) { - $this->version = $v; - $this->modifiedColumns[] = BlockPeer::VERSION; - } - - - return $this; - } // setVersion() - - /** - * Sets the value of [version_created_at] column to a normalized version of the date/time value specified. - * - * @param mixed $v string, integer (timestamp), or DateTime value. - * Empty strings are treated as null. - * @return Block The current object (for fluent API support) - */ - public function setVersionCreatedAt($v) - { - $dt = PropelDateTime::newInstance($v, null, 'DateTime'); - if ($this->version_created_at !== null || $dt !== null) { - $currentDateAsString = ($this->version_created_at !== null && $tmpDt = new DateTime($this->version_created_at)) ? $tmpDt->format('Y-m-d H:i:s') : null; - $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null; - if ($currentDateAsString !== $newDateAsString) { - $this->version_created_at = $newDateAsString; - $this->modifiedColumns[] = BlockPeer::VERSION_CREATED_AT; - } - } // if either are not null - - - return $this; - } // setVersionCreatedAt() - - /** - * Set the value of [version_created_by] column. - * - * @param string $v new value - * @return Block The current object (for fluent API support) - */ - public function setVersionCreatedBy($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->version_created_by !== $v) { - $this->version_created_by = $v; - $this->modifiedColumns[] = BlockPeer::VERSION_CREATED_BY; - } - - - return $this; - } // setVersionCreatedBy() - - /** - * 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() - { - if ($this->version !== 0) { - return false; - } - - // 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->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->value = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->class_key = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->template = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->model_id = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null; - $this->created_at = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; - $this->updated_at = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null; - $this->version = ($row[$startcol + 8] !== null) ? (int) $row[$startcol + 8] : null; - $this->version_created_at = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null; - $this->version_created_by = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - $this->postHydrate($row, $startcol, $rehydrate); - - return $startcol + 11; // 11 = BlockPeer::NUM_HYDRATE_COLUMNS. - - } catch (Exception $e) { - throw new PropelException("Error populating Block 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() - { - - if ($this->aModel !== null && $this->model_id !== $this->aModel->getId()) { - $this->aModel = null; - } - } // 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(BlockPeer::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 = BlockPeer::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? - - $this->aModel = null; - $this->collBlockVersions = null; - - } // 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(BlockPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $deleteQuery = BlockQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()); - $ret = $this->preDelete($con); - // event behavior - EventDispatcherProxy::trigger(array('delete.pre','model.delete.pre'), new ModelEvent($this)); - if ($ret) { - $deleteQuery->delete($con); - $this->postDelete($con); - // versionable behavior - // emulate delete cascade - BlockVersionQuery::create() - ->filterByBlock($this) - ->delete($con); - // event behavior - EventDispatcherProxy::trigger(array('delete.post', 'model.delete.post'), new ModelEvent($this)); - $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(BlockPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - // versionable behavior - if ($this->isVersioningNecessary()) { - $this->setVersion($this->isNew() ? 1 : $this->getLastVersionNumber($con) + 1); - if (!$this->isColumnModified(BlockPeer::VERSION_CREATED_AT)) { - $this->setVersionCreatedAt(time()); - } - $createVersion = true; // for postSave hook - } - // event behavior - EventDispatcherProxy::trigger('model.save.pre', new ModelEvent($this)); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - // timestampable behavior - if (!$this->isColumnModified(BlockPeer::CREATED_AT)) { - $this->setCreatedAt(time()); - } - if (!$this->isColumnModified(BlockPeer::UPDATED_AT)) { - $this->setUpdatedAt(time()); - } - // event behavior - EventDispatcherProxy::trigger('model.insert.pre', new ModelEvent($this)); - } else { - $ret = $ret && $this->preUpdate($con); - // timestampable behavior - if ($this->isModified() && !$this->isColumnModified(BlockPeer::UPDATED_AT)) { - $this->setUpdatedAt(time()); - } - // event behavior - EventDispatcherProxy::trigger(array('update.pre', 'model.update.pre'), new ModelEvent($this)); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - // event behavior - EventDispatcherProxy::trigger('model.insert.post', new ModelEvent($this)); - } else { - $this->postUpdate($con); - // event behavior - EventDispatcherProxy::trigger(array('update.post', 'model.update.post'), new ModelEvent($this)); - } - $this->postSave($con); - // versionable behavior - if (isset($createVersion)) { - $this->addVersion($con); - } - // event behavior - EventDispatcherProxy::trigger('model.save.post', new ModelEvent($this)); - BlockPeer::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; - - // We call the save method on the following object(s) if they - // were passed to this object by their corresponding set - // method. This object relates to these object(s) by a - // foreign key reference. - - if ($this->aModel !== null) { - if ($this->aModel->isModified() || $this->aModel->isNew()) { - $affectedRows += $this->aModel->save($con); - } - $this->setModel($this->aModel); - } - - if ($this->isNew() || $this->isModified()) { - // persist changes - if ($this->isNew()) { - $this->doInsert($con); - } else { - $this->doUpdate($con); - } - $affectedRows += 1; - $this->resetModified(); - } - - if ($this->blockVersionsScheduledForDeletion !== null) { - if (!$this->blockVersionsScheduledForDeletion->isEmpty()) { - BlockVersionQuery::create() - ->filterByPrimaryKeys($this->blockVersionsScheduledForDeletion->getPrimaryKeys(false)) - ->delete($con); - $this->blockVersionsScheduledForDeletion = null; - } - } - - if ($this->collBlockVersions !== null) { - foreach ($this->collBlockVersions as $referrerFK) { - if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { - $affectedRows += $referrerFK->save($con); - } - } - } - - $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[] = BlockPeer::ID; - if (null !== $this->id) { - throw new PropelException('Cannot insert a value for auto-increment primary key (' . BlockPeer::ID . ')'); - } - - // check the columns in natural order for more readable SQL queries - if ($this->isColumnModified(BlockPeer::ID)) { - $modifiedColumns[':p' . $index++] = '`id`'; - } - if ($this->isColumnModified(BlockPeer::NAME)) { - $modifiedColumns[':p' . $index++] = '`name`'; - } - if ($this->isColumnModified(BlockPeer::VALUE)) { - $modifiedColumns[':p' . $index++] = '`value`'; - } - if ($this->isColumnModified(BlockPeer::CLASS_KEY)) { - $modifiedColumns[':p' . $index++] = '`class_key`'; - } - if ($this->isColumnModified(BlockPeer::TEMPLATE)) { - $modifiedColumns[':p' . $index++] = '`template`'; - } - if ($this->isColumnModified(BlockPeer::MODEL_ID)) { - $modifiedColumns[':p' . $index++] = '`model_id`'; - } - if ($this->isColumnModified(BlockPeer::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`created_at`'; - } - if ($this->isColumnModified(BlockPeer::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`updated_at`'; - } - if ($this->isColumnModified(BlockPeer::VERSION)) { - $modifiedColumns[':p' . $index++] = '`version`'; - } - if ($this->isColumnModified(BlockPeer::VERSION_CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`version_created_at`'; - } - if ($this->isColumnModified(BlockPeer::VERSION_CREATED_BY)) { - $modifiedColumns[':p' . $index++] = '`version_created_by`'; - } - - $sql = sprintf( - 'INSERT INTO `nws_block` (%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 '`name`': - $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR); - break; - case '`value`': - $stmt->bindValue($identifier, $this->value, PDO::PARAM_STR); - break; - case '`class_key`': - $stmt->bindValue($identifier, $this->class_key, PDO::PARAM_STR); - break; - case '`template`': - $stmt->bindValue($identifier, $this->template, PDO::PARAM_STR); - break; - case '`model_id`': - $stmt->bindValue($identifier, $this->model_id, PDO::PARAM_INT); - break; - case '`created_at`': - $stmt->bindValue($identifier, $this->created_at, PDO::PARAM_STR); - break; - case '`updated_at`': - $stmt->bindValue($identifier, $this->updated_at, PDO::PARAM_STR); - break; - case '`version`': - $stmt->bindValue($identifier, $this->version, PDO::PARAM_INT); - break; - case '`version_created_at`': - $stmt->bindValue($identifier, $this->version_created_at, PDO::PARAM_STR); - break; - case '`version_created_by`': - $stmt->bindValue($identifier, $this->version_created_by, 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(); - - - // We call the validate method on the following object(s) if they - // were passed to this object by their corresponding set - // method. This object relates to these object(s) by a - // foreign key reference. - - if ($this->aModel !== null) { - if (!$this->aModel->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aModel->getValidationFailures()); - } - } - - - if (($retval = BlockPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - if ($this->collBlockVersions !== null) { - foreach ($this->collBlockVersions as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - - $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 = BlockPeer::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->getName(); - break; - case 2: - return $this->getValue(); - break; - case 3: - return $this->getClassKey(); - break; - case 4: - return $this->getTemplate(); - break; - case 5: - return $this->getModelId(); - break; - case 6: - return $this->getCreatedAt(); - break; - case 7: - return $this->getUpdatedAt(); - break; - case 8: - return $this->getVersion(); - break; - case 9: - return $this->getVersionCreatedAt(); - break; - case 10: - return $this->getVersionCreatedBy(); - 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 - * @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false) - { - if (isset($alreadyDumpedObjects['Block'][$this->getPrimaryKey()])) { - return '*RECURSION*'; - } - $alreadyDumpedObjects['Block'][$this->getPrimaryKey()] = true; - $keys = BlockPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getId(), - $keys[1] => $this->getName(), - $keys[2] => $this->getValue(), - $keys[3] => $this->getClassKey(), - $keys[4] => $this->getTemplate(), - $keys[5] => $this->getModelId(), - $keys[6] => $this->getCreatedAt(), - $keys[7] => $this->getUpdatedAt(), - $keys[8] => $this->getVersion(), - $keys[9] => $this->getVersionCreatedAt(), - $keys[10] => $this->getVersionCreatedBy(), - ); - $virtualColumns = $this->virtualColumns; - foreach ($virtualColumns as $key => $virtualColumn) { - $result[$key] = $virtualColumn; - } - - if ($includeForeignObjects) { - if (null !== $this->aModel) { - $result['Model'] = $this->aModel->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); - } - if (null !== $this->collBlockVersions) { - $result['BlockVersions'] = $this->collBlockVersions->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); - } - } - - 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 = BlockPeer::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->setName($value); - break; - case 2: - $this->setValue($value); - break; - case 3: - $this->setClassKey($value); - break; - case 4: - $this->setTemplate($value); - break; - case 5: - $this->setModelId($value); - break; - case 6: - $this->setCreatedAt($value); - break; - case 7: - $this->setUpdatedAt($value); - break; - case 8: - $this->setVersion($value); - break; - case 9: - $this->setVersionCreatedAt($value); - break; - case 10: - $this->setVersionCreatedBy($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 = BlockPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setName($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setValue($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setClassKey($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setTemplate($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setModelId($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setCreatedAt($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setUpdatedAt($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setVersion($arr[$keys[8]]); - if (array_key_exists($keys[9], $arr)) $this->setVersionCreatedAt($arr[$keys[9]]); - if (array_key_exists($keys[10], $arr)) $this->setVersionCreatedBy($arr[$keys[10]]); - } - - /** - * 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(BlockPeer::DATABASE_NAME); - - if ($this->isColumnModified(BlockPeer::ID)) $criteria->add(BlockPeer::ID, $this->id); - if ($this->isColumnModified(BlockPeer::NAME)) $criteria->add(BlockPeer::NAME, $this->name); - if ($this->isColumnModified(BlockPeer::VALUE)) $criteria->add(BlockPeer::VALUE, $this->value); - if ($this->isColumnModified(BlockPeer::CLASS_KEY)) $criteria->add(BlockPeer::CLASS_KEY, $this->class_key); - if ($this->isColumnModified(BlockPeer::TEMPLATE)) $criteria->add(BlockPeer::TEMPLATE, $this->template); - if ($this->isColumnModified(BlockPeer::MODEL_ID)) $criteria->add(BlockPeer::MODEL_ID, $this->model_id); - if ($this->isColumnModified(BlockPeer::CREATED_AT)) $criteria->add(BlockPeer::CREATED_AT, $this->created_at); - if ($this->isColumnModified(BlockPeer::UPDATED_AT)) $criteria->add(BlockPeer::UPDATED_AT, $this->updated_at); - if ($this->isColumnModified(BlockPeer::VERSION)) $criteria->add(BlockPeer::VERSION, $this->version); - if ($this->isColumnModified(BlockPeer::VERSION_CREATED_AT)) $criteria->add(BlockPeer::VERSION_CREATED_AT, $this->version_created_at); - if ($this->isColumnModified(BlockPeer::VERSION_CREATED_BY)) $criteria->add(BlockPeer::VERSION_CREATED_BY, $this->version_created_by); - - 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(BlockPeer::DATABASE_NAME); - $criteria->add(BlockPeer::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 Block (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->setName($this->getName()); - $copyObj->setValue($this->getValue()); - $copyObj->setClassKey($this->getClassKey()); - $copyObj->setTemplate($this->getTemplate()); - $copyObj->setModelId($this->getModelId()); - $copyObj->setCreatedAt($this->getCreatedAt()); - $copyObj->setUpdatedAt($this->getUpdatedAt()); - $copyObj->setVersion($this->getVersion()); - $copyObj->setVersionCreatedAt($this->getVersionCreatedAt()); - $copyObj->setVersionCreatedBy($this->getVersionCreatedBy()); - - if ($deepCopy && !$this->startCopy) { - // important: temporarily setNew(false) because this affects the behavior of - // the getter/setter methods for fkey referrer objects. - $copyObj->setNew(false); - // store object hash to prevent cycle - $this->startCopy = true; - - foreach ($this->getBlockVersions() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addBlockVersion($relObj->copy($deepCopy)); - } - } - - //unflag object copy - $this->startCopy = false; - } // if ($deepCopy) - - 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 Block 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 BlockPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new BlockPeer(); - } - - return self::$peer; - } - - /** - * Declares an association between this object and a Model object. - * - * @param Model $v - * @return Block The current object (for fluent API support) - * @throws PropelException - */ - public function setModel(Model $v = null) - { - if ($v === null) { - $this->setModelId(NULL); - } else { - $this->setModelId($v->getId()); - } - - $this->aModel = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the Model object, it will not be re-added. - if ($v !== null) { - $v->addBlock($this); - } - - - return $this; - } - - - /** - * Get the associated Model object - * - * @param PropelPDO $con Optional Connection object. - * @param $doQuery Executes a query to get the object if required - * @return Model The associated Model object. - * @throws PropelException - */ - public function getModel(PropelPDO $con = null, $doQuery = true) - { - if ($this->aModel === null && ($this->model_id !== null) && $doQuery) { - $this->aModel = ModelQuery::create()->findPk($this->model_id, $con); - /* The following can be used additionally to - guarantee the related object contains a reference - to this object. This level of coupling may, however, be - undesirable since it could result in an only partially populated collection - in the referenced object. - $this->aModel->addBlocks($this); - */ - } - - return $this->aModel; - } - - - /** - * Initializes a collection based on the name of a relation. - * Avoids crafting an 'init[$relationName]s' method name - * that wouldn't work when StandardEnglishPluralizer is used. - * - * @param string $relationName The name of the relation to initialize - * @return void - */ - public function initRelation($relationName) - { - if ('BlockVersion' == $relationName) { - $this->initBlockVersions(); - } - } - - /** - * Clears out the collBlockVersions collection - * - * This does not modify the database; however, it will remove any associated objects, causing - * them to be refetched by subsequent calls to accessor method. - * - * @return Block The current object (for fluent API support) - * @see addBlockVersions() - */ - public function clearBlockVersions() - { - $this->collBlockVersions = null; // important to set this to null since that means it is uninitialized - $this->collBlockVersionsPartial = null; - - return $this; - } - - /** - * reset is the collBlockVersions collection loaded partially - * - * @return void - */ - public function resetPartialBlockVersions($v = true) - { - $this->collBlockVersionsPartial = $v; - } - - /** - * Initializes the collBlockVersions collection. - * - * By default this just sets the collBlockVersions collection to an empty array (like clearcollBlockVersions()); - * however, you may wish to override this method in your stub class to provide setting appropriate - * to your application -- for example, setting the initial array to the values stored in database. - * - * @param boolean $overrideExisting If set to true, the method call initializes - * the collection even if it is not empty - * - * @return void - */ - public function initBlockVersions($overrideExisting = true) - { - if (null !== $this->collBlockVersions && !$overrideExisting) { - return; - } - $this->collBlockVersions = new PropelObjectCollection(); - $this->collBlockVersions->setModel('BlockVersion'); - } - - /** - * Gets an array of BlockVersion objects which contain a foreign key that references this object. - * - * If the $criteria is not null, it is used to always fetch the results from the database. - * Otherwise the results are fetched from the database the first time, then cached. - * Next time the same method is called without $criteria, the cached collection is returned. - * If this Block is new, it will return - * an empty collection or the current collection; the criteria is ignored on a new object. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @return PropelObjectCollection|BlockVersion[] List of BlockVersion objects - * @throws PropelException - */ - public function getBlockVersions($criteria = null, PropelPDO $con = null) - { - $partial = $this->collBlockVersionsPartial && !$this->isNew(); - if (null === $this->collBlockVersions || null !== $criteria || $partial) { - if ($this->isNew() && null === $this->collBlockVersions) { - // return empty collection - $this->initBlockVersions(); - } else { - $collBlockVersions = BlockVersionQuery::create(null, $criteria) - ->filterByBlock($this) - ->find($con); - if (null !== $criteria) { - if (false !== $this->collBlockVersionsPartial && count($collBlockVersions)) { - $this->initBlockVersions(false); - - foreach ($collBlockVersions as $obj) { - if (false == $this->collBlockVersions->contains($obj)) { - $this->collBlockVersions->append($obj); - } - } - - $this->collBlockVersionsPartial = true; - } - - $collBlockVersions->getInternalIterator()->rewind(); - - return $collBlockVersions; - } - - if ($partial && $this->collBlockVersions) { - foreach ($this->collBlockVersions as $obj) { - if ($obj->isNew()) { - $collBlockVersions[] = $obj; - } - } - } - - $this->collBlockVersions = $collBlockVersions; - $this->collBlockVersionsPartial = false; - } - } - - return $this->collBlockVersions; - } - - /** - * Sets a collection of BlockVersion objects related by a one-to-many relationship - * to the current object. - * It will also schedule objects for deletion based on a diff between old objects (aka persisted) - * and new objects from the given Propel collection. - * - * @param PropelCollection $blockVersions A Propel collection. - * @param PropelPDO $con Optional connection object - * @return Block The current object (for fluent API support) - */ - public function setBlockVersions(PropelCollection $blockVersions, PropelPDO $con = null) - { - $blockVersionsToDelete = $this->getBlockVersions(new Criteria(), $con)->diff($blockVersions); - - - //since at least one column in the foreign key is at the same time a PK - //we can not just set a PK to NULL in the lines below. We have to store - //a backup of all values, so we are able to manipulate these items based on the onDelete value later. - $this->blockVersionsScheduledForDeletion = clone $blockVersionsToDelete; - - foreach ($blockVersionsToDelete as $blockVersionRemoved) { - $blockVersionRemoved->setBlock(null); - } - - $this->collBlockVersions = null; - foreach ($blockVersions as $blockVersion) { - $this->addBlockVersion($blockVersion); - } - - $this->collBlockVersions = $blockVersions; - $this->collBlockVersionsPartial = false; - - return $this; - } - - /** - * Returns the number of related BlockVersion objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related BlockVersion objects. - * @throws PropelException - */ - public function countBlockVersions(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - $partial = $this->collBlockVersionsPartial && !$this->isNew(); - if (null === $this->collBlockVersions || null !== $criteria || $partial) { - if ($this->isNew() && null === $this->collBlockVersions) { - return 0; - } - - if ($partial && !$criteria) { - return count($this->getBlockVersions()); - } - $query = BlockVersionQuery::create(null, $criteria); - if ($distinct) { - $query->distinct(); - } - - return $query - ->filterByBlock($this) - ->count($con); - } - - return count($this->collBlockVersions); - } - - /** - * Method called to associate a BaseBlockVersion object to this object - * through the BaseBlockVersion foreign key attribute. - * - * @param BaseBlockVersion $l BaseBlockVersion - * @return Block The current object (for fluent API support) - */ - public function addBlockVersion(BaseBlockVersion $l) - { - if ($this->collBlockVersions === null) { - $this->initBlockVersions(); - $this->collBlockVersionsPartial = true; - } - - if (!in_array($l, $this->collBlockVersions->getArrayCopy(), true)) { // only add it if the **same** object is not already associated - $this->doAddBlockVersion($l); - - if ($this->blockVersionsScheduledForDeletion and $this->blockVersionsScheduledForDeletion->contains($l)) { - $this->blockVersionsScheduledForDeletion->remove($this->blockVersionsScheduledForDeletion->search($l)); - } - } - - return $this; - } - - /** - * @param BlockVersion $blockVersion The blockVersion object to add. - */ - protected function doAddBlockVersion($blockVersion) - { - $this->collBlockVersions[]= $blockVersion; - $blockVersion->setBlock($this); - } - - /** - * @param BlockVersion $blockVersion The blockVersion object to remove. - * @return Block The current object (for fluent API support) - */ - public function removeBlockVersion($blockVersion) - { - if ($this->getBlockVersions()->contains($blockVersion)) { - $this->collBlockVersions->remove($this->collBlockVersions->search($blockVersion)); - if (null === $this->blockVersionsScheduledForDeletion) { - $this->blockVersionsScheduledForDeletion = clone $this->collBlockVersions; - $this->blockVersionsScheduledForDeletion->clear(); - } - $this->blockVersionsScheduledForDeletion[]= clone $blockVersion; - $blockVersion->setBlock(null); - } - - return $this; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->name = null; - $this->value = null; - $this->class_key = null; - $this->template = null; - $this->model_id = null; - $this->created_at = null; - $this->updated_at = null; - $this->version = null; - $this->version_created_at = null; - $this->version_created_by = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->alreadyInClearAllReferencesDeep = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $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; - if ($this->collBlockVersions) { - foreach ($this->collBlockVersions as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->aModel instanceof Persistent) { - $this->aModel->clearAllReferences($deep); - } - - $this->alreadyInClearAllReferencesDeep = false; - } // if ($deep) - - if ($this->collBlockVersions instanceof PropelCollection) { - $this->collBlockVersions->clearIterator(); - } - $this->collBlockVersions = null; - $this->aModel = null; - } - - /** - * return the string representation of this object - * - * @return string - */ - public function __toString() - { - return (string) $this->exportTo(BlockPeer::DEFAULT_STRING_FORMAT); - } - - /** - * return true is the object is in saving state - * - * @return boolean - */ - public function isAlreadyInSave() - { - return $this->alreadyInSave; - } - - // timestampable behavior - - /** - * Mark the current object so that the update date doesn't get updated during next save - * - * @return Block The current object (for fluent API support) - */ - public function keepUpdateDateUnchanged() - { - $this->modifiedColumns[] = BlockPeer::UPDATED_AT; - - return $this; - } - - // versionable behavior - - /** - * Enforce a new Version of this object upon next save. - * - * @return Block - */ - public function enforceVersioning() - { - $this->enforceVersion = true; - - return $this; - } - - /** - * Checks whether the current state must be recorded as a version - * - * @param PropelPDO $con An optional PropelPDO connection to use. - * - * @return boolean - */ - public function isVersioningNecessary($con = null) - { - if ($this->alreadyInSave) { - return false; - } - - if ($this->enforceVersion) { - return true; - } - - if (BlockPeer::isVersioningEnabled() && ($this->isNew() || $this->isModified() || $this->isDeleted())) { - return true; - } - if (null !== ($object = $this->getModel($con)) && $object->isVersioningNecessary($con)) { - return true; - } - - - return false; - } - - /** - * Creates a version of the current object and saves it. - * - * @param PropelPDO $con the connection to use - * - * @return BlockVersion A version object - */ - public function addVersion($con = null) - { - $this->enforceVersion = false; - - $version = new BlockVersion(); - $version->setId($this->getId()); - $version->setName($this->getName()); - $version->setValue($this->getValue()); - $version->setClassKey($this->getClassKey()); - $version->setTemplate($this->getTemplate()); - $version->setModelId($this->getModelId()); - $version->setCreatedAt($this->getCreatedAt()); - $version->setUpdatedAt($this->getUpdatedAt()); - $version->setVersion($this->getVersion()); - $version->setVersionCreatedAt($this->getVersionCreatedAt()); - $version->setVersionCreatedBy($this->getVersionCreatedBy()); - $version->setBlock($this); - if (($related = $this->getModel($con)) && $related->getVersion()) { - $version->setModelIdVersion($related->getVersion()); - } - $version->save($con); - - return $version; - } - - /** - * Sets the properties of the current object to the value they had at a specific version - * - * @param integer $versionNumber The version number to read - * @param PropelPDO $con the connection to use - * - * @return Block The current object (for fluent API support) - * @throws PropelException - if no object with the given version can be found. - */ - public function toVersion($versionNumber, $con = null) - { - $version = $this->getOneVersion($versionNumber, $con); - if (!$version) { - throw new PropelException(sprintf('No Block object found with version %d', $versionNumber)); - } - $this->populateFromVersion($version, $con); - - return $this; - } - - /** - * Sets the properties of the curent object to the value they had at a specific version - * - * @param BlockVersion $version The version object to use - * @param PropelPDO $con the connection to use - * @param array $loadedObjects objects thats been loaded in a chain of populateFromVersion calls on referrer or fk objects. - * - * @return Block The current object (for fluent API support) - */ - public function populateFromVersion($version, $con = null, &$loadedObjects = array()) - { - - $loadedObjects['Block'][$version->getId()][$version->getVersion()] = $this; - $this->setId($version->getId()); - $this->setName($version->getName()); - $this->setValue($version->getValue()); - $this->setClassKey($version->getClassKey()); - $this->setTemplate($version->getTemplate()); - $this->setModelId($version->getModelId()); - $this->setCreatedAt($version->getCreatedAt()); - $this->setUpdatedAt($version->getUpdatedAt()); - $this->setVersion($version->getVersion()); - $this->setVersionCreatedAt($version->getVersionCreatedAt()); - $this->setVersionCreatedBy($version->getVersionCreatedBy()); - if ($fkValue = $version->getModelId()) { - if (isset($loadedObjects['Model']) && isset($loadedObjects['Model'][$fkValue]) && isset($loadedObjects['Model'][$fkValue][$version->getModelIdVersion()])) { - $related = $loadedObjects['Model'][$fkValue][$version->getModelIdVersion()]; - } else { - $related = new Model(); - $relatedVersion = ModelVersionQuery::create() - ->filterById($fkValue) - ->filterByVersion($version->getModelIdVersion()) - ->findOne($con); - $related->populateFromVersion($relatedVersion, $con, $loadedObjects); - $related->setNew(false); - } - $this->setModel($related); - } - - return $this; - } - - /** - * Gets the latest persisted version number for the current object - * - * @param PropelPDO $con the connection to use - * - * @return integer - */ - public function getLastVersionNumber($con = null) - { - $v = BlockVersionQuery::create() - ->filterByBlock($this) - ->orderByVersion('desc') - ->findOne($con); - if (!$v) { - return 0; - } - - return $v->getVersion(); - } - - /** - * Checks whether the current object is the latest one - * - * @param PropelPDO $con the connection to use - * - * @return boolean - */ - public function isLastVersion($con = null) - { - return $this->getLastVersionNumber($con) == $this->getVersion(); - } - - /** - * Retrieves a version object for this entity and a version number - * - * @param integer $versionNumber The version number to read - * @param PropelPDO $con the connection to use - * - * @return BlockVersion A version object - */ - public function getOneVersion($versionNumber, $con = null) - { - return BlockVersionQuery::create() - ->filterByBlock($this) - ->filterByVersion($versionNumber) - ->findOne($con); - } - - /** - * Gets all the versions of this object, in incremental order - * - * @param PropelPDO $con the connection to use - * - * @return PropelObjectCollection A list of BlockVersion objects - */ - public function getAllVersions($con = null) - { - $criteria = new Criteria(); - $criteria->addAscendingOrderByColumn(BlockVersionPeer::VERSION); - - return $this->getBlockVersions($criteria, $con); - } - - /** - * Compares the current object with another of its version. - * - * print_r($book->compareVersion(1)); - * => array( - * '1' => array('Title' => 'Book title at version 1'), - * '2' => array('Title' => 'Book title at version 2') - * ); - * - * - * @param integer $versionNumber - * @param string $keys Main key used for the result diff (versions|columns) - * @param PropelPDO $con the connection to use - * @param array $ignoredColumns The columns to exclude from the diff. - * - * @return array A list of differences - */ - public function compareVersion($versionNumber, $keys = 'columns', $con = null, $ignoredColumns = array()) - { - $fromVersion = $this->toArray(); - $toVersion = $this->getOneVersion($versionNumber, $con)->toArray(); - - return $this->computeDiff($fromVersion, $toVersion, $keys, $ignoredColumns); - } - - /** - * Compares two versions of the current object. - * - * print_r($book->compareVersions(1, 2)); - * => array( - * '1' => array('Title' => 'Book title at version 1'), - * '2' => array('Title' => 'Book title at version 2') - * ); - * - * - * @param integer $fromVersionNumber - * @param integer $toVersionNumber - * @param string $keys Main key used for the result diff (versions|columns) - * @param PropelPDO $con the connection to use - * @param array $ignoredColumns The columns to exclude from the diff. - * - * @return array A list of differences - */ - public function compareVersions($fromVersionNumber, $toVersionNumber, $keys = 'columns', $con = null, $ignoredColumns = array()) - { - $fromVersion = $this->getOneVersion($fromVersionNumber, $con)->toArray(); - $toVersion = $this->getOneVersion($toVersionNumber, $con)->toArray(); - - return $this->computeDiff($fromVersion, $toVersion, $keys, $ignoredColumns); - } - - /** - * Computes the diff between two versions. - * - * print_r($this->computeDiff(1, 2)); - * => array( - * '1' => array('Title' => 'Book title at version 1'), - * '2' => array('Title' => 'Book title at version 2') - * ); - * - * - * @param array $fromVersion An array representing the original version. - * @param array $toVersion An array representing the destination version. - * @param string $keys Main key used for the result diff (versions|columns). - * @param array $ignoredColumns The columns to exclude from the diff. - * - * @return array A list of differences - */ - protected function computeDiff($fromVersion, $toVersion, $keys = 'columns', $ignoredColumns = array()) - { - $fromVersionNumber = $fromVersion['Version']; - $toVersionNumber = $toVersion['Version']; - $ignoredColumns = array_merge(array( - 'Version', - 'VersionCreatedAt', - 'VersionCreatedBy', - ), $ignoredColumns); - $diff = array(); - foreach ($fromVersion as $key => $value) { - if (in_array($key, $ignoredColumns)) { - continue; - } - if ($toVersion[$key] != $value) { - switch ($keys) { - case 'versions': - $diff[$fromVersionNumber][$key] = $value; - $diff[$toVersionNumber][$key] = $toVersion[$key]; - break; - default: - $diff[$key] = array( - $fromVersionNumber => $value, - $toVersionNumber => $toVersion[$key], - ); - break; - } - } - } - - return $diff; - } - /** - * retrieve the last $number versions. - * - * @param integer $number the number of record to return. - * @param BlockVersionQuery|Criteria $criteria Additional criteria to filter. - * @param PropelPDO $con An optional connection to use. - * - * @return PropelCollection|BlockVersion[] List of BlockVersion objects - */ - public function getLastVersions($number = 10, $criteria = null, PropelPDO $con = null) - { - $criteria = BlockVersionQuery::create(null, $criteria); - $criteria->addDescendingOrderByColumn(BlockVersionPeer::VERSION); - $criteria->limit($number); - - return $this->getBlockVersions($criteria, $con); - } - // event behavior - public function preCommit(\PropelPDO $con = null){} - public function preCommitSave(\PropelPDO $con = null){} - public function preCommitDelete(\PropelPDO $con = null){} - public function preCommitUpdate(\PropelPDO $con = null){} - public function preCommitInsert(\PropelPDO $con = null){} - public function preRollback(\PropelPDO $con = null){} - public function preRollbackSave(\PropelPDO $con = null){} - public function preRollbackDelete(\PropelPDO $con = null){} - public function preRollbackUpdate(\PropelPDO $con = null){} - public function preRollbackInsert(\PropelPDO $con = null){} - -} diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlockPeer.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlockPeer.php deleted file mode 100644 index b73a71c..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlockPeer.php +++ /dev/null @@ -1,1158 +0,0 @@ - array ('Id', 'Name', 'Value', 'ClassKey', 'Template', 'ModelId', 'CreatedAt', 'UpdatedAt', 'Version', 'VersionCreatedAt', 'VersionCreatedBy', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'name', 'value', 'classKey', 'template', 'modelId', 'createdAt', 'updatedAt', 'version', 'versionCreatedAt', 'versionCreatedBy', ), - BasePeer::TYPE_COLNAME => array (BlockPeer::ID, BlockPeer::NAME, BlockPeer::VALUE, BlockPeer::CLASS_KEY, BlockPeer::TEMPLATE, BlockPeer::MODEL_ID, BlockPeer::CREATED_AT, BlockPeer::UPDATED_AT, BlockPeer::VERSION, BlockPeer::VERSION_CREATED_AT, BlockPeer::VERSION_CREATED_BY, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'VALUE', 'CLASS_KEY', 'TEMPLATE', 'MODEL_ID', 'CREATED_AT', 'UPDATED_AT', 'VERSION', 'VERSION_CREATED_AT', 'VERSION_CREATED_BY', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'value', 'class_key', 'template', 'model_id', 'created_at', 'updated_at', 'version', 'version_created_at', 'version_created_by', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ) - ); - - /** - * holds an array of keys for quick access to the fieldnames array - * - * first dimension keys are the type constants - * e.g. BlockPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 - */ - protected static $fieldKeys = array ( - BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Name' => 1, 'Value' => 2, 'ClassKey' => 3, 'Template' => 4, 'ModelId' => 5, 'CreatedAt' => 6, 'UpdatedAt' => 7, 'Version' => 8, 'VersionCreatedAt' => 9, 'VersionCreatedBy' => 10, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'name' => 1, 'value' => 2, 'classKey' => 3, 'template' => 4, 'modelId' => 5, 'createdAt' => 6, 'updatedAt' => 7, 'version' => 8, 'versionCreatedAt' => 9, 'versionCreatedBy' => 10, ), - BasePeer::TYPE_COLNAME => array (BlockPeer::ID => 0, BlockPeer::NAME => 1, BlockPeer::VALUE => 2, BlockPeer::CLASS_KEY => 3, BlockPeer::TEMPLATE => 4, BlockPeer::MODEL_ID => 5, BlockPeer::CREATED_AT => 6, BlockPeer::UPDATED_AT => 7, BlockPeer::VERSION => 8, BlockPeer::VERSION_CREATED_AT => 9, BlockPeer::VERSION_CREATED_BY => 10, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'VALUE' => 2, 'CLASS_KEY' => 3, 'TEMPLATE' => 4, 'MODEL_ID' => 5, 'CREATED_AT' => 6, 'UPDATED_AT' => 7, 'VERSION' => 8, 'VERSION_CREATED_AT' => 9, 'VERSION_CREATED_BY' => 10, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'value' => 2, 'class_key' => 3, 'template' => 4, 'model_id' => 5, 'created_at' => 6, 'updated_at' => 7, 'version' => 8, 'version_created_at' => 9, 'version_created_by' => 10, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ) - ); - - /** - * 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 = BlockPeer::getFieldNames($toType); - $key = isset(BlockPeer::$fieldKeys[$fromType][$name]) ? BlockPeer::$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(BlockPeer::$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, BlockPeer::$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 BlockPeer::$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. BlockPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(BlockPeer::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(BlockPeer::ID); - $criteria->addSelectColumn(BlockPeer::NAME); - $criteria->addSelectColumn(BlockPeer::VALUE); - $criteria->addSelectColumn(BlockPeer::CLASS_KEY); - $criteria->addSelectColumn(BlockPeer::TEMPLATE); - $criteria->addSelectColumn(BlockPeer::MODEL_ID); - $criteria->addSelectColumn(BlockPeer::CREATED_AT); - $criteria->addSelectColumn(BlockPeer::UPDATED_AT); - $criteria->addSelectColumn(BlockPeer::VERSION); - $criteria->addSelectColumn(BlockPeer::VERSION_CREATED_AT); - $criteria->addSelectColumn(BlockPeer::VERSION_CREATED_BY); - } else { - $criteria->addSelectColumn($alias . '.id'); - $criteria->addSelectColumn($alias . '.name'); - $criteria->addSelectColumn($alias . '.value'); - $criteria->addSelectColumn($alias . '.class_key'); - $criteria->addSelectColumn($alias . '.template'); - $criteria->addSelectColumn($alias . '.model_id'); - $criteria->addSelectColumn($alias . '.created_at'); - $criteria->addSelectColumn($alias . '.updated_at'); - $criteria->addSelectColumn($alias . '.version'); - $criteria->addSelectColumn($alias . '.version_created_at'); - $criteria->addSelectColumn($alias . '.version_created_by'); - } - } - - /** - * 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(BlockPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - BlockPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count - $criteria->setDbName(BlockPeer::DATABASE_NAME); // Set the correct dbName - - if ($con === null) { - $con = Propel::getConnection(BlockPeer::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 Block - * @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 = BlockPeer::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 BlockPeer::populateObjects(BlockPeer::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(BlockPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - BlockPeer::addSelectColumns($criteria); - } - - // Set the correct dbName - $criteria->setDbName(BlockPeer::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 Block $obj A Block 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 - BlockPeer::$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 Block 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 Block) { - $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 Block object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value,true))); - throw $e; - } - - unset(BlockPeer::$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 Block 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(BlockPeer::$instances[$key])) { - return BlockPeer::$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 (BlockPeer::$instances as $instance) { - $instance->clearAllReferences(true); - } - } - BlockPeer::$instances = array(); - } - - /** - * Method to invalidate the instance pool of all tables related to nws_block - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - // Invalidate objects in BlockVersionPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - BlockVersionPeer::clearInstancePool(); - } - - /** - * 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 = BlockPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = BlockPeer::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 = BlockPeer::getOMClass($row, 0); - $cls = substr('.'.$cls, strrpos('.'.$cls, '.') + 1); - $obj = new $cls(); - $obj->hydrate($row); - $results[] = $obj; - BlockPeer::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 (Block object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = BlockPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = BlockPeer::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 + BlockPeer::NUM_HYDRATE_COLUMNS; - } else { - $cls = BlockPeer::getOMClass($row, $startcol); - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - BlockPeer::addInstanceToPool($obj, $key); - } - - return array($obj, $col); - } - - - /** - * Returns the number of rows matching criteria, joining the related Model table - * - * @param Criteria $criteria - * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead. - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return int Number of matching rows. - */ - public static function doCountJoinModel(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - // we're going to 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(BlockPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - BlockPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count - - // Set the correct dbName - $criteria->setDbName(BlockPeer::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(BlockPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(BlockPeer::MODEL_ID, ModelPeer::ID, $join_behavior); - - $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 a collection of Block objects pre-filled with their Model objects. - * @param Criteria $criteria - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return array Array of Block objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinModel(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(BlockPeer::DATABASE_NAME); - } - - BlockPeer::addSelectColumns($criteria); - $startcol = BlockPeer::NUM_HYDRATE_COLUMNS; - ModelPeer::addSelectColumns($criteria); - - $criteria->addJoin(BlockPeer::MODEL_ID, ModelPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = BlockPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = BlockPeer::getInstanceFromPool($key1))) { - // We no longer rehydrate the object, since this can cause data loss. - // See http://www.propelorm.org/ticket/509 - // $obj1->hydrate($row, 0, true); // rehydrate - } else { - - $omClass = BlockPeer::getOMClass($row, 0); - $cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1); - - $obj1 = new $cls(); - $obj1->hydrate($row); - BlockPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = ModelPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = ModelPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $omClass = ModelPeer::getOMClass($row, $startcol); - $cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - ModelPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (Block) to $obj2 (Model) - $obj2->addBlock($obj1); - - } // if joined row was not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - - return $results; - } - - - /** - * Returns the number of rows matching criteria, joining all related tables - * - * @param Criteria $criteria - * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead. - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return int Number of matching rows. - */ - public static function doCountJoinAll(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - // we're going to 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(BlockPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - BlockPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count - - // Set the correct dbName - $criteria->setDbName(BlockPeer::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(BlockPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(BlockPeer::MODEL_ID, ModelPeer::ID, $join_behavior); - - $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 a collection of Block objects pre-filled with all related objects. - * - * @param Criteria $criteria - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return array Array of Block objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(BlockPeer::DATABASE_NAME); - } - - BlockPeer::addSelectColumns($criteria); - $startcol2 = BlockPeer::NUM_HYDRATE_COLUMNS; - - ModelPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + ModelPeer::NUM_HYDRATE_COLUMNS; - - $criteria->addJoin(BlockPeer::MODEL_ID, ModelPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = BlockPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = BlockPeer::getInstanceFromPool($key1))) { - // We no longer rehydrate the object, since this can cause data loss. - // See http://www.propelorm.org/ticket/509 - // $obj1->hydrate($row, 0, true); // rehydrate - } else { - $omClass = BlockPeer::getOMClass($row, 0); - $cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1); - - $obj1 = new $cls(); - $obj1->hydrate($row); - BlockPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined Model rows - - $key2 = ModelPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = ModelPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $omClass = ModelPeer::getOMClass($row, $startcol2); - $cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - ModelPeer::addInstanceToPool($obj2, $key2); - } // if obj2 loaded - - // Add the $obj1 (Block) to the collection in $obj2 (Model) - $obj2->addBlock($obj1); - } // if joined row not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - - return $results; - } - - /** - * 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(BlockPeer::DATABASE_NAME)->getTable(BlockPeer::TABLE_NAME); - } - - /** - * Add a TableMap instance to the database for this peer class. - */ - public static function buildTableMap() - { - $dbMap = Propel::getDatabaseMap(BaseBlockPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseBlockPeer::TABLE_NAME)) { - $dbMap->addTableObject(new \Trinity\Bundle\NewsletterBundle\Model\map\BlockTableMap()); - } - } - - /** - * 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 = $row[$colnum + 3]; - $omClass = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1); - - } catch (Exception $e) { - throw new PropelException('Unable to get OM class.', $e); - } - - - $event = new DetectOMClassEvent($omClass); - EventDispatcherProxy::trigger('om.detect', $event); - if($event->isDetected()){ - return $event->getDetectedClass(); - } - - return $omClass; - } - - /** - * Performs an INSERT on the database, given a Block or Criteria object. - * - * @param mixed $values Criteria or Block 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(BlockPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from Block object - } - - if ($criteria->containsKey(BlockPeer::ID) && $criteria->keyContainsValue(BlockPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.BlockPeer::ID.')'); - } - - - // Set the correct dbName - $criteria->setDbName(BlockPeer::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 Block or Criteria object. - * - * @param mixed $values Criteria or Block 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(BlockPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(BlockPeer::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(BlockPeer::ID); - $value = $criteria->remove(BlockPeer::ID); - if ($value) { - $selectCriteria->add(BlockPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(BlockPeer::TABLE_NAME); - } - - } else { // $values is Block object - $criteria = $values->buildCriteria(); // gets full criteria - $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s) - } - - // set the correct dbName - $criteria->setDbName(BlockPeer::DATABASE_NAME); - - return BasePeer::doUpdate($selectCriteria, $criteria, $con); - } - - /** - * Deletes all rows from the nws_block 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(BlockPeer::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 += BlockPeer::doOnDeleteCascade(new Criteria(BlockPeer::DATABASE_NAME), $con); - $affectedRows += BasePeer::doDeleteAll(BlockPeer::TABLE_NAME, $con, BlockPeer::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). - BlockPeer::clearInstancePool(); - BlockPeer::clearRelatedInstancePool(); - $con->commit(); - - return $affectedRows; - } catch (Exception $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs a DELETE on the database, given a Block or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or Block 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(BlockPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof Block) { // it's a model object - // create criteria based on pk values - $criteria = $values->buildPkeyCriteria(); - } else { // it's a primary key, or an array of pks - $criteria = new Criteria(BlockPeer::DATABASE_NAME); - $criteria->add(BlockPeer::ID, (array) $values, Criteria::IN); - } - - // Set the correct dbName - $criteria->setDbName(BlockPeer::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(); - - // cloning the Criteria in case it's modified by doSelect() or doSelectStmt() - $c = clone $criteria; - $affectedRows += BlockPeer::doOnDeleteCascade($c, $con); - - // 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). - if ($values instanceof Criteria) { - BlockPeer::clearInstancePool(); - } elseif ($values instanceof Block) { // it's a model object - BlockPeer::removeInstanceFromPool($values); - } else { // it's a primary key, or an array of pks - foreach ((array) $values as $singleval) { - BlockPeer::removeInstanceFromPool($singleval); - } - } - - $affectedRows += BasePeer::doDelete($criteria, $con); - BlockPeer::clearRelatedInstancePool(); - $con->commit(); - - return $affectedRows; - } catch (Exception $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * This is a method for emulating ON DELETE CASCADE for DBs that don't support this - * feature (like MySQL or SQLite). - * - * This method is not very speedy because it must perform a query first to get - * the implicated records and then perform the deletes by calling those Peer classes. - * - * This method should be used within a transaction if possible. - * - * @param Criteria $criteria - * @param PropelPDO $con - * @return int The number of affected rows (if supported by underlying database driver). - */ - protected static function doOnDeleteCascade(Criteria $criteria, PropelPDO $con) - { - // initialize var to track total num of affected rows - $affectedRows = 0; - - // first find the objects that are implicated by the $criteria - $objects = BlockPeer::doSelect($criteria, $con); - foreach ($objects as $obj) { - - - // delete related BlockVersion objects - $criteria = new Criteria(BlockVersionPeer::DATABASE_NAME); - - $criteria->add(BlockVersionPeer::ID, $obj->getId()); - $affectedRows += BlockVersionPeer::doDelete($criteria, $con); - } - - return $affectedRows; - } - - /** - * Validates all modified columns of given Block 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 Block $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(BlockPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(BlockPeer::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(BlockPeer::DATABASE_NAME, BlockPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return Block - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = BlockPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(BlockPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(BlockPeer::DATABASE_NAME); - $criteria->add(BlockPeer::ID, $pk); - - $v = BlockPeer::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 Block[] - * @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(BlockPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(BlockPeer::DATABASE_NAME); - $criteria->add(BlockPeer::ID, $pks, Criteria::IN); - $objs = BlockPeer::doSelect($criteria, $con); - } - - return $objs; - } - - // versionable behavior - - /** - * Checks whether versioning is enabled - * - * @return boolean - */ - public static function isVersioningEnabled() - { - return self::$isVersioningEnabled; - } - - /** - * Enables versioning - */ - public static function enableVersioning() - { - self::$isVersioningEnabled = true; - } - - /** - * Disables versioning - */ - public static function disableVersioning() - { - self::$isVersioningEnabled = false; - } - -} // BaseBlockPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseBlockPeer::buildTableMap(); - -EventDispatcherProxy::trigger(array('construct','peer.construct'), new PeerEvent('Trinity\Bundle\NewsletterBundle\Model\om\BaseBlockPeer')); diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlockQuery.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlockQuery.php deleted file mode 100644 index c1552e8..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlockQuery.php +++ /dev/null @@ -1,992 +0,0 @@ -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 Block|Block[]|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ($key === null) { - return null; - } - if ((null !== ($obj = BlockPeer::getInstanceFromPool((string) $key))) && !$this->formatter) { - // the object is already in the instance pool - return $obj; - } - if ($con === null) { - $con = Propel::getConnection(BlockPeer::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 Block 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 Block A model object, or null if the key is not found - * @throws PropelException - */ - protected function findPkSimple($key, $con) - { - $sql = 'SELECT `id`, `name`, `value`, `class_key`, `template`, `model_id`, `created_at`, `updated_at`, `version`, `version_created_at`, `version_created_by` FROM `nws_block` 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 = BlockPeer::getOMClass($row, 0); - $obj = new $cls(); - $obj->hydrate($row); - BlockPeer::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 Block|Block[]|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|Block[]|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 BlockQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - - return $this->addUsingAlias(BlockPeer::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 BlockQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - - return $this->addUsingAlias(BlockPeer::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 BlockQuery 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(BlockPeer::ID, $id['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($id['max'])) { - $this->addUsingAlias(BlockPeer::ID, $id['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(BlockPeer::ID, $id, $comparison); - } - - /** - * Filter the query on the name column - * - * Example usage: - * - * $query->filterByName('fooValue'); // WHERE name = 'fooValue' - * $query->filterByName('%fooValue%'); // WHERE name LIKE '%fooValue%' - * - * - * @param string $name 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 BlockQuery The current query, for fluid interface - */ - public function filterByName($name = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($name)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $name)) { - $name = str_replace('*', '%', $name); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(BlockPeer::NAME, $name, $comparison); - } - - /** - * Filter the query on the value column - * - * Example usage: - * - * $query->filterByValue('fooValue'); // WHERE value = 'fooValue' - * $query->filterByValue('%fooValue%'); // WHERE value LIKE '%fooValue%' - * - * - * @param string $value 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 BlockQuery The current query, for fluid interface - */ - public function filterByValue($value = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($value)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $value)) { - $value = str_replace('*', '%', $value); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(BlockPeer::VALUE, $value, $comparison); - } - - /** - * Filter the query on the class_key column - * - * Example usage: - * - * $query->filterByClassKey('fooValue'); // WHERE class_key = 'fooValue' - * $query->filterByClassKey('%fooValue%'); // WHERE class_key LIKE '%fooValue%' - * - * - * @param string $classKey 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 BlockQuery The current query, for fluid interface - */ - public function filterByClassKey($classKey = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($classKey)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $classKey)) { - $classKey = str_replace('*', '%', $classKey); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(BlockPeer::CLASS_KEY, $classKey, $comparison); - } - - /** - * Filter the query on the template column - * - * Example usage: - * - * $query->filterByTemplate('fooValue'); // WHERE template = 'fooValue' - * $query->filterByTemplate('%fooValue%'); // WHERE template LIKE '%fooValue%' - * - * - * @param string $template 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 BlockQuery The current query, for fluid interface - */ - public function filterByTemplate($template = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($template)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $template)) { - $template = str_replace('*', '%', $template); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(BlockPeer::TEMPLATE, $template, $comparison); - } - - /** - * Filter the query on the model_id column - * - * Example usage: - * - * $query->filterByModelId(1234); // WHERE model_id = 1234 - * $query->filterByModelId(array(12, 34)); // WHERE model_id IN (12, 34) - * $query->filterByModelId(array('min' => 12)); // WHERE model_id >= 12 - * $query->filterByModelId(array('max' => 12)); // WHERE model_id <= 12 - * - * - * @see filterByModel() - * - * @param mixed $modelId 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 BlockQuery The current query, for fluid interface - */ - public function filterByModelId($modelId = null, $comparison = null) - { - if (is_array($modelId)) { - $useMinMax = false; - if (isset($modelId['min'])) { - $this->addUsingAlias(BlockPeer::MODEL_ID, $modelId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($modelId['max'])) { - $this->addUsingAlias(BlockPeer::MODEL_ID, $modelId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(BlockPeer::MODEL_ID, $modelId, $comparison); - } - - /** - * Filter the query on the created_at column - * - * Example usage: - * - * $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14' - * $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14' - * $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at < '2011-03-13' - * - * - * @param mixed $createdAt The value to use as filter. - * Values can be integers (unix timestamps), DateTime objects, or strings. - * Empty strings are treated as NULL. - * 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 BlockQuery The current query, for fluid interface - */ - public function filterByCreatedAt($createdAt = null, $comparison = null) - { - if (is_array($createdAt)) { - $useMinMax = false; - if (isset($createdAt['min'])) { - $this->addUsingAlias(BlockPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($createdAt['max'])) { - $this->addUsingAlias(BlockPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(BlockPeer::CREATED_AT, $createdAt, $comparison); - } - - /** - * Filter the query on the updated_at column - * - * Example usage: - * - * $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14' - * $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14' - * $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at < '2011-03-13' - * - * - * @param mixed $updatedAt The value to use as filter. - * Values can be integers (unix timestamps), DateTime objects, or strings. - * Empty strings are treated as NULL. - * 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 BlockQuery The current query, for fluid interface - */ - public function filterByUpdatedAt($updatedAt = null, $comparison = null) - { - if (is_array($updatedAt)) { - $useMinMax = false; - if (isset($updatedAt['min'])) { - $this->addUsingAlias(BlockPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($updatedAt['max'])) { - $this->addUsingAlias(BlockPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(BlockPeer::UPDATED_AT, $updatedAt, $comparison); - } - - /** - * Filter the query on the version column - * - * Example usage: - * - * $query->filterByVersion(1234); // WHERE version = 1234 - * $query->filterByVersion(array(12, 34)); // WHERE version IN (12, 34) - * $query->filterByVersion(array('min' => 12)); // WHERE version >= 12 - * $query->filterByVersion(array('max' => 12)); // WHERE version <= 12 - * - * - * @param mixed $version 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 BlockQuery The current query, for fluid interface - */ - public function filterByVersion($version = null, $comparison = null) - { - if (is_array($version)) { - $useMinMax = false; - if (isset($version['min'])) { - $this->addUsingAlias(BlockPeer::VERSION, $version['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($version['max'])) { - $this->addUsingAlias(BlockPeer::VERSION, $version['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(BlockPeer::VERSION, $version, $comparison); - } - - /** - * Filter the query on the version_created_at column - * - * Example usage: - * - * $query->filterByVersionCreatedAt('2011-03-14'); // WHERE version_created_at = '2011-03-14' - * $query->filterByVersionCreatedAt('now'); // WHERE version_created_at = '2011-03-14' - * $query->filterByVersionCreatedAt(array('max' => 'yesterday')); // WHERE version_created_at < '2011-03-13' - * - * - * @param mixed $versionCreatedAt The value to use as filter. - * Values can be integers (unix timestamps), DateTime objects, or strings. - * Empty strings are treated as NULL. - * 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 BlockQuery The current query, for fluid interface - */ - public function filterByVersionCreatedAt($versionCreatedAt = null, $comparison = null) - { - if (is_array($versionCreatedAt)) { - $useMinMax = false; - if (isset($versionCreatedAt['min'])) { - $this->addUsingAlias(BlockPeer::VERSION_CREATED_AT, $versionCreatedAt['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($versionCreatedAt['max'])) { - $this->addUsingAlias(BlockPeer::VERSION_CREATED_AT, $versionCreatedAt['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(BlockPeer::VERSION_CREATED_AT, $versionCreatedAt, $comparison); - } - - /** - * Filter the query on the version_created_by column - * - * Example usage: - * - * $query->filterByVersionCreatedBy('fooValue'); // WHERE version_created_by = 'fooValue' - * $query->filterByVersionCreatedBy('%fooValue%'); // WHERE version_created_by LIKE '%fooValue%' - * - * - * @param string $versionCreatedBy 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 BlockQuery The current query, for fluid interface - */ - public function filterByVersionCreatedBy($versionCreatedBy = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($versionCreatedBy)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $versionCreatedBy)) { - $versionCreatedBy = str_replace('*', '%', $versionCreatedBy); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(BlockPeer::VERSION_CREATED_BY, $versionCreatedBy, $comparison); - } - - /** - * Filter the query by a related Model object - * - * @param Model|PropelObjectCollection $model The related object(s) to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return BlockQuery The current query, for fluid interface - * @throws PropelException - if the provided filter is invalid. - */ - public function filterByModel($model, $comparison = null) - { - if ($model instanceof Model) { - return $this - ->addUsingAlias(BlockPeer::MODEL_ID, $model->getId(), $comparison); - } elseif ($model instanceof PropelObjectCollection) { - if (null === $comparison) { - $comparison = Criteria::IN; - } - - return $this - ->addUsingAlias(BlockPeer::MODEL_ID, $model->toKeyValue('PrimaryKey', 'Id'), $comparison); - } else { - throw new PropelException('filterByModel() only accepts arguments of type Model or PropelCollection'); - } - } - - /** - * Adds a JOIN clause to the query using the Model relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return BlockQuery The current query, for fluid interface - */ - public function joinModel($relationAlias = null, $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('Model'); - - // create a ModelJoin object for this join - $join = new ModelJoin(); - $join->setJoinType($joinType); - $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); - if ($previousJoin = $this->getPreviousJoin()) { - $join->setPreviousJoin($previousJoin); - } - - // add the ModelJoin to the current object - if ($relationAlias) { - $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); - $this->addJoinObject($join, $relationAlias); - } else { - $this->addJoinObject($join, 'Model'); - } - - return $this; - } - - /** - * Use the Model relation Model object - * - * @see useQuery() - * - * @param string $relationAlias optional alias for the relation, - * to be used as main alias in the secondary query - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return \Trinity\Bundle\NewsletterBundle\Model\ModelQuery A secondary query class using the current class as primary query - */ - public function useModelQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinModel($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'Model', '\Trinity\Bundle\NewsletterBundle\Model\ModelQuery'); - } - - /** - * Filter the query by a related BlockVersion object - * - * @param BlockVersion|PropelObjectCollection $blockVersion the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return BlockQuery The current query, for fluid interface - * @throws PropelException - if the provided filter is invalid. - */ - public function filterByBlockVersion($blockVersion, $comparison = null) - { - if ($blockVersion instanceof BlockVersion) { - return $this - ->addUsingAlias(BlockPeer::ID, $blockVersion->getId(), $comparison); - } elseif ($blockVersion instanceof PropelObjectCollection) { - return $this - ->useBlockVersionQuery() - ->filterByPrimaryKeys($blockVersion->getPrimaryKeys()) - ->endUse(); - } else { - throw new PropelException('filterByBlockVersion() only accepts arguments of type BlockVersion or PropelCollection'); - } - } - - /** - * Adds a JOIN clause to the query using the BlockVersion relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return BlockQuery The current query, for fluid interface - */ - public function joinBlockVersion($relationAlias = null, $joinType = Criteria::INNER_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('BlockVersion'); - - // create a ModelJoin object for this join - $join = new ModelJoin(); - $join->setJoinType($joinType); - $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); - if ($previousJoin = $this->getPreviousJoin()) { - $join->setPreviousJoin($previousJoin); - } - - // add the ModelJoin to the current object - if ($relationAlias) { - $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); - $this->addJoinObject($join, $relationAlias); - } else { - $this->addJoinObject($join, 'BlockVersion'); - } - - return $this; - } - - /** - * Use the BlockVersion relation BlockVersion object - * - * @see useQuery() - * - * @param string $relationAlias optional alias for the relation, - * to be used as main alias in the secondary query - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return \Trinity\Bundle\NewsletterBundle\Model\BlockVersionQuery A secondary query class using the current class as primary query - */ - public function useBlockVersionQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) - { - return $this - ->joinBlockVersion($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'BlockVersion', '\Trinity\Bundle\NewsletterBundle\Model\BlockVersionQuery'); - } - - /** - * Exclude object from result - * - * @param Block $block Object to remove from the list of results - * - * @return BlockQuery The current query, for fluid interface - */ - public function prune($block = null) - { - if ($block) { - $this->addUsingAlias(BlockPeer::ID, $block->getId(), Criteria::NOT_EQUAL); - } - - return $this; - } - - /** - * Code to execute before every SELECT statement - * - * @param PropelPDO $con The connection object used by the query - */ - protected function basePreSelect(PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger('query.select.pre', new QueryEvent($this)); - - return $this->preSelect($con); - } - - /** - * Code to execute before every DELETE statement - * - * @param PropelPDO $con The connection object used by the query - */ - protected function basePreDelete(PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger(array('delete.pre','query.delete.pre'), new QueryEvent($this)); - - return $this->preDelete($con); - } - - /** - * Code to execute after every DELETE statement - * - * @param int $affectedRows the number of deleted rows - * @param PropelPDO $con The connection object used by the query - */ - protected function basePostDelete($affectedRows, PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger(array('delete.post','query.delete.post'), new QueryEvent($this)); - - return $this->postDelete($affectedRows, $con); - } - - /** - * Code to execute before every UPDATE statement - * - * @param array $values The associative array of columns and values for the update - * @param PropelPDO $con The connection object used by the query - * @param boolean $forceIndividualSaves If false (default), the resulting call is a BasePeer::doUpdate(), otherwise it is a series of save() calls on all the found objects - */ - protected function basePreUpdate(&$values, PropelPDO $con, $forceIndividualSaves = false) - { - // event behavior - EventDispatcherProxy::trigger(array('update.pre', 'query.update.pre'), new QueryEvent($this)); - - return $this->preUpdate($values, $con, $forceIndividualSaves); - } - - /** - * Code to execute after every UPDATE statement - * - * @param int $affectedRows the number of updated rows - * @param PropelPDO $con The connection object used by the query - */ - protected function basePostUpdate($affectedRows, PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger(array('update.post', 'query.update.post'), new QueryEvent($this)); - - return $this->postUpdate($affectedRows, $con); - } - - // timestampable behavior - - /** - * Filter by the latest updated - * - * @param int $nbDays Maximum age of the latest update in days - * - * @return BlockQuery The current query, for fluid interface - */ - public function recentlyUpdated($nbDays = 7) - { - return $this->addUsingAlias(BlockPeer::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL); - } - - /** - * Order by update date desc - * - * @return BlockQuery The current query, for fluid interface - */ - public function lastUpdatedFirst() - { - return $this->addDescendingOrderByColumn(BlockPeer::UPDATED_AT); - } - - /** - * Order by update date asc - * - * @return BlockQuery The current query, for fluid interface - */ - public function firstUpdatedFirst() - { - return $this->addAscendingOrderByColumn(BlockPeer::UPDATED_AT); - } - - /** - * Filter by the latest created - * - * @param int $nbDays Maximum age of in days - * - * @return BlockQuery The current query, for fluid interface - */ - public function recentlyCreated($nbDays = 7) - { - return $this->addUsingAlias(BlockPeer::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL); - } - - /** - * Order by create date desc - * - * @return BlockQuery The current query, for fluid interface - */ - public function lastCreatedFirst() - { - return $this->addDescendingOrderByColumn(BlockPeer::CREATED_AT); - } - - /** - * Order by create date asc - * - * @return BlockQuery The current query, for fluid interface - */ - public function firstCreatedFirst() - { - return $this->addAscendingOrderByColumn(BlockPeer::CREATED_AT); - } - // extend behavior - public function setFormatter($formatter) - { - if (is_string($formatter) && $formatter === \ModelCriteria::FORMAT_ON_DEMAND) { - $formatter = '\Glorpen\Propel\PropelBundle\Formatter\PropelOnDemandFormatter'; - } - - return parent::setFormatter($formatter); - } -} diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlockVersion.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlockVersion.php deleted file mode 100644 index 64f66c0..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlockVersion.php +++ /dev/null @@ -1,1660 +0,0 @@ -version = 0; - $this->model_id_version = 0; - } - - /** - * Initializes internal state of BaseBlockVersion object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - EventDispatcherProxy::trigger(array('construct','model.construct'), new ModelEvent($this)); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getId() - { - - return $this->id; - } - - /** - * Get the [name] column value. - * - * @return string - */ - public function getName() - { - - return $this->name; - } - - /** - * Get the [value] column value. - * - * @return string - */ - public function getValue() - { - - return $this->value; - } - - /** - * Get the [class_key] column value. - * - * @return string - */ - public function getClassKey() - { - - return $this->class_key; - } - - /** - * Get the [template] column value. - * - * @return string - */ - public function getTemplate() - { - - return $this->template; - } - - /** - * Get the [model_id] column value. - * - * @return int - */ - public function getModelId() - { - - return $this->model_id; - } - - /** - * Get the [optionally formatted] temporal [created_at] column value. - * - * - * @param string $format The date/time format string (either date()-style or strftime()-style). - * If format is null, then the raw DateTime object will be returned. - * @return mixed Formatted date/time value as string or DateTime object (if format is null), null if column is null, and 0 if column value is 0000-00-00 00:00:00 - * @throws PropelException - if unable to parse/validate the date/time value. - */ - public function getCreatedAt($format = null) - { - if ($this->created_at === null) { - return null; - } - - if ($this->created_at === '0000-00-00 00:00:00') { - // while technically this is not a default value of null, - // this seems to be closest in meaning. - return null; - } - - try { - $dt = new DateTime($this->created_at); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->created_at, true), $x); - } - - if ($format === null) { - // Because propel.useDateTimeClass is true, we return a DateTime object. - return $dt; - } - - if (strpos($format, '%') !== false) { - return strftime($format, $dt->format('U')); - } - - return $dt->format($format); - - } - - /** - * Get the [optionally formatted] temporal [updated_at] column value. - * - * - * @param string $format The date/time format string (either date()-style or strftime()-style). - * If format is null, then the raw DateTime object will be returned. - * @return mixed Formatted date/time value as string or DateTime object (if format is null), null if column is null, and 0 if column value is 0000-00-00 00:00:00 - * @throws PropelException - if unable to parse/validate the date/time value. - */ - public function getUpdatedAt($format = null) - { - if ($this->updated_at === null) { - return null; - } - - if ($this->updated_at === '0000-00-00 00:00:00') { - // while technically this is not a default value of null, - // this seems to be closest in meaning. - return null; - } - - try { - $dt = new DateTime($this->updated_at); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->updated_at, true), $x); - } - - if ($format === null) { - // Because propel.useDateTimeClass is true, we return a DateTime object. - return $dt; - } - - if (strpos($format, '%') !== false) { - return strftime($format, $dt->format('U')); - } - - return $dt->format($format); - - } - - /** - * Get the [version] column value. - * - * @return int - */ - public function getVersion() - { - - return $this->version; - } - - /** - * Get the [optionally formatted] temporal [version_created_at] column value. - * - * - * @param string $format The date/time format string (either date()-style or strftime()-style). - * If format is null, then the raw DateTime object will be returned. - * @return mixed Formatted date/time value as string or DateTime object (if format is null), null if column is null, and 0 if column value is 0000-00-00 00:00:00 - * @throws PropelException - if unable to parse/validate the date/time value. - */ - public function getVersionCreatedAt($format = null) - { - if ($this->version_created_at === null) { - return null; - } - - if ($this->version_created_at === '0000-00-00 00:00:00') { - // while technically this is not a default value of null, - // this seems to be closest in meaning. - return null; - } - - try { - $dt = new DateTime($this->version_created_at); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->version_created_at, true), $x); - } - - if ($format === null) { - // Because propel.useDateTimeClass is true, we return a DateTime object. - return $dt; - } - - if (strpos($format, '%') !== false) { - return strftime($format, $dt->format('U')); - } - - return $dt->format($format); - - } - - /** - * Get the [version_created_by] column value. - * - * @return string - */ - public function getVersionCreatedBy() - { - - return $this->version_created_by; - } - - /** - * Get the [model_id_version] column value. - * - * @return int - */ - public function getModelIdVersion() - { - - return $this->model_id_version; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return BlockVersion 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[] = BlockVersionPeer::ID; - } - - if ($this->aBlock !== null && $this->aBlock->getId() !== $v) { - $this->aBlock = null; - } - - - return $this; - } // setId() - - /** - * Set the value of [name] column. - * - * @param string $v new value - * @return BlockVersion The current object (for fluent API support) - */ - public function setName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->name !== $v) { - $this->name = $v; - $this->modifiedColumns[] = BlockVersionPeer::NAME; - } - - - return $this; - } // setName() - - /** - * Set the value of [value] column. - * - * @param string $v new value - * @return BlockVersion The current object (for fluent API support) - */ - public function setValue($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->value !== $v) { - $this->value = $v; - $this->modifiedColumns[] = BlockVersionPeer::VALUE; - } - - - return $this; - } // setValue() - - /** - * Set the value of [class_key] column. - * - * @param string $v new value - * @return BlockVersion The current object (for fluent API support) - */ - public function setClassKey($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->class_key !== $v) { - $this->class_key = $v; - $this->modifiedColumns[] = BlockVersionPeer::CLASS_KEY; - } - - - return $this; - } // setClassKey() - - /** - * Set the value of [template] column. - * - * @param string $v new value - * @return BlockVersion The current object (for fluent API support) - */ - public function setTemplate($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->template !== $v) { - $this->template = $v; - $this->modifiedColumns[] = BlockVersionPeer::TEMPLATE; - } - - - return $this; - } // setTemplate() - - /** - * Set the value of [model_id] column. - * - * @param int $v new value - * @return BlockVersion The current object (for fluent API support) - */ - public function setModelId($v) - { - if ($v !== null && is_numeric($v)) { - $v = (int) $v; - } - - if ($this->model_id !== $v) { - $this->model_id = $v; - $this->modifiedColumns[] = BlockVersionPeer::MODEL_ID; - } - - - return $this; - } // setModelId() - - /** - * Sets the value of [created_at] column to a normalized version of the date/time value specified. - * - * @param mixed $v string, integer (timestamp), or DateTime value. - * Empty strings are treated as null. - * @return BlockVersion The current object (for fluent API support) - */ - public function setCreatedAt($v) - { - $dt = PropelDateTime::newInstance($v, null, 'DateTime'); - if ($this->created_at !== null || $dt !== null) { - $currentDateAsString = ($this->created_at !== null && $tmpDt = new DateTime($this->created_at)) ? $tmpDt->format('Y-m-d H:i:s') : null; - $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null; - if ($currentDateAsString !== $newDateAsString) { - $this->created_at = $newDateAsString; - $this->modifiedColumns[] = BlockVersionPeer::CREATED_AT; - } - } // if either are not null - - - return $this; - } // setCreatedAt() - - /** - * Sets the value of [updated_at] column to a normalized version of the date/time value specified. - * - * @param mixed $v string, integer (timestamp), or DateTime value. - * Empty strings are treated as null. - * @return BlockVersion The current object (for fluent API support) - */ - public function setUpdatedAt($v) - { - $dt = PropelDateTime::newInstance($v, null, 'DateTime'); - if ($this->updated_at !== null || $dt !== null) { - $currentDateAsString = ($this->updated_at !== null && $tmpDt = new DateTime($this->updated_at)) ? $tmpDt->format('Y-m-d H:i:s') : null; - $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null; - if ($currentDateAsString !== $newDateAsString) { - $this->updated_at = $newDateAsString; - $this->modifiedColumns[] = BlockVersionPeer::UPDATED_AT; - } - } // if either are not null - - - return $this; - } // setUpdatedAt() - - /** - * Set the value of [version] column. - * - * @param int $v new value - * @return BlockVersion The current object (for fluent API support) - */ - public function setVersion($v) - { - if ($v !== null && is_numeric($v)) { - $v = (int) $v; - } - - if ($this->version !== $v) { - $this->version = $v; - $this->modifiedColumns[] = BlockVersionPeer::VERSION; - } - - - return $this; - } // setVersion() - - /** - * Sets the value of [version_created_at] column to a normalized version of the date/time value specified. - * - * @param mixed $v string, integer (timestamp), or DateTime value. - * Empty strings are treated as null. - * @return BlockVersion The current object (for fluent API support) - */ - public function setVersionCreatedAt($v) - { - $dt = PropelDateTime::newInstance($v, null, 'DateTime'); - if ($this->version_created_at !== null || $dt !== null) { - $currentDateAsString = ($this->version_created_at !== null && $tmpDt = new DateTime($this->version_created_at)) ? $tmpDt->format('Y-m-d H:i:s') : null; - $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null; - if ($currentDateAsString !== $newDateAsString) { - $this->version_created_at = $newDateAsString; - $this->modifiedColumns[] = BlockVersionPeer::VERSION_CREATED_AT; - } - } // if either are not null - - - return $this; - } // setVersionCreatedAt() - - /** - * Set the value of [version_created_by] column. - * - * @param string $v new value - * @return BlockVersion The current object (for fluent API support) - */ - public function setVersionCreatedBy($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->version_created_by !== $v) { - $this->version_created_by = $v; - $this->modifiedColumns[] = BlockVersionPeer::VERSION_CREATED_BY; - } - - - return $this; - } // setVersionCreatedBy() - - /** - * Set the value of [model_id_version] column. - * - * @param int $v new value - * @return BlockVersion The current object (for fluent API support) - */ - public function setModelIdVersion($v) - { - if ($v !== null && is_numeric($v)) { - $v = (int) $v; - } - - if ($this->model_id_version !== $v) { - $this->model_id_version = $v; - $this->modifiedColumns[] = BlockVersionPeer::MODEL_ID_VERSION; - } - - - return $this; - } // setModelIdVersion() - - /** - * 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() - { - if ($this->version !== 0) { - return false; - } - - if ($this->model_id_version !== 0) { - return false; - } - - // 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->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->value = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->class_key = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->template = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->model_id = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null; - $this->created_at = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; - $this->updated_at = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null; - $this->version = ($row[$startcol + 8] !== null) ? (int) $row[$startcol + 8] : null; - $this->version_created_at = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null; - $this->version_created_by = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null; - $this->model_id_version = ($row[$startcol + 11] !== null) ? (int) $row[$startcol + 11] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - $this->postHydrate($row, $startcol, $rehydrate); - - return $startcol + 12; // 12 = BlockVersionPeer::NUM_HYDRATE_COLUMNS. - - } catch (Exception $e) { - throw new PropelException("Error populating BlockVersion 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() - { - - if ($this->aBlock !== null && $this->id !== $this->aBlock->getId()) { - $this->aBlock = null; - } - } // 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(BlockVersionPeer::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 = BlockVersionPeer::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? - - $this->aBlock = null; - } // 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(BlockVersionPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $deleteQuery = BlockVersionQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()); - $ret = $this->preDelete($con); - // event behavior - EventDispatcherProxy::trigger(array('delete.pre','model.delete.pre'), new ModelEvent($this)); - if ($ret) { - $deleteQuery->delete($con); - $this->postDelete($con); - // event behavior - EventDispatcherProxy::trigger(array('delete.post', 'model.delete.post'), new ModelEvent($this)); - $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(BlockVersionPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - // event behavior - EventDispatcherProxy::trigger('model.save.pre', new ModelEvent($this)); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - // event behavior - EventDispatcherProxy::trigger('model.insert.pre', new ModelEvent($this)); - } else { - $ret = $ret && $this->preUpdate($con); - // event behavior - EventDispatcherProxy::trigger(array('update.pre', 'model.update.pre'), new ModelEvent($this)); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - // event behavior - EventDispatcherProxy::trigger('model.insert.post', new ModelEvent($this)); - } else { - $this->postUpdate($con); - // event behavior - EventDispatcherProxy::trigger(array('update.post', 'model.update.post'), new ModelEvent($this)); - } - $this->postSave($con); - // event behavior - EventDispatcherProxy::trigger('model.save.post', new ModelEvent($this)); - BlockVersionPeer::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; - - // We call the save method on the following object(s) if they - // were passed to this object by their corresponding set - // method. This object relates to these object(s) by a - // foreign key reference. - - if ($this->aBlock !== null) { - if ($this->aBlock->isModified() || $this->aBlock->isNew()) { - $affectedRows += $this->aBlock->save($con); - } - $this->setBlock($this->aBlock); - } - - 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; - - - // check the columns in natural order for more readable SQL queries - if ($this->isColumnModified(BlockVersionPeer::ID)) { - $modifiedColumns[':p' . $index++] = '`id`'; - } - if ($this->isColumnModified(BlockVersionPeer::NAME)) { - $modifiedColumns[':p' . $index++] = '`name`'; - } - if ($this->isColumnModified(BlockVersionPeer::VALUE)) { - $modifiedColumns[':p' . $index++] = '`value`'; - } - if ($this->isColumnModified(BlockVersionPeer::CLASS_KEY)) { - $modifiedColumns[':p' . $index++] = '`class_key`'; - } - if ($this->isColumnModified(BlockVersionPeer::TEMPLATE)) { - $modifiedColumns[':p' . $index++] = '`template`'; - } - if ($this->isColumnModified(BlockVersionPeer::MODEL_ID)) { - $modifiedColumns[':p' . $index++] = '`model_id`'; - } - if ($this->isColumnModified(BlockVersionPeer::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`created_at`'; - } - if ($this->isColumnModified(BlockVersionPeer::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`updated_at`'; - } - if ($this->isColumnModified(BlockVersionPeer::VERSION)) { - $modifiedColumns[':p' . $index++] = '`version`'; - } - if ($this->isColumnModified(BlockVersionPeer::VERSION_CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`version_created_at`'; - } - if ($this->isColumnModified(BlockVersionPeer::VERSION_CREATED_BY)) { - $modifiedColumns[':p' . $index++] = '`version_created_by`'; - } - if ($this->isColumnModified(BlockVersionPeer::MODEL_ID_VERSION)) { - $modifiedColumns[':p' . $index++] = '`model_id_version`'; - } - - $sql = sprintf( - 'INSERT INTO `nws_block_version` (%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 '`name`': - $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR); - break; - case '`value`': - $stmt->bindValue($identifier, $this->value, PDO::PARAM_STR); - break; - case '`class_key`': - $stmt->bindValue($identifier, $this->class_key, PDO::PARAM_STR); - break; - case '`template`': - $stmt->bindValue($identifier, $this->template, PDO::PARAM_STR); - break; - case '`model_id`': - $stmt->bindValue($identifier, $this->model_id, PDO::PARAM_INT); - break; - case '`created_at`': - $stmt->bindValue($identifier, $this->created_at, PDO::PARAM_STR); - break; - case '`updated_at`': - $stmt->bindValue($identifier, $this->updated_at, PDO::PARAM_STR); - break; - case '`version`': - $stmt->bindValue($identifier, $this->version, PDO::PARAM_INT); - break; - case '`version_created_at`': - $stmt->bindValue($identifier, $this->version_created_at, PDO::PARAM_STR); - break; - case '`version_created_by`': - $stmt->bindValue($identifier, $this->version_created_by, PDO::PARAM_STR); - break; - case '`model_id_version`': - $stmt->bindValue($identifier, $this->model_id_version, 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); - } - - $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(); - - - // We call the validate method on the following object(s) if they - // were passed to this object by their corresponding set - // method. This object relates to these object(s) by a - // foreign key reference. - - if ($this->aBlock !== null) { - if (!$this->aBlock->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aBlock->getValidationFailures()); - } - } - - - if (($retval = BlockVersionPeer::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 = BlockVersionPeer::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->getName(); - break; - case 2: - return $this->getValue(); - break; - case 3: - return $this->getClassKey(); - break; - case 4: - return $this->getTemplate(); - break; - case 5: - return $this->getModelId(); - break; - case 6: - return $this->getCreatedAt(); - break; - case 7: - return $this->getUpdatedAt(); - break; - case 8: - return $this->getVersion(); - break; - case 9: - return $this->getVersionCreatedAt(); - break; - case 10: - return $this->getVersionCreatedBy(); - break; - case 11: - return $this->getModelIdVersion(); - 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 - * @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false) - { - if (isset($alreadyDumpedObjects['BlockVersion'][serialize($this->getPrimaryKey())])) { - return '*RECURSION*'; - } - $alreadyDumpedObjects['BlockVersion'][serialize($this->getPrimaryKey())] = true; - $keys = BlockVersionPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getId(), - $keys[1] => $this->getName(), - $keys[2] => $this->getValue(), - $keys[3] => $this->getClassKey(), - $keys[4] => $this->getTemplate(), - $keys[5] => $this->getModelId(), - $keys[6] => $this->getCreatedAt(), - $keys[7] => $this->getUpdatedAt(), - $keys[8] => $this->getVersion(), - $keys[9] => $this->getVersionCreatedAt(), - $keys[10] => $this->getVersionCreatedBy(), - $keys[11] => $this->getModelIdVersion(), - ); - $virtualColumns = $this->virtualColumns; - foreach ($virtualColumns as $key => $virtualColumn) { - $result[$key] = $virtualColumn; - } - - if ($includeForeignObjects) { - if (null !== $this->aBlock) { - $result['Block'] = $this->aBlock->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); - } - } - - 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 = BlockVersionPeer::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->setName($value); - break; - case 2: - $this->setValue($value); - break; - case 3: - $this->setClassKey($value); - break; - case 4: - $this->setTemplate($value); - break; - case 5: - $this->setModelId($value); - break; - case 6: - $this->setCreatedAt($value); - break; - case 7: - $this->setUpdatedAt($value); - break; - case 8: - $this->setVersion($value); - break; - case 9: - $this->setVersionCreatedAt($value); - break; - case 10: - $this->setVersionCreatedBy($value); - break; - case 11: - $this->setModelIdVersion($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 = BlockVersionPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setName($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setValue($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setClassKey($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setTemplate($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setModelId($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setCreatedAt($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setUpdatedAt($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setVersion($arr[$keys[8]]); - if (array_key_exists($keys[9], $arr)) $this->setVersionCreatedAt($arr[$keys[9]]); - if (array_key_exists($keys[10], $arr)) $this->setVersionCreatedBy($arr[$keys[10]]); - if (array_key_exists($keys[11], $arr)) $this->setModelIdVersion($arr[$keys[11]]); - } - - /** - * 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(BlockVersionPeer::DATABASE_NAME); - - if ($this->isColumnModified(BlockVersionPeer::ID)) $criteria->add(BlockVersionPeer::ID, $this->id); - if ($this->isColumnModified(BlockVersionPeer::NAME)) $criteria->add(BlockVersionPeer::NAME, $this->name); - if ($this->isColumnModified(BlockVersionPeer::VALUE)) $criteria->add(BlockVersionPeer::VALUE, $this->value); - if ($this->isColumnModified(BlockVersionPeer::CLASS_KEY)) $criteria->add(BlockVersionPeer::CLASS_KEY, $this->class_key); - if ($this->isColumnModified(BlockVersionPeer::TEMPLATE)) $criteria->add(BlockVersionPeer::TEMPLATE, $this->template); - if ($this->isColumnModified(BlockVersionPeer::MODEL_ID)) $criteria->add(BlockVersionPeer::MODEL_ID, $this->model_id); - if ($this->isColumnModified(BlockVersionPeer::CREATED_AT)) $criteria->add(BlockVersionPeer::CREATED_AT, $this->created_at); - if ($this->isColumnModified(BlockVersionPeer::UPDATED_AT)) $criteria->add(BlockVersionPeer::UPDATED_AT, $this->updated_at); - if ($this->isColumnModified(BlockVersionPeer::VERSION)) $criteria->add(BlockVersionPeer::VERSION, $this->version); - if ($this->isColumnModified(BlockVersionPeer::VERSION_CREATED_AT)) $criteria->add(BlockVersionPeer::VERSION_CREATED_AT, $this->version_created_at); - if ($this->isColumnModified(BlockVersionPeer::VERSION_CREATED_BY)) $criteria->add(BlockVersionPeer::VERSION_CREATED_BY, $this->version_created_by); - if ($this->isColumnModified(BlockVersionPeer::MODEL_ID_VERSION)) $criteria->add(BlockVersionPeer::MODEL_ID_VERSION, $this->model_id_version); - - 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(BlockVersionPeer::DATABASE_NAME); - $criteria->add(BlockVersionPeer::ID, $this->id); - $criteria->add(BlockVersionPeer::VERSION, $this->version); - - return $criteria; - } - - /** - * Returns the composite primary key for this object. - * The array elements will be in same order as specified in XML. - * @return array - */ - public function getPrimaryKey() - { - $pks = array(); - $pks[0] = $this->getId(); - $pks[1] = $this->getVersion(); - - return $pks; - } - - /** - * Set the [composite] primary key. - * - * @param array $keys The elements of the composite key (order must match the order in XML file). - * @return void - */ - public function setPrimaryKey($keys) - { - $this->setId($keys[0]); - $this->setVersion($keys[1]); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - - return (null === $this->getId()) && (null === $this->getVersion()); - } - - /** - * 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 BlockVersion (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->setId($this->getId()); - $copyObj->setName($this->getName()); - $copyObj->setValue($this->getValue()); - $copyObj->setClassKey($this->getClassKey()); - $copyObj->setTemplate($this->getTemplate()); - $copyObj->setModelId($this->getModelId()); - $copyObj->setCreatedAt($this->getCreatedAt()); - $copyObj->setUpdatedAt($this->getUpdatedAt()); - $copyObj->setVersion($this->getVersion()); - $copyObj->setVersionCreatedAt($this->getVersionCreatedAt()); - $copyObj->setVersionCreatedBy($this->getVersionCreatedBy()); - $copyObj->setModelIdVersion($this->getModelIdVersion()); - - if ($deepCopy && !$this->startCopy) { - // important: temporarily setNew(false) because this affects the behavior of - // the getter/setter methods for fkey referrer objects. - $copyObj->setNew(false); - // store object hash to prevent cycle - $this->startCopy = true; - - //unflag object copy - $this->startCopy = false; - } // if ($deepCopy) - - if ($makeNew) { - $copyObj->setNew(true); - } - } - - /** - * 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 BlockVersion 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 BlockVersionPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new BlockVersionPeer(); - } - - return self::$peer; - } - - /** - * Declares an association between this object and a Block object. - * - * @param Block $v - * @return BlockVersion The current object (for fluent API support) - * @throws PropelException - */ - public function setBlock(Block $v = null) - { - if ($v === null) { - $this->setId(NULL); - } else { - $this->setId($v->getId()); - } - - $this->aBlock = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the Block object, it will not be re-added. - if ($v !== null) { - $v->addBlockVersion($this); - } - - - return $this; - } - - - /** - * Get the associated Block object - * - * @param PropelPDO $con Optional Connection object. - * @param $doQuery Executes a query to get the object if required - * @return Block The associated Block object. - * @throws PropelException - */ - public function getBlock(PropelPDO $con = null, $doQuery = true) - { - if ($this->aBlock === null && ($this->id !== null) && $doQuery) { - $this->aBlock = BlockQuery::create()->findPk($this->id, $con); - /* The following can be used additionally to - guarantee the related object contains a reference - to this object. This level of coupling may, however, be - undesirable since it could result in an only partially populated collection - in the referenced object. - $this->aBlock->addBlockVersions($this); - */ - } - - return $this->aBlock; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->name = null; - $this->value = null; - $this->class_key = null; - $this->template = null; - $this->model_id = null; - $this->created_at = null; - $this->updated_at = null; - $this->version = null; - $this->version_created_at = null; - $this->version_created_by = null; - $this->model_id_version = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->alreadyInClearAllReferencesDeep = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $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; - if ($this->aBlock instanceof Persistent) { - $this->aBlock->clearAllReferences($deep); - } - - $this->alreadyInClearAllReferencesDeep = false; - } // if ($deep) - - $this->aBlock = null; - } - - /** - * return the string representation of this object - * - * @return string - */ - public function __toString() - { - return (string) $this->exportTo(BlockVersionPeer::DEFAULT_STRING_FORMAT); - } - - /** - * return true is the object is in saving state - * - * @return boolean - */ - public function isAlreadyInSave() - { - return $this->alreadyInSave; - } - - // event behavior - public function preCommit(\PropelPDO $con = null){} - public function preCommitSave(\PropelPDO $con = null){} - public function preCommitDelete(\PropelPDO $con = null){} - public function preCommitUpdate(\PropelPDO $con = null){} - public function preCommitInsert(\PropelPDO $con = null){} - public function preRollback(\PropelPDO $con = null){} - public function preRollbackSave(\PropelPDO $con = null){} - public function preRollbackDelete(\PropelPDO $con = null){} - public function preRollbackUpdate(\PropelPDO $con = null){} - public function preRollbackInsert(\PropelPDO $con = null){} - -} diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlockVersionPeer.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlockVersionPeer.php deleted file mode 100644 index 1e72cf3..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlockVersionPeer.php +++ /dev/null @@ -1,1065 +0,0 @@ - array ('Id', 'Name', 'Value', 'ClassKey', 'Template', 'ModelId', 'CreatedAt', 'UpdatedAt', 'Version', 'VersionCreatedAt', 'VersionCreatedBy', 'ModelIdVersion', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'name', 'value', 'classKey', 'template', 'modelId', 'createdAt', 'updatedAt', 'version', 'versionCreatedAt', 'versionCreatedBy', 'modelIdVersion', ), - BasePeer::TYPE_COLNAME => array (BlockVersionPeer::ID, BlockVersionPeer::NAME, BlockVersionPeer::VALUE, BlockVersionPeer::CLASS_KEY, BlockVersionPeer::TEMPLATE, BlockVersionPeer::MODEL_ID, BlockVersionPeer::CREATED_AT, BlockVersionPeer::UPDATED_AT, BlockVersionPeer::VERSION, BlockVersionPeer::VERSION_CREATED_AT, BlockVersionPeer::VERSION_CREATED_BY, BlockVersionPeer::MODEL_ID_VERSION, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'VALUE', 'CLASS_KEY', 'TEMPLATE', 'MODEL_ID', 'CREATED_AT', 'UPDATED_AT', 'VERSION', 'VERSION_CREATED_AT', 'VERSION_CREATED_BY', 'MODEL_ID_VERSION', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'value', 'class_key', 'template', 'model_id', 'created_at', 'updated_at', 'version', 'version_created_at', 'version_created_by', 'model_id_version', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ) - ); - - /** - * holds an array of keys for quick access to the fieldnames array - * - * first dimension keys are the type constants - * e.g. BlockVersionPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 - */ - protected static $fieldKeys = array ( - BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Name' => 1, 'Value' => 2, 'ClassKey' => 3, 'Template' => 4, 'ModelId' => 5, 'CreatedAt' => 6, 'UpdatedAt' => 7, 'Version' => 8, 'VersionCreatedAt' => 9, 'VersionCreatedBy' => 10, 'ModelIdVersion' => 11, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'name' => 1, 'value' => 2, 'classKey' => 3, 'template' => 4, 'modelId' => 5, 'createdAt' => 6, 'updatedAt' => 7, 'version' => 8, 'versionCreatedAt' => 9, 'versionCreatedBy' => 10, 'modelIdVersion' => 11, ), - BasePeer::TYPE_COLNAME => array (BlockVersionPeer::ID => 0, BlockVersionPeer::NAME => 1, BlockVersionPeer::VALUE => 2, BlockVersionPeer::CLASS_KEY => 3, BlockVersionPeer::TEMPLATE => 4, BlockVersionPeer::MODEL_ID => 5, BlockVersionPeer::CREATED_AT => 6, BlockVersionPeer::UPDATED_AT => 7, BlockVersionPeer::VERSION => 8, BlockVersionPeer::VERSION_CREATED_AT => 9, BlockVersionPeer::VERSION_CREATED_BY => 10, BlockVersionPeer::MODEL_ID_VERSION => 11, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'VALUE' => 2, 'CLASS_KEY' => 3, 'TEMPLATE' => 4, 'MODEL_ID' => 5, 'CREATED_AT' => 6, 'UPDATED_AT' => 7, 'VERSION' => 8, 'VERSION_CREATED_AT' => 9, 'VERSION_CREATED_BY' => 10, 'MODEL_ID_VERSION' => 11, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'value' => 2, 'class_key' => 3, 'template' => 4, 'model_id' => 5, 'created_at' => 6, 'updated_at' => 7, 'version' => 8, 'version_created_at' => 9, 'version_created_by' => 10, 'model_id_version' => 11, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ) - ); - - /** - * 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 = BlockVersionPeer::getFieldNames($toType); - $key = isset(BlockVersionPeer::$fieldKeys[$fromType][$name]) ? BlockVersionPeer::$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(BlockVersionPeer::$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, BlockVersionPeer::$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 BlockVersionPeer::$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. BlockVersionPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(BlockVersionPeer::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(BlockVersionPeer::ID); - $criteria->addSelectColumn(BlockVersionPeer::NAME); - $criteria->addSelectColumn(BlockVersionPeer::VALUE); - $criteria->addSelectColumn(BlockVersionPeer::CLASS_KEY); - $criteria->addSelectColumn(BlockVersionPeer::TEMPLATE); - $criteria->addSelectColumn(BlockVersionPeer::MODEL_ID); - $criteria->addSelectColumn(BlockVersionPeer::CREATED_AT); - $criteria->addSelectColumn(BlockVersionPeer::UPDATED_AT); - $criteria->addSelectColumn(BlockVersionPeer::VERSION); - $criteria->addSelectColumn(BlockVersionPeer::VERSION_CREATED_AT); - $criteria->addSelectColumn(BlockVersionPeer::VERSION_CREATED_BY); - $criteria->addSelectColumn(BlockVersionPeer::MODEL_ID_VERSION); - } else { - $criteria->addSelectColumn($alias . '.id'); - $criteria->addSelectColumn($alias . '.name'); - $criteria->addSelectColumn($alias . '.value'); - $criteria->addSelectColumn($alias . '.class_key'); - $criteria->addSelectColumn($alias . '.template'); - $criteria->addSelectColumn($alias . '.model_id'); - $criteria->addSelectColumn($alias . '.created_at'); - $criteria->addSelectColumn($alias . '.updated_at'); - $criteria->addSelectColumn($alias . '.version'); - $criteria->addSelectColumn($alias . '.version_created_at'); - $criteria->addSelectColumn($alias . '.version_created_by'); - $criteria->addSelectColumn($alias . '.model_id_version'); - } - } - - /** - * 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(BlockVersionPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - BlockVersionPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count - $criteria->setDbName(BlockVersionPeer::DATABASE_NAME); // Set the correct dbName - - if ($con === null) { - $con = Propel::getConnection(BlockVersionPeer::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 BlockVersion - * @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 = BlockVersionPeer::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 BlockVersionPeer::populateObjects(BlockVersionPeer::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(BlockVersionPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - BlockVersionPeer::addSelectColumns($criteria); - } - - // Set the correct dbName - $criteria->setDbName(BlockVersionPeer::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 BlockVersion $obj A BlockVersion 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 = serialize(array((string) $obj->getId(), (string) $obj->getVersion())); - } // if key === null - BlockVersionPeer::$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 BlockVersion 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 BlockVersion) { - $key = serialize(array((string) $value->getId(), (string) $value->getVersion())); - } elseif (is_array($value) && count($value) === 2) { - // assume we've been passed a primary key - $key = serialize(array((string) $value[0], (string) $value[1])); - } else { - $e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or BlockVersion object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value,true))); - throw $e; - } - - unset(BlockVersionPeer::$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 BlockVersion 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(BlockVersionPeer::$instances[$key])) { - return BlockVersionPeer::$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 (BlockVersionPeer::$instances as $instance) { - $instance->clearAllReferences(true); - } - } - BlockVersionPeer::$instances = array(); - } - - /** - * Method to invalidate the instance pool of all tables related to nws_block_version - * 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 && $row[$startcol + 8] === null) { - return null; - } - - return serialize(array((string) $row[$startcol], (string) $row[$startcol + 8])); - } - - /** - * 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 array((int) $row[$startcol], (int) $row[$startcol + 8]); - } - - /** - * 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 = BlockVersionPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = BlockVersionPeer::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 = BlockVersionPeer::getOMClass($row, 0); - $cls = substr('.'.$cls, strrpos('.'.$cls, '.') + 1); - $obj = new $cls(); - $obj->hydrate($row); - $results[] = $obj; - BlockVersionPeer::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 (BlockVersion object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = BlockVersionPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = BlockVersionPeer::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 + BlockVersionPeer::NUM_HYDRATE_COLUMNS; - } else { - $cls = BlockVersionPeer::getOMClass($row, $startcol); - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - BlockVersionPeer::addInstanceToPool($obj, $key); - } - - return array($obj, $col); - } - - - /** - * Returns the number of rows matching criteria, joining the related Block table - * - * @param Criteria $criteria - * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead. - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return int Number of matching rows. - */ - public static function doCountJoinBlock(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - // we're going to 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(BlockVersionPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - BlockVersionPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count - - // Set the correct dbName - $criteria->setDbName(BlockVersionPeer::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(BlockVersionPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(BlockVersionPeer::ID, BlockPeer::ID, $join_behavior); - - $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 a collection of BlockVersion objects pre-filled with their Block objects. - * @param Criteria $criteria - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return array Array of BlockVersion objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinBlock(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(BlockVersionPeer::DATABASE_NAME); - } - - BlockVersionPeer::addSelectColumns($criteria); - $startcol = BlockVersionPeer::NUM_HYDRATE_COLUMNS; - BlockPeer::addSelectColumns($criteria); - - $criteria->addJoin(BlockVersionPeer::ID, BlockPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = BlockVersionPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = BlockVersionPeer::getInstanceFromPool($key1))) { - // We no longer rehydrate the object, since this can cause data loss. - // See http://www.propelorm.org/ticket/509 - // $obj1->hydrate($row, 0, true); // rehydrate - } else { - - $omClass = BlockVersionPeer::getOMClass($row, 0); - $cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1); - - $obj1 = new $cls(); - $obj1->hydrate($row); - BlockVersionPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = BlockPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = BlockPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $omClass = BlockPeer::getOMClass($row, $startcol); - $cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - BlockPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (BlockVersion) to $obj2 (Block) - $obj2->addBlockVersion($obj1); - - } // if joined row was not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - - return $results; - } - - - /** - * Returns the number of rows matching criteria, joining all related tables - * - * @param Criteria $criteria - * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead. - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return int Number of matching rows. - */ - public static function doCountJoinAll(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - // we're going to 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(BlockVersionPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - BlockVersionPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count - - // Set the correct dbName - $criteria->setDbName(BlockVersionPeer::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(BlockVersionPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(BlockVersionPeer::ID, BlockPeer::ID, $join_behavior); - - $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 a collection of BlockVersion objects pre-filled with all related objects. - * - * @param Criteria $criteria - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return array Array of BlockVersion objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(BlockVersionPeer::DATABASE_NAME); - } - - BlockVersionPeer::addSelectColumns($criteria); - $startcol2 = BlockVersionPeer::NUM_HYDRATE_COLUMNS; - - BlockPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + BlockPeer::NUM_HYDRATE_COLUMNS; - - $criteria->addJoin(BlockVersionPeer::ID, BlockPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = BlockVersionPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = BlockVersionPeer::getInstanceFromPool($key1))) { - // We no longer rehydrate the object, since this can cause data loss. - // See http://www.propelorm.org/ticket/509 - // $obj1->hydrate($row, 0, true); // rehydrate - } else { - $omClass = BlockVersionPeer::getOMClass($row, 0); - $cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1); - - $obj1 = new $cls(); - $obj1->hydrate($row); - BlockVersionPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined Block rows - - $key2 = BlockPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = BlockPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $omClass = BlockPeer::getOMClass($row, $startcol2); - $cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - BlockPeer::addInstanceToPool($obj2, $key2); - } // if obj2 loaded - - // Add the $obj1 (BlockVersion) to the collection in $obj2 (Block) - $obj2->addBlockVersion($obj1); - } // if joined row not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - - return $results; - } - - /** - * 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(BlockVersionPeer::DATABASE_NAME)->getTable(BlockVersionPeer::TABLE_NAME); - } - - /** - * Add a TableMap instance to the database for this peer class. - */ - public static function buildTableMap() - { - $dbMap = Propel::getDatabaseMap(BaseBlockVersionPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseBlockVersionPeer::TABLE_NAME)) { - $dbMap->addTableObject(new \Trinity\Bundle\NewsletterBundle\Model\map\BlockVersionTableMap()); - } - } - - /** - * 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 = $row[$colnum + 3]; - $omClass = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1); - - } catch (Exception $e) { - throw new PropelException('Unable to get OM class.', $e); - } - - - $event = new DetectOMClassEvent($omClass); - EventDispatcherProxy::trigger('om.detect', $event); - if($event->isDetected()){ - return $event->getDetectedClass(); - } - - return $omClass; - } - - /** - * Performs an INSERT on the database, given a BlockVersion or Criteria object. - * - * @param mixed $values Criteria or BlockVersion 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(BlockVersionPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from BlockVersion object - } - - - // Set the correct dbName - $criteria->setDbName(BlockVersionPeer::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 BlockVersion or Criteria object. - * - * @param mixed $values Criteria or BlockVersion 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(BlockVersionPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(BlockVersionPeer::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(BlockVersionPeer::ID); - $value = $criteria->remove(BlockVersionPeer::ID); - if ($value) { - $selectCriteria->add(BlockVersionPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(BlockVersionPeer::TABLE_NAME); - } - - $comparison = $criteria->getComparison(BlockVersionPeer::VERSION); - $value = $criteria->remove(BlockVersionPeer::VERSION); - if ($value) { - $selectCriteria->add(BlockVersionPeer::VERSION, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(BlockVersionPeer::TABLE_NAME); - } - - } else { // $values is BlockVersion object - $criteria = $values->buildCriteria(); // gets full criteria - $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s) - } - - // set the correct dbName - $criteria->setDbName(BlockVersionPeer::DATABASE_NAME); - - return BasePeer::doUpdate($selectCriteria, $criteria, $con); - } - - /** - * Deletes all rows from the nws_block_version 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(BlockVersionPeer::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(BlockVersionPeer::TABLE_NAME, $con, BlockVersionPeer::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). - BlockVersionPeer::clearInstancePool(); - BlockVersionPeer::clearRelatedInstancePool(); - $con->commit(); - - return $affectedRows; - } catch (Exception $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs a DELETE on the database, given a BlockVersion or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or BlockVersion 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(BlockVersionPeer::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. - BlockVersionPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof BlockVersion) { // it's a model object - // invalidate the cache for this single object - BlockVersionPeer::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(BlockVersionPeer::DATABASE_NAME); - // primary key is composite; we therefore, expect - // the primary key passed to be an array of pkey values - if (count($values) == count($values, COUNT_RECURSIVE)) { - // array is not multi-dimensional - $values = array($values); - } - foreach ($values as $value) { - $criterion = $criteria->getNewCriterion(BlockVersionPeer::ID, $value[0]); - $criterion->addAnd($criteria->getNewCriterion(BlockVersionPeer::VERSION, $value[1])); - $criteria->addOr($criterion); - // we can invalidate the cache for this single PK - BlockVersionPeer::removeInstanceFromPool($value); - } - } - - // Set the correct dbName - $criteria->setDbName(BlockVersionPeer::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); - BlockVersionPeer::clearRelatedInstancePool(); - $con->commit(); - - return $affectedRows; - } catch (Exception $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given BlockVersion 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 BlockVersion $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(BlockVersionPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(BlockVersionPeer::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(BlockVersionPeer::DATABASE_NAME, BlockVersionPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve object using using composite pkey values. - * @param int $id - * @param int $version - * @param PropelPDO $con - * @return BlockVersion - */ - public static function retrieveByPK($id, $version, PropelPDO $con = null) { - $_instancePoolKey = serialize(array((string) $id, (string) $version)); - if (null !== ($obj = BlockVersionPeer::getInstanceFromPool($_instancePoolKey))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(BlockVersionPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - $criteria = new Criteria(BlockVersionPeer::DATABASE_NAME); - $criteria->add(BlockVersionPeer::ID, $id); - $criteria->add(BlockVersionPeer::VERSION, $version); - $v = BlockVersionPeer::doSelect($criteria, $con); - - return !empty($v) ? $v[0] : null; - } -} // BaseBlockVersionPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseBlockVersionPeer::buildTableMap(); - -EventDispatcherProxy::trigger(array('construct','peer.construct'), new PeerEvent('Trinity\Bundle\NewsletterBundle\Model\om\BaseBlockVersionPeer')); diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlockVersionQuery.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlockVersionQuery.php deleted file mode 100644 index da8e8aa..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseBlockVersionQuery.php +++ /dev/null @@ -1,896 +0,0 @@ -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(array(12, 34), $con); - * - * - * @param array $key Primary key to use for the query - A Primary key composition: [$id, $version] - * @param PropelPDO $con an optional connection object - * - * @return BlockVersion|BlockVersion[]|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ($key === null) { - return null; - } - if ((null !== ($obj = BlockVersionPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) { - // the object is already in the instance pool - return $obj; - } - if ($con === null) { - $con = Propel::getConnection(BlockVersionPeer::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); - } - } - - /** - * 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 BlockVersion A model object, or null if the key is not found - * @throws PropelException - */ - protected function findPkSimple($key, $con) - { - $sql = 'SELECT `id`, `name`, `value`, `class_key`, `template`, `model_id`, `created_at`, `updated_at`, `version`, `version_created_at`, `version_created_by`, `model_id_version` FROM `nws_block_version` WHERE `id` = :p0 AND `version` = :p1'; - try { - $stmt = $con->prepare($sql); - $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); - $stmt->bindValue(':p1', $key[1], 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 = BlockVersionPeer::getOMClass($row, 0); - $obj = new $cls(); - $obj->hydrate($row); - BlockVersionPeer::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1]))); - } - $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 BlockVersion|BlockVersion[]|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(array(12, 56), array(832, 123), array(123, 456)), $con); - * - * @param array $keys Primary keys to use for the query - * @param PropelPDO $con an optional connection object - * - * @return PropelObjectCollection|BlockVersion[]|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 BlockVersionQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - $this->addUsingAlias(BlockVersionPeer::ID, $key[0], Criteria::EQUAL); - $this->addUsingAlias(BlockVersionPeer::VERSION, $key[1], Criteria::EQUAL); - - return $this; - } - - /** - * Filter the query by a list of primary keys - * - * @param array $keys The list of primary key to use for the query - * - * @return BlockVersionQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - if (empty($keys)) { - return $this->add(null, '1<>1', Criteria::CUSTOM); - } - foreach ($keys as $key) { - $cton0 = $this->getNewCriterion(BlockVersionPeer::ID, $key[0], Criteria::EQUAL); - $cton1 = $this->getNewCriterion(BlockVersionPeer::VERSION, $key[1], Criteria::EQUAL); - $cton0->addAnd($cton1); - $this->addOr($cton0); - } - - return $this; - } - - /** - * 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 - * - * - * @see filterByBlock() - * - * @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 BlockVersionQuery 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(BlockVersionPeer::ID, $id['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($id['max'])) { - $this->addUsingAlias(BlockVersionPeer::ID, $id['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(BlockVersionPeer::ID, $id, $comparison); - } - - /** - * Filter the query on the name column - * - * Example usage: - * - * $query->filterByName('fooValue'); // WHERE name = 'fooValue' - * $query->filterByName('%fooValue%'); // WHERE name LIKE '%fooValue%' - * - * - * @param string $name 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 BlockVersionQuery The current query, for fluid interface - */ - public function filterByName($name = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($name)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $name)) { - $name = str_replace('*', '%', $name); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(BlockVersionPeer::NAME, $name, $comparison); - } - - /** - * Filter the query on the value column - * - * Example usage: - * - * $query->filterByValue('fooValue'); // WHERE value = 'fooValue' - * $query->filterByValue('%fooValue%'); // WHERE value LIKE '%fooValue%' - * - * - * @param string $value 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 BlockVersionQuery The current query, for fluid interface - */ - public function filterByValue($value = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($value)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $value)) { - $value = str_replace('*', '%', $value); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(BlockVersionPeer::VALUE, $value, $comparison); - } - - /** - * Filter the query on the class_key column - * - * Example usage: - * - * $query->filterByClassKey('fooValue'); // WHERE class_key = 'fooValue' - * $query->filterByClassKey('%fooValue%'); // WHERE class_key LIKE '%fooValue%' - * - * - * @param string $classKey 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 BlockVersionQuery The current query, for fluid interface - */ - public function filterByClassKey($classKey = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($classKey)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $classKey)) { - $classKey = str_replace('*', '%', $classKey); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(BlockVersionPeer::CLASS_KEY, $classKey, $comparison); - } - - /** - * Filter the query on the template column - * - * Example usage: - * - * $query->filterByTemplate('fooValue'); // WHERE template = 'fooValue' - * $query->filterByTemplate('%fooValue%'); // WHERE template LIKE '%fooValue%' - * - * - * @param string $template 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 BlockVersionQuery The current query, for fluid interface - */ - public function filterByTemplate($template = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($template)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $template)) { - $template = str_replace('*', '%', $template); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(BlockVersionPeer::TEMPLATE, $template, $comparison); - } - - /** - * Filter the query on the model_id column - * - * Example usage: - * - * $query->filterByModelId(1234); // WHERE model_id = 1234 - * $query->filterByModelId(array(12, 34)); // WHERE model_id IN (12, 34) - * $query->filterByModelId(array('min' => 12)); // WHERE model_id >= 12 - * $query->filterByModelId(array('max' => 12)); // WHERE model_id <= 12 - * - * - * @param mixed $modelId 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 BlockVersionQuery The current query, for fluid interface - */ - public function filterByModelId($modelId = null, $comparison = null) - { - if (is_array($modelId)) { - $useMinMax = false; - if (isset($modelId['min'])) { - $this->addUsingAlias(BlockVersionPeer::MODEL_ID, $modelId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($modelId['max'])) { - $this->addUsingAlias(BlockVersionPeer::MODEL_ID, $modelId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(BlockVersionPeer::MODEL_ID, $modelId, $comparison); - } - - /** - * Filter the query on the created_at column - * - * Example usage: - * - * $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14' - * $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14' - * $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at < '2011-03-13' - * - * - * @param mixed $createdAt The value to use as filter. - * Values can be integers (unix timestamps), DateTime objects, or strings. - * Empty strings are treated as NULL. - * 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 BlockVersionQuery The current query, for fluid interface - */ - public function filterByCreatedAt($createdAt = null, $comparison = null) - { - if (is_array($createdAt)) { - $useMinMax = false; - if (isset($createdAt['min'])) { - $this->addUsingAlias(BlockVersionPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($createdAt['max'])) { - $this->addUsingAlias(BlockVersionPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(BlockVersionPeer::CREATED_AT, $createdAt, $comparison); - } - - /** - * Filter the query on the updated_at column - * - * Example usage: - * - * $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14' - * $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14' - * $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at < '2011-03-13' - * - * - * @param mixed $updatedAt The value to use as filter. - * Values can be integers (unix timestamps), DateTime objects, or strings. - * Empty strings are treated as NULL. - * 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 BlockVersionQuery The current query, for fluid interface - */ - public function filterByUpdatedAt($updatedAt = null, $comparison = null) - { - if (is_array($updatedAt)) { - $useMinMax = false; - if (isset($updatedAt['min'])) { - $this->addUsingAlias(BlockVersionPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($updatedAt['max'])) { - $this->addUsingAlias(BlockVersionPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(BlockVersionPeer::UPDATED_AT, $updatedAt, $comparison); - } - - /** - * Filter the query on the version column - * - * Example usage: - * - * $query->filterByVersion(1234); // WHERE version = 1234 - * $query->filterByVersion(array(12, 34)); // WHERE version IN (12, 34) - * $query->filterByVersion(array('min' => 12)); // WHERE version >= 12 - * $query->filterByVersion(array('max' => 12)); // WHERE version <= 12 - * - * - * @param mixed $version 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 BlockVersionQuery The current query, for fluid interface - */ - public function filterByVersion($version = null, $comparison = null) - { - if (is_array($version)) { - $useMinMax = false; - if (isset($version['min'])) { - $this->addUsingAlias(BlockVersionPeer::VERSION, $version['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($version['max'])) { - $this->addUsingAlias(BlockVersionPeer::VERSION, $version['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(BlockVersionPeer::VERSION, $version, $comparison); - } - - /** - * Filter the query on the version_created_at column - * - * Example usage: - * - * $query->filterByVersionCreatedAt('2011-03-14'); // WHERE version_created_at = '2011-03-14' - * $query->filterByVersionCreatedAt('now'); // WHERE version_created_at = '2011-03-14' - * $query->filterByVersionCreatedAt(array('max' => 'yesterday')); // WHERE version_created_at < '2011-03-13' - * - * - * @param mixed $versionCreatedAt The value to use as filter. - * Values can be integers (unix timestamps), DateTime objects, or strings. - * Empty strings are treated as NULL. - * 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 BlockVersionQuery The current query, for fluid interface - */ - public function filterByVersionCreatedAt($versionCreatedAt = null, $comparison = null) - { - if (is_array($versionCreatedAt)) { - $useMinMax = false; - if (isset($versionCreatedAt['min'])) { - $this->addUsingAlias(BlockVersionPeer::VERSION_CREATED_AT, $versionCreatedAt['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($versionCreatedAt['max'])) { - $this->addUsingAlias(BlockVersionPeer::VERSION_CREATED_AT, $versionCreatedAt['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(BlockVersionPeer::VERSION_CREATED_AT, $versionCreatedAt, $comparison); - } - - /** - * Filter the query on the version_created_by column - * - * Example usage: - * - * $query->filterByVersionCreatedBy('fooValue'); // WHERE version_created_by = 'fooValue' - * $query->filterByVersionCreatedBy('%fooValue%'); // WHERE version_created_by LIKE '%fooValue%' - * - * - * @param string $versionCreatedBy 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 BlockVersionQuery The current query, for fluid interface - */ - public function filterByVersionCreatedBy($versionCreatedBy = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($versionCreatedBy)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $versionCreatedBy)) { - $versionCreatedBy = str_replace('*', '%', $versionCreatedBy); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(BlockVersionPeer::VERSION_CREATED_BY, $versionCreatedBy, $comparison); - } - - /** - * Filter the query on the model_id_version column - * - * Example usage: - * - * $query->filterByModelIdVersion(1234); // WHERE model_id_version = 1234 - * $query->filterByModelIdVersion(array(12, 34)); // WHERE model_id_version IN (12, 34) - * $query->filterByModelIdVersion(array('min' => 12)); // WHERE model_id_version >= 12 - * $query->filterByModelIdVersion(array('max' => 12)); // WHERE model_id_version <= 12 - * - * - * @param mixed $modelIdVersion 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 BlockVersionQuery The current query, for fluid interface - */ - public function filterByModelIdVersion($modelIdVersion = null, $comparison = null) - { - if (is_array($modelIdVersion)) { - $useMinMax = false; - if (isset($modelIdVersion['min'])) { - $this->addUsingAlias(BlockVersionPeer::MODEL_ID_VERSION, $modelIdVersion['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($modelIdVersion['max'])) { - $this->addUsingAlias(BlockVersionPeer::MODEL_ID_VERSION, $modelIdVersion['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(BlockVersionPeer::MODEL_ID_VERSION, $modelIdVersion, $comparison); - } - - /** - * Filter the query by a related Block object - * - * @param Block|PropelObjectCollection $block The related object(s) to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return BlockVersionQuery The current query, for fluid interface - * @throws PropelException - if the provided filter is invalid. - */ - public function filterByBlock($block, $comparison = null) - { - if ($block instanceof Block) { - return $this - ->addUsingAlias(BlockVersionPeer::ID, $block->getId(), $comparison); - } elseif ($block instanceof PropelObjectCollection) { - if (null === $comparison) { - $comparison = Criteria::IN; - } - - return $this - ->addUsingAlias(BlockVersionPeer::ID, $block->toKeyValue('PrimaryKey', 'Id'), $comparison); - } else { - throw new PropelException('filterByBlock() only accepts arguments of type Block or PropelCollection'); - } - } - - /** - * Adds a JOIN clause to the query using the Block relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return BlockVersionQuery The current query, for fluid interface - */ - public function joinBlock($relationAlias = null, $joinType = Criteria::INNER_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('Block'); - - // create a ModelJoin object for this join - $join = new ModelJoin(); - $join->setJoinType($joinType); - $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); - if ($previousJoin = $this->getPreviousJoin()) { - $join->setPreviousJoin($previousJoin); - } - - // add the ModelJoin to the current object - if ($relationAlias) { - $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); - $this->addJoinObject($join, $relationAlias); - } else { - $this->addJoinObject($join, 'Block'); - } - - return $this; - } - - /** - * Use the Block relation Block object - * - * @see useQuery() - * - * @param string $relationAlias optional alias for the relation, - * to be used as main alias in the secondary query - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return \Trinity\Bundle\NewsletterBundle\Model\BlockQuery A secondary query class using the current class as primary query - */ - public function useBlockQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) - { - return $this - ->joinBlock($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'Block', '\Trinity\Bundle\NewsletterBundle\Model\BlockQuery'); - } - - /** - * Exclude object from result - * - * @param BlockVersion $blockVersion Object to remove from the list of results - * - * @return BlockVersionQuery The current query, for fluid interface - */ - public function prune($blockVersion = null) - { - if ($blockVersion) { - $this->addCond('pruneCond0', $this->getAliasedColName(BlockVersionPeer::ID), $blockVersion->getId(), Criteria::NOT_EQUAL); - $this->addCond('pruneCond1', $this->getAliasedColName(BlockVersionPeer::VERSION), $blockVersion->getVersion(), Criteria::NOT_EQUAL); - $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR); - } - - return $this; - } - - /** - * Code to execute before every SELECT statement - * - * @param PropelPDO $con The connection object used by the query - */ - protected function basePreSelect(PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger('query.select.pre', new QueryEvent($this)); - - return $this->preSelect($con); - } - - /** - * Code to execute before every DELETE statement - * - * @param PropelPDO $con The connection object used by the query - */ - protected function basePreDelete(PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger(array('delete.pre','query.delete.pre'), new QueryEvent($this)); - - return $this->preDelete($con); - } - - /** - * Code to execute after every DELETE statement - * - * @param int $affectedRows the number of deleted rows - * @param PropelPDO $con The connection object used by the query - */ - protected function basePostDelete($affectedRows, PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger(array('delete.post','query.delete.post'), new QueryEvent($this)); - - return $this->postDelete($affectedRows, $con); - } - - /** - * Code to execute before every UPDATE statement - * - * @param array $values The associative array of columns and values for the update - * @param PropelPDO $con The connection object used by the query - * @param boolean $forceIndividualSaves If false (default), the resulting call is a BasePeer::doUpdate(), otherwise it is a series of save() calls on all the found objects - */ - protected function basePreUpdate(&$values, PropelPDO $con, $forceIndividualSaves = false) - { - // event behavior - EventDispatcherProxy::trigger(array('update.pre', 'query.update.pre'), new QueryEvent($this)); - - return $this->preUpdate($values, $con, $forceIndividualSaves); - } - - /** - * Code to execute after every UPDATE statement - * - * @param int $affectedRows the number of updated rows - * @param PropelPDO $con The connection object used by the query - */ - protected function basePostUpdate($affectedRows, PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger(array('update.post', 'query.update.post'), new QueryEvent($this)); - - return $this->postUpdate($affectedRows, $con); - } - - // extend behavior - public function setFormatter($formatter) - { - if (is_string($formatter) && $formatter === \ModelCriteria::FORMAT_ON_DEMAND) { - $formatter = '\Glorpen\Propel\PropelBundle\Formatter\PropelOnDemandFormatter'; - } - - return parent::setFormatter($formatter); - } -} diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModel.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModel.php deleted file mode 100644 index 4fc46e7..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModel.php +++ /dev/null @@ -1,2658 +0,0 @@ -version = 0; - } - - /** - * Initializes internal state of BaseModel object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - EventDispatcherProxy::trigger(array('construct','model.construct'), new ModelEvent($this)); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getId() - { - - return $this->id; - } - - /** - * Get the [name] column value. - * - * @return string - */ - public function getName() - { - - return $this->name; - } - - /** - * Get the [template] column value. - * - * @return string - */ - public function getTemplate() - { - - return $this->template; - } - - /** - * Get the [class_key] column value. - * - * @return string - */ - public function getClassKey() - { - - return $this->class_key; - } - - /** - * Get the [optionally formatted] temporal [created_at] column value. - * - * - * @param string $format The date/time format string (either date()-style or strftime()-style). - * If format is null, then the raw DateTime object will be returned. - * @return mixed Formatted date/time value as string or DateTime object (if format is null), null if column is null, and 0 if column value is 0000-00-00 00:00:00 - * @throws PropelException - if unable to parse/validate the date/time value. - */ - public function getCreatedAt($format = null) - { - if ($this->created_at === null) { - return null; - } - - if ($this->created_at === '0000-00-00 00:00:00') { - // while technically this is not a default value of null, - // this seems to be closest in meaning. - return null; - } - - try { - $dt = new DateTime($this->created_at); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->created_at, true), $x); - } - - if ($format === null) { - // Because propel.useDateTimeClass is true, we return a DateTime object. - return $dt; - } - - if (strpos($format, '%') !== false) { - return strftime($format, $dt->format('U')); - } - - return $dt->format($format); - - } - - /** - * Get the [optionally formatted] temporal [updated_at] column value. - * - * - * @param string $format The date/time format string (either date()-style or strftime()-style). - * If format is null, then the raw DateTime object will be returned. - * @return mixed Formatted date/time value as string or DateTime object (if format is null), null if column is null, and 0 if column value is 0000-00-00 00:00:00 - * @throws PropelException - if unable to parse/validate the date/time value. - */ - public function getUpdatedAt($format = null) - { - if ($this->updated_at === null) { - return null; - } - - if ($this->updated_at === '0000-00-00 00:00:00') { - // while technically this is not a default value of null, - // this seems to be closest in meaning. - return null; - } - - try { - $dt = new DateTime($this->updated_at); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->updated_at, true), $x); - } - - if ($format === null) { - // Because propel.useDateTimeClass is true, we return a DateTime object. - return $dt; - } - - if (strpos($format, '%') !== false) { - return strftime($format, $dt->format('U')); - } - - return $dt->format($format); - - } - - /** - * Get the [version] column value. - * - * @return int - */ - public function getVersion() - { - - return $this->version; - } - - /** - * Get the [optionally formatted] temporal [version_created_at] column value. - * - * - * @param string $format The date/time format string (either date()-style or strftime()-style). - * If format is null, then the raw DateTime object will be returned. - * @return mixed Formatted date/time value as string or DateTime object (if format is null), null if column is null, and 0 if column value is 0000-00-00 00:00:00 - * @throws PropelException - if unable to parse/validate the date/time value. - */ - public function getVersionCreatedAt($format = null) - { - if ($this->version_created_at === null) { - return null; - } - - if ($this->version_created_at === '0000-00-00 00:00:00') { - // while technically this is not a default value of null, - // this seems to be closest in meaning. - return null; - } - - try { - $dt = new DateTime($this->version_created_at); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->version_created_at, true), $x); - } - - if ($format === null) { - // Because propel.useDateTimeClass is true, we return a DateTime object. - return $dt; - } - - if (strpos($format, '%') !== false) { - return strftime($format, $dt->format('U')); - } - - return $dt->format($format); - - } - - /** - * Get the [version_created_by] column value. - * - * @return string - */ - public function getVersionCreatedBy() - { - - return $this->version_created_by; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return Model 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[] = ModelPeer::ID; - } - - - return $this; - } // setId() - - /** - * Set the value of [name] column. - * - * @param string $v new value - * @return Model The current object (for fluent API support) - */ - public function setName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->name !== $v) { - $this->name = $v; - $this->modifiedColumns[] = ModelPeer::NAME; - } - - - return $this; - } // setName() - - /** - * Set the value of [template] column. - * - * @param string $v new value - * @return Model The current object (for fluent API support) - */ - public function setTemplate($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->template !== $v) { - $this->template = $v; - $this->modifiedColumns[] = ModelPeer::TEMPLATE; - } - - - return $this; - } // setTemplate() - - /** - * Set the value of [class_key] column. - * - * @param string $v new value - * @return Model The current object (for fluent API support) - */ - public function setClassKey($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->class_key !== $v) { - $this->class_key = $v; - $this->modifiedColumns[] = ModelPeer::CLASS_KEY; - } - - - return $this; - } // setClassKey() - - /** - * Sets the value of [created_at] column to a normalized version of the date/time value specified. - * - * @param mixed $v string, integer (timestamp), or DateTime value. - * Empty strings are treated as null. - * @return Model The current object (for fluent API support) - */ - public function setCreatedAt($v) - { - $dt = PropelDateTime::newInstance($v, null, 'DateTime'); - if ($this->created_at !== null || $dt !== null) { - $currentDateAsString = ($this->created_at !== null && $tmpDt = new DateTime($this->created_at)) ? $tmpDt->format('Y-m-d H:i:s') : null; - $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null; - if ($currentDateAsString !== $newDateAsString) { - $this->created_at = $newDateAsString; - $this->modifiedColumns[] = ModelPeer::CREATED_AT; - } - } // if either are not null - - - return $this; - } // setCreatedAt() - - /** - * Sets the value of [updated_at] column to a normalized version of the date/time value specified. - * - * @param mixed $v string, integer (timestamp), or DateTime value. - * Empty strings are treated as null. - * @return Model The current object (for fluent API support) - */ - public function setUpdatedAt($v) - { - $dt = PropelDateTime::newInstance($v, null, 'DateTime'); - if ($this->updated_at !== null || $dt !== null) { - $currentDateAsString = ($this->updated_at !== null && $tmpDt = new DateTime($this->updated_at)) ? $tmpDt->format('Y-m-d H:i:s') : null; - $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null; - if ($currentDateAsString !== $newDateAsString) { - $this->updated_at = $newDateAsString; - $this->modifiedColumns[] = ModelPeer::UPDATED_AT; - } - } // if either are not null - - - return $this; - } // setUpdatedAt() - - /** - * Set the value of [version] column. - * - * @param int $v new value - * @return Model The current object (for fluent API support) - */ - public function setVersion($v) - { - if ($v !== null && is_numeric($v)) { - $v = (int) $v; - } - - if ($this->version !== $v) { - $this->version = $v; - $this->modifiedColumns[] = ModelPeer::VERSION; - } - - - return $this; - } // setVersion() - - /** - * Sets the value of [version_created_at] column to a normalized version of the date/time value specified. - * - * @param mixed $v string, integer (timestamp), or DateTime value. - * Empty strings are treated as null. - * @return Model The current object (for fluent API support) - */ - public function setVersionCreatedAt($v) - { - $dt = PropelDateTime::newInstance($v, null, 'DateTime'); - if ($this->version_created_at !== null || $dt !== null) { - $currentDateAsString = ($this->version_created_at !== null && $tmpDt = new DateTime($this->version_created_at)) ? $tmpDt->format('Y-m-d H:i:s') : null; - $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null; - if ($currentDateAsString !== $newDateAsString) { - $this->version_created_at = $newDateAsString; - $this->modifiedColumns[] = ModelPeer::VERSION_CREATED_AT; - } - } // if either are not null - - - return $this; - } // setVersionCreatedAt() - - /** - * Set the value of [version_created_by] column. - * - * @param string $v new value - * @return Model The current object (for fluent API support) - */ - public function setVersionCreatedBy($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->version_created_by !== $v) { - $this->version_created_by = $v; - $this->modifiedColumns[] = ModelPeer::VERSION_CREATED_BY; - } - - - return $this; - } // setVersionCreatedBy() - - /** - * 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() - { - if ($this->version !== 0) { - return false; - } - - // 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->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->template = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->class_key = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->created_at = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->updated_at = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; - $this->version = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null; - $this->version_created_at = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null; - $this->version_created_by = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - $this->postHydrate($row, $startcol, $rehydrate); - - return $startcol + 9; // 9 = ModelPeer::NUM_HYDRATE_COLUMNS. - - } catch (Exception $e) { - throw new PropelException("Error populating Model 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(ModelPeer::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 = ModelPeer::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? - - $this->collNewsletters = null; - - $this->collBlocks = null; - - $this->collModelVersions = null; - - } // 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(ModelPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $deleteQuery = ModelQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()); - $ret = $this->preDelete($con); - // event behavior - EventDispatcherProxy::trigger(array('delete.pre','model.delete.pre'), new ModelEvent($this)); - if ($ret) { - $deleteQuery->delete($con); - $this->postDelete($con); - // versionable behavior - // emulate delete cascade - ModelVersionQuery::create() - ->filterByModel($this) - ->delete($con); - // event behavior - EventDispatcherProxy::trigger(array('delete.post', 'model.delete.post'), new ModelEvent($this)); - $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(ModelPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - // versionable behavior - if ($this->isVersioningNecessary()) { - $this->setVersion($this->isNew() ? 1 : $this->getLastVersionNumber($con) + 1); - if (!$this->isColumnModified(ModelPeer::VERSION_CREATED_AT)) { - $this->setVersionCreatedAt(time()); - } - $createVersion = true; // for postSave hook - } - // event behavior - EventDispatcherProxy::trigger('model.save.pre', new ModelEvent($this)); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - // timestampable behavior - if (!$this->isColumnModified(ModelPeer::CREATED_AT)) { - $this->setCreatedAt(time()); - } - if (!$this->isColumnModified(ModelPeer::UPDATED_AT)) { - $this->setUpdatedAt(time()); - } - // event behavior - EventDispatcherProxy::trigger('model.insert.pre', new ModelEvent($this)); - } else { - $ret = $ret && $this->preUpdate($con); - // timestampable behavior - if ($this->isModified() && !$this->isColumnModified(ModelPeer::UPDATED_AT)) { - $this->setUpdatedAt(time()); - } - // event behavior - EventDispatcherProxy::trigger(array('update.pre', 'model.update.pre'), new ModelEvent($this)); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - // event behavior - EventDispatcherProxy::trigger('model.insert.post', new ModelEvent($this)); - } else { - $this->postUpdate($con); - // event behavior - EventDispatcherProxy::trigger(array('update.post', 'model.update.post'), new ModelEvent($this)); - } - $this->postSave($con); - // versionable behavior - if (isset($createVersion)) { - $this->addVersion($con); - } - // event behavior - EventDispatcherProxy::trigger('model.save.post', new ModelEvent($this)); - ModelPeer::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(); - } - - if ($this->newslettersScheduledForDeletion !== null) { - if (!$this->newslettersScheduledForDeletion->isEmpty()) { - foreach ($this->newslettersScheduledForDeletion as $newsletter) { - // need to save related object because we set the relation to null - $newsletter->save($con); - } - $this->newslettersScheduledForDeletion = null; - } - } - - if ($this->collNewsletters !== null) { - foreach ($this->collNewsletters as $referrerFK) { - if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { - $affectedRows += $referrerFK->save($con); - } - } - } - - if ($this->blocksScheduledForDeletion !== null) { - if (!$this->blocksScheduledForDeletion->isEmpty()) { - BlockQuery::create() - ->filterByPrimaryKeys($this->blocksScheduledForDeletion->getPrimaryKeys(false)) - ->delete($con); - $this->blocksScheduledForDeletion = null; - } - } - - if ($this->collBlocks !== null) { - foreach ($this->collBlocks as $referrerFK) { - if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { - $affectedRows += $referrerFK->save($con); - } - } - } - - if ($this->modelVersionsScheduledForDeletion !== null) { - if (!$this->modelVersionsScheduledForDeletion->isEmpty()) { - ModelVersionQuery::create() - ->filterByPrimaryKeys($this->modelVersionsScheduledForDeletion->getPrimaryKeys(false)) - ->delete($con); - $this->modelVersionsScheduledForDeletion = null; - } - } - - if ($this->collModelVersions !== null) { - foreach ($this->collModelVersions as $referrerFK) { - if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { - $affectedRows += $referrerFK->save($con); - } - } - } - - $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[] = ModelPeer::ID; - if (null !== $this->id) { - throw new PropelException('Cannot insert a value for auto-increment primary key (' . ModelPeer::ID . ')'); - } - - // check the columns in natural order for more readable SQL queries - if ($this->isColumnModified(ModelPeer::ID)) { - $modifiedColumns[':p' . $index++] = '`id`'; - } - if ($this->isColumnModified(ModelPeer::NAME)) { - $modifiedColumns[':p' . $index++] = '`name`'; - } - if ($this->isColumnModified(ModelPeer::TEMPLATE)) { - $modifiedColumns[':p' . $index++] = '`template`'; - } - if ($this->isColumnModified(ModelPeer::CLASS_KEY)) { - $modifiedColumns[':p' . $index++] = '`class_key`'; - } - if ($this->isColumnModified(ModelPeer::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`created_at`'; - } - if ($this->isColumnModified(ModelPeer::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`updated_at`'; - } - if ($this->isColumnModified(ModelPeer::VERSION)) { - $modifiedColumns[':p' . $index++] = '`version`'; - } - if ($this->isColumnModified(ModelPeer::VERSION_CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`version_created_at`'; - } - if ($this->isColumnModified(ModelPeer::VERSION_CREATED_BY)) { - $modifiedColumns[':p' . $index++] = '`version_created_by`'; - } - - $sql = sprintf( - 'INSERT INTO `nws_model` (%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 '`name`': - $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR); - break; - case '`template`': - $stmt->bindValue($identifier, $this->template, PDO::PARAM_STR); - break; - case '`class_key`': - $stmt->bindValue($identifier, $this->class_key, PDO::PARAM_STR); - break; - case '`created_at`': - $stmt->bindValue($identifier, $this->created_at, PDO::PARAM_STR); - break; - case '`updated_at`': - $stmt->bindValue($identifier, $this->updated_at, PDO::PARAM_STR); - break; - case '`version`': - $stmt->bindValue($identifier, $this->version, PDO::PARAM_INT); - break; - case '`version_created_at`': - $stmt->bindValue($identifier, $this->version_created_at, PDO::PARAM_STR); - break; - case '`version_created_by`': - $stmt->bindValue($identifier, $this->version_created_by, 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 = ModelPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - if ($this->collNewsletters !== null) { - foreach ($this->collNewsletters as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collBlocks !== null) { - foreach ($this->collBlocks as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collModelVersions !== null) { - foreach ($this->collModelVersions as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - - $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 = ModelPeer::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->getName(); - break; - case 2: - return $this->getTemplate(); - break; - case 3: - return $this->getClassKey(); - break; - case 4: - return $this->getCreatedAt(); - break; - case 5: - return $this->getUpdatedAt(); - break; - case 6: - return $this->getVersion(); - break; - case 7: - return $this->getVersionCreatedAt(); - break; - case 8: - return $this->getVersionCreatedBy(); - 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 - * @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false) - { - if (isset($alreadyDumpedObjects['Model'][$this->getPrimaryKey()])) { - return '*RECURSION*'; - } - $alreadyDumpedObjects['Model'][$this->getPrimaryKey()] = true; - $keys = ModelPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getId(), - $keys[1] => $this->getName(), - $keys[2] => $this->getTemplate(), - $keys[3] => $this->getClassKey(), - $keys[4] => $this->getCreatedAt(), - $keys[5] => $this->getUpdatedAt(), - $keys[6] => $this->getVersion(), - $keys[7] => $this->getVersionCreatedAt(), - $keys[8] => $this->getVersionCreatedBy(), - ); - $virtualColumns = $this->virtualColumns; - foreach ($virtualColumns as $key => $virtualColumn) { - $result[$key] = $virtualColumn; - } - - if ($includeForeignObjects) { - if (null !== $this->collNewsletters) { - $result['Newsletters'] = $this->collNewsletters->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); - } - if (null !== $this->collBlocks) { - $result['Blocks'] = $this->collBlocks->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); - } - if (null !== $this->collModelVersions) { - $result['ModelVersions'] = $this->collModelVersions->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); - } - } - - 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 = ModelPeer::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->setName($value); - break; - case 2: - $this->setTemplate($value); - break; - case 3: - $this->setClassKey($value); - break; - case 4: - $this->setCreatedAt($value); - break; - case 5: - $this->setUpdatedAt($value); - break; - case 6: - $this->setVersion($value); - break; - case 7: - $this->setVersionCreatedAt($value); - break; - case 8: - $this->setVersionCreatedBy($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 = ModelPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setName($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setTemplate($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setClassKey($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setCreatedAt($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setUpdatedAt($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setVersion($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setVersionCreatedAt($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setVersionCreatedBy($arr[$keys[8]]); - } - - /** - * 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(ModelPeer::DATABASE_NAME); - - if ($this->isColumnModified(ModelPeer::ID)) $criteria->add(ModelPeer::ID, $this->id); - if ($this->isColumnModified(ModelPeer::NAME)) $criteria->add(ModelPeer::NAME, $this->name); - if ($this->isColumnModified(ModelPeer::TEMPLATE)) $criteria->add(ModelPeer::TEMPLATE, $this->template); - if ($this->isColumnModified(ModelPeer::CLASS_KEY)) $criteria->add(ModelPeer::CLASS_KEY, $this->class_key); - if ($this->isColumnModified(ModelPeer::CREATED_AT)) $criteria->add(ModelPeer::CREATED_AT, $this->created_at); - if ($this->isColumnModified(ModelPeer::UPDATED_AT)) $criteria->add(ModelPeer::UPDATED_AT, $this->updated_at); - if ($this->isColumnModified(ModelPeer::VERSION)) $criteria->add(ModelPeer::VERSION, $this->version); - if ($this->isColumnModified(ModelPeer::VERSION_CREATED_AT)) $criteria->add(ModelPeer::VERSION_CREATED_AT, $this->version_created_at); - if ($this->isColumnModified(ModelPeer::VERSION_CREATED_BY)) $criteria->add(ModelPeer::VERSION_CREATED_BY, $this->version_created_by); - - 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(ModelPeer::DATABASE_NAME); - $criteria->add(ModelPeer::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 Model (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->setName($this->getName()); - $copyObj->setTemplate($this->getTemplate()); - $copyObj->setClassKey($this->getClassKey()); - $copyObj->setCreatedAt($this->getCreatedAt()); - $copyObj->setUpdatedAt($this->getUpdatedAt()); - $copyObj->setVersion($this->getVersion()); - $copyObj->setVersionCreatedAt($this->getVersionCreatedAt()); - $copyObj->setVersionCreatedBy($this->getVersionCreatedBy()); - - if ($deepCopy && !$this->startCopy) { - // important: temporarily setNew(false) because this affects the behavior of - // the getter/setter methods for fkey referrer objects. - $copyObj->setNew(false); - // store object hash to prevent cycle - $this->startCopy = true; - - foreach ($this->getNewsletters() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addNewsletter($relObj->copy($deepCopy)); - } - } - - foreach ($this->getBlocks() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addBlock($relObj->copy($deepCopy)); - } - } - - foreach ($this->getModelVersions() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addModelVersion($relObj->copy($deepCopy)); - } - } - - //unflag object copy - $this->startCopy = false; - } // if ($deepCopy) - - 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 Model 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 ModelPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new ModelPeer(); - } - - return self::$peer; - } - - - /** - * Initializes a collection based on the name of a relation. - * Avoids crafting an 'init[$relationName]s' method name - * that wouldn't work when StandardEnglishPluralizer is used. - * - * @param string $relationName The name of the relation to initialize - * @return void - */ - public function initRelation($relationName) - { - if ('Newsletter' == $relationName) { - $this->initNewsletters(); - } - if ('Block' == $relationName) { - $this->initBlocks(); - } - if ('ModelVersion' == $relationName) { - $this->initModelVersions(); - } - } - - /** - * Clears out the collNewsletters collection - * - * This does not modify the database; however, it will remove any associated objects, causing - * them to be refetched by subsequent calls to accessor method. - * - * @return Model The current object (for fluent API support) - * @see addNewsletters() - */ - public function clearNewsletters() - { - $this->collNewsletters = null; // important to set this to null since that means it is uninitialized - $this->collNewslettersPartial = null; - - return $this; - } - - /** - * reset is the collNewsletters collection loaded partially - * - * @return void - */ - public function resetPartialNewsletters($v = true) - { - $this->collNewslettersPartial = $v; - } - - /** - * Initializes the collNewsletters collection. - * - * By default this just sets the collNewsletters collection to an empty array (like clearcollNewsletters()); - * however, you may wish to override this method in your stub class to provide setting appropriate - * to your application -- for example, setting the initial array to the values stored in database. - * - * @param boolean $overrideExisting If set to true, the method call initializes - * the collection even if it is not empty - * - * @return void - */ - public function initNewsletters($overrideExisting = true) - { - if (null !== $this->collNewsletters && !$overrideExisting) { - return; - } - $this->collNewsletters = new PropelObjectCollection(); - $this->collNewsletters->setModel('Newsletter'); - } - - /** - * Gets an array of Newsletter objects which contain a foreign key that references this object. - * - * If the $criteria is not null, it is used to always fetch the results from the database. - * Otherwise the results are fetched from the database the first time, then cached. - * Next time the same method is called without $criteria, the cached collection is returned. - * If this Model is new, it will return - * an empty collection or the current collection; the criteria is ignored on a new object. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @return PropelObjectCollection|Newsletter[] List of Newsletter objects - * @throws PropelException - */ - public function getNewsletters($criteria = null, PropelPDO $con = null) - { - $partial = $this->collNewslettersPartial && !$this->isNew(); - if (null === $this->collNewsletters || null !== $criteria || $partial) { - if ($this->isNew() && null === $this->collNewsletters) { - // return empty collection - $this->initNewsletters(); - } else { - $collNewsletters = NewsletterQuery::create(null, $criteria) - ->filterByModel($this) - ->find($con); - if (null !== $criteria) { - if (false !== $this->collNewslettersPartial && count($collNewsletters)) { - $this->initNewsletters(false); - - foreach ($collNewsletters as $obj) { - if (false == $this->collNewsletters->contains($obj)) { - $this->collNewsletters->append($obj); - } - } - - $this->collNewslettersPartial = true; - } - - $collNewsletters->getInternalIterator()->rewind(); - - return $collNewsletters; - } - - if ($partial && $this->collNewsletters) { - foreach ($this->collNewsletters as $obj) { - if ($obj->isNew()) { - $collNewsletters[] = $obj; - } - } - } - - $this->collNewsletters = $collNewsletters; - $this->collNewslettersPartial = false; - } - } - - return $this->collNewsletters; - } - - /** - * Sets a collection of Newsletter objects related by a one-to-many relationship - * to the current object. - * It will also schedule objects for deletion based on a diff between old objects (aka persisted) - * and new objects from the given Propel collection. - * - * @param PropelCollection $newsletters A Propel collection. - * @param PropelPDO $con Optional connection object - * @return Model The current object (for fluent API support) - */ - public function setNewsletters(PropelCollection $newsletters, PropelPDO $con = null) - { - $newslettersToDelete = $this->getNewsletters(new Criteria(), $con)->diff($newsletters); - - - $this->newslettersScheduledForDeletion = $newslettersToDelete; - - foreach ($newslettersToDelete as $newsletterRemoved) { - $newsletterRemoved->setModel(null); - } - - $this->collNewsletters = null; - foreach ($newsletters as $newsletter) { - $this->addNewsletter($newsletter); - } - - $this->collNewsletters = $newsletters; - $this->collNewslettersPartial = false; - - return $this; - } - - /** - * Returns the number of related Newsletter objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related Newsletter objects. - * @throws PropelException - */ - public function countNewsletters(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - $partial = $this->collNewslettersPartial && !$this->isNew(); - if (null === $this->collNewsletters || null !== $criteria || $partial) { - if ($this->isNew() && null === $this->collNewsletters) { - return 0; - } - - if ($partial && !$criteria) { - return count($this->getNewsletters()); - } - $query = NewsletterQuery::create(null, $criteria); - if ($distinct) { - $query->distinct(); - } - - return $query - ->filterByModel($this) - ->count($con); - } - - return count($this->collNewsletters); - } - - /** - * Method called to associate a Newsletter object to this object - * through the Newsletter foreign key attribute. - * - * @param Newsletter $l Newsletter - * @return Model The current object (for fluent API support) - */ - public function addNewsletter(Newsletter $l) - { - if ($this->collNewsletters === null) { - $this->initNewsletters(); - $this->collNewslettersPartial = true; - } - - if (!in_array($l, $this->collNewsletters->getArrayCopy(), true)) { // only add it if the **same** object is not already associated - $this->doAddNewsletter($l); - - if ($this->newslettersScheduledForDeletion and $this->newslettersScheduledForDeletion->contains($l)) { - $this->newslettersScheduledForDeletion->remove($this->newslettersScheduledForDeletion->search($l)); - } - } - - return $this; - } - - /** - * @param Newsletter $newsletter The newsletter object to add. - */ - protected function doAddNewsletter($newsletter) - { - $this->collNewsletters[]= $newsletter; - $newsletter->setModel($this); - } - - /** - * @param Newsletter $newsletter The newsletter object to remove. - * @return Model The current object (for fluent API support) - */ - public function removeNewsletter($newsletter) - { - if ($this->getNewsletters()->contains($newsletter)) { - $this->collNewsletters->remove($this->collNewsletters->search($newsletter)); - if (null === $this->newslettersScheduledForDeletion) { - $this->newslettersScheduledForDeletion = clone $this->collNewsletters; - $this->newslettersScheduledForDeletion->clear(); - } - $this->newslettersScheduledForDeletion[]= $newsletter; - $newsletter->setModel(null); - } - - return $this; - } - - /** - * Clears out the collBlocks collection - * - * This does not modify the database; however, it will remove any associated objects, causing - * them to be refetched by subsequent calls to accessor method. - * - * @return Model The current object (for fluent API support) - * @see addBlocks() - */ - public function clearBlocks() - { - $this->collBlocks = null; // important to set this to null since that means it is uninitialized - $this->collBlocksPartial = null; - - return $this; - } - - /** - * reset is the collBlocks collection loaded partially - * - * @return void - */ - public function resetPartialBlocks($v = true) - { - $this->collBlocksPartial = $v; - } - - /** - * Initializes the collBlocks collection. - * - * By default this just sets the collBlocks collection to an empty array (like clearcollBlocks()); - * however, you may wish to override this method in your stub class to provide setting appropriate - * to your application -- for example, setting the initial array to the values stored in database. - * - * @param boolean $overrideExisting If set to true, the method call initializes - * the collection even if it is not empty - * - * @return void - */ - public function initBlocks($overrideExisting = true) - { - if (null !== $this->collBlocks && !$overrideExisting) { - return; - } - $this->collBlocks = new PropelObjectCollection(); - $this->collBlocks->setModel('Block'); - } - - /** - * Gets an array of Block objects which contain a foreign key that references this object. - * - * If the $criteria is not null, it is used to always fetch the results from the database. - * Otherwise the results are fetched from the database the first time, then cached. - * Next time the same method is called without $criteria, the cached collection is returned. - * If this Model is new, it will return - * an empty collection or the current collection; the criteria is ignored on a new object. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @return PropelObjectCollection|Block[] List of Block objects - * @throws PropelException - */ - public function getBlocks($criteria = null, PropelPDO $con = null) - { - $partial = $this->collBlocksPartial && !$this->isNew(); - if (null === $this->collBlocks || null !== $criteria || $partial) { - if ($this->isNew() && null === $this->collBlocks) { - // return empty collection - $this->initBlocks(); - } else { - $collBlocks = BlockQuery::create(null, $criteria) - ->filterByModel($this) - ->find($con); - if (null !== $criteria) { - if (false !== $this->collBlocksPartial && count($collBlocks)) { - $this->initBlocks(false); - - foreach ($collBlocks as $obj) { - if (false == $this->collBlocks->contains($obj)) { - $this->collBlocks->append($obj); - } - } - - $this->collBlocksPartial = true; - } - - $collBlocks->getInternalIterator()->rewind(); - - return $collBlocks; - } - - if ($partial && $this->collBlocks) { - foreach ($this->collBlocks as $obj) { - if ($obj->isNew()) { - $collBlocks[] = $obj; - } - } - } - - $this->collBlocks = $collBlocks; - $this->collBlocksPartial = false; - } - } - - return $this->collBlocks; - } - - /** - * Sets a collection of Block objects related by a one-to-many relationship - * to the current object. - * It will also schedule objects for deletion based on a diff between old objects (aka persisted) - * and new objects from the given Propel collection. - * - * @param PropelCollection $blocks A Propel collection. - * @param PropelPDO $con Optional connection object - * @return Model The current object (for fluent API support) - */ - public function setBlocks(PropelCollection $blocks, PropelPDO $con = null) - { - $blocksToDelete = $this->getBlocks(new Criteria(), $con)->diff($blocks); - - - $this->blocksScheduledForDeletion = $blocksToDelete; - - foreach ($blocksToDelete as $blockRemoved) { - $blockRemoved->setModel(null); - } - - $this->collBlocks = null; - foreach ($blocks as $block) { - $this->addBlock($block); - } - - $this->collBlocks = $blocks; - $this->collBlocksPartial = false; - - return $this; - } - - /** - * Returns the number of related Block objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related Block objects. - * @throws PropelException - */ - public function countBlocks(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - $partial = $this->collBlocksPartial && !$this->isNew(); - if (null === $this->collBlocks || null !== $criteria || $partial) { - if ($this->isNew() && null === $this->collBlocks) { - return 0; - } - - if ($partial && !$criteria) { - return count($this->getBlocks()); - } - $query = BlockQuery::create(null, $criteria); - if ($distinct) { - $query->distinct(); - } - - return $query - ->filterByModel($this) - ->count($con); - } - - return count($this->collBlocks); - } - - /** - * Method called to associate a BaseBlock object to this object - * through the BaseBlock foreign key attribute. - * - * @param BaseBlock $l BaseBlock - * @return Model The current object (for fluent API support) - */ - public function addBlock(BaseBlock $l) - { - if ($this->collBlocks === null) { - $this->initBlocks(); - $this->collBlocksPartial = true; - } - - if (!in_array($l, $this->collBlocks->getArrayCopy(), true)) { // only add it if the **same** object is not already associated - $this->doAddBlock($l); - - if ($this->blocksScheduledForDeletion and $this->blocksScheduledForDeletion->contains($l)) { - $this->blocksScheduledForDeletion->remove($this->blocksScheduledForDeletion->search($l)); - } - } - - return $this; - } - - /** - * @param Block $block The block object to add. - */ - protected function doAddBlock($block) - { - $this->collBlocks[]= $block; - $block->setModel($this); - } - - /** - * @param Block $block The block object to remove. - * @return Model The current object (for fluent API support) - */ - public function removeBlock($block) - { - if ($this->getBlocks()->contains($block)) { - $this->collBlocks->remove($this->collBlocks->search($block)); - if (null === $this->blocksScheduledForDeletion) { - $this->blocksScheduledForDeletion = clone $this->collBlocks; - $this->blocksScheduledForDeletion->clear(); - } - $this->blocksScheduledForDeletion[]= $block; - $block->setModel(null); - } - - return $this; - } - - /** - * Clears out the collModelVersions collection - * - * This does not modify the database; however, it will remove any associated objects, causing - * them to be refetched by subsequent calls to accessor method. - * - * @return Model The current object (for fluent API support) - * @see addModelVersions() - */ - public function clearModelVersions() - { - $this->collModelVersions = null; // important to set this to null since that means it is uninitialized - $this->collModelVersionsPartial = null; - - return $this; - } - - /** - * reset is the collModelVersions collection loaded partially - * - * @return void - */ - public function resetPartialModelVersions($v = true) - { - $this->collModelVersionsPartial = $v; - } - - /** - * Initializes the collModelVersions collection. - * - * By default this just sets the collModelVersions collection to an empty array (like clearcollModelVersions()); - * however, you may wish to override this method in your stub class to provide setting appropriate - * to your application -- for example, setting the initial array to the values stored in database. - * - * @param boolean $overrideExisting If set to true, the method call initializes - * the collection even if it is not empty - * - * @return void - */ - public function initModelVersions($overrideExisting = true) - { - if (null !== $this->collModelVersions && !$overrideExisting) { - return; - } - $this->collModelVersions = new PropelObjectCollection(); - $this->collModelVersions->setModel('ModelVersion'); - } - - /** - * Gets an array of ModelVersion objects which contain a foreign key that references this object. - * - * If the $criteria is not null, it is used to always fetch the results from the database. - * Otherwise the results are fetched from the database the first time, then cached. - * Next time the same method is called without $criteria, the cached collection is returned. - * If this Model is new, it will return - * an empty collection or the current collection; the criteria is ignored on a new object. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @return PropelObjectCollection|ModelVersion[] List of ModelVersion objects - * @throws PropelException - */ - public function getModelVersions($criteria = null, PropelPDO $con = null) - { - $partial = $this->collModelVersionsPartial && !$this->isNew(); - if (null === $this->collModelVersions || null !== $criteria || $partial) { - if ($this->isNew() && null === $this->collModelVersions) { - // return empty collection - $this->initModelVersions(); - } else { - $collModelVersions = ModelVersionQuery::create(null, $criteria) - ->filterByModel($this) - ->find($con); - if (null !== $criteria) { - if (false !== $this->collModelVersionsPartial && count($collModelVersions)) { - $this->initModelVersions(false); - - foreach ($collModelVersions as $obj) { - if (false == $this->collModelVersions->contains($obj)) { - $this->collModelVersions->append($obj); - } - } - - $this->collModelVersionsPartial = true; - } - - $collModelVersions->getInternalIterator()->rewind(); - - return $collModelVersions; - } - - if ($partial && $this->collModelVersions) { - foreach ($this->collModelVersions as $obj) { - if ($obj->isNew()) { - $collModelVersions[] = $obj; - } - } - } - - $this->collModelVersions = $collModelVersions; - $this->collModelVersionsPartial = false; - } - } - - return $this->collModelVersions; - } - - /** - * Sets a collection of ModelVersion objects related by a one-to-many relationship - * to the current object. - * It will also schedule objects for deletion based on a diff between old objects (aka persisted) - * and new objects from the given Propel collection. - * - * @param PropelCollection $modelVersions A Propel collection. - * @param PropelPDO $con Optional connection object - * @return Model The current object (for fluent API support) - */ - public function setModelVersions(PropelCollection $modelVersions, PropelPDO $con = null) - { - $modelVersionsToDelete = $this->getModelVersions(new Criteria(), $con)->diff($modelVersions); - - - //since at least one column in the foreign key is at the same time a PK - //we can not just set a PK to NULL in the lines below. We have to store - //a backup of all values, so we are able to manipulate these items based on the onDelete value later. - $this->modelVersionsScheduledForDeletion = clone $modelVersionsToDelete; - - foreach ($modelVersionsToDelete as $modelVersionRemoved) { - $modelVersionRemoved->setModel(null); - } - - $this->collModelVersions = null; - foreach ($modelVersions as $modelVersion) { - $this->addModelVersion($modelVersion); - } - - $this->collModelVersions = $modelVersions; - $this->collModelVersionsPartial = false; - - return $this; - } - - /** - * Returns the number of related ModelVersion objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related ModelVersion objects. - * @throws PropelException - */ - public function countModelVersions(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - $partial = $this->collModelVersionsPartial && !$this->isNew(); - if (null === $this->collModelVersions || null !== $criteria || $partial) { - if ($this->isNew() && null === $this->collModelVersions) { - return 0; - } - - if ($partial && !$criteria) { - return count($this->getModelVersions()); - } - $query = ModelVersionQuery::create(null, $criteria); - if ($distinct) { - $query->distinct(); - } - - return $query - ->filterByModel($this) - ->count($con); - } - - return count($this->collModelVersions); - } - - /** - * Method called to associate a BaseModelVersion object to this object - * through the BaseModelVersion foreign key attribute. - * - * @param BaseModelVersion $l BaseModelVersion - * @return Model The current object (for fluent API support) - */ - public function addModelVersion(BaseModelVersion $l) - { - if ($this->collModelVersions === null) { - $this->initModelVersions(); - $this->collModelVersionsPartial = true; - } - - if (!in_array($l, $this->collModelVersions->getArrayCopy(), true)) { // only add it if the **same** object is not already associated - $this->doAddModelVersion($l); - - if ($this->modelVersionsScheduledForDeletion and $this->modelVersionsScheduledForDeletion->contains($l)) { - $this->modelVersionsScheduledForDeletion->remove($this->modelVersionsScheduledForDeletion->search($l)); - } - } - - return $this; - } - - /** - * @param ModelVersion $modelVersion The modelVersion object to add. - */ - protected function doAddModelVersion($modelVersion) - { - $this->collModelVersions[]= $modelVersion; - $modelVersion->setModel($this); - } - - /** - * @param ModelVersion $modelVersion The modelVersion object to remove. - * @return Model The current object (for fluent API support) - */ - public function removeModelVersion($modelVersion) - { - if ($this->getModelVersions()->contains($modelVersion)) { - $this->collModelVersions->remove($this->collModelVersions->search($modelVersion)); - if (null === $this->modelVersionsScheduledForDeletion) { - $this->modelVersionsScheduledForDeletion = clone $this->collModelVersions; - $this->modelVersionsScheduledForDeletion->clear(); - } - $this->modelVersionsScheduledForDeletion[]= clone $modelVersion; - $modelVersion->setModel(null); - } - - return $this; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->name = null; - $this->template = null; - $this->class_key = null; - $this->created_at = null; - $this->updated_at = null; - $this->version = null; - $this->version_created_at = null; - $this->version_created_by = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->alreadyInClearAllReferencesDeep = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $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; - if ($this->collNewsletters) { - foreach ($this->collNewsletters as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collBlocks) { - foreach ($this->collBlocks as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collModelVersions) { - foreach ($this->collModelVersions as $o) { - $o->clearAllReferences($deep); - } - } - - $this->alreadyInClearAllReferencesDeep = false; - } // if ($deep) - - if ($this->collNewsletters instanceof PropelCollection) { - $this->collNewsletters->clearIterator(); - } - $this->collNewsletters = null; - if ($this->collBlocks instanceof PropelCollection) { - $this->collBlocks->clearIterator(); - } - $this->collBlocks = null; - if ($this->collModelVersions instanceof PropelCollection) { - $this->collModelVersions->clearIterator(); - } - $this->collModelVersions = null; - } - - /** - * return the string representation of this object - * - * @return string - */ - public function __toString() - { - return (string) $this->exportTo(ModelPeer::DEFAULT_STRING_FORMAT); - } - - /** - * return true is the object is in saving state - * - * @return boolean - */ - public function isAlreadyInSave() - { - return $this->alreadyInSave; - } - - // timestampable behavior - - /** - * Mark the current object so that the update date doesn't get updated during next save - * - * @return Model The current object (for fluent API support) - */ - public function keepUpdateDateUnchanged() - { - $this->modifiedColumns[] = ModelPeer::UPDATED_AT; - - return $this; - } - - // versionable behavior - - /** - * Enforce a new Version of this object upon next save. - * - * @return Model - */ - public function enforceVersioning() - { - $this->enforceVersion = true; - - return $this; - } - - /** - * Checks whether the current state must be recorded as a version - * - * @param PropelPDO $con An optional PropelPDO connection to use. - * - * @return boolean - */ - public function isVersioningNecessary($con = null) - { - if ($this->alreadyInSave) { - return false; - } - - if ($this->enforceVersion) { - return true; - } - - if (ModelPeer::isVersioningEnabled() && ($this->isNew() || $this->isModified() || $this->isDeleted())) { - return true; - } - if ($this->collBlocks) { - // to avoid infinite loops, emulate in save - $this->alreadyInSave = true; - - foreach ($this->getBlocks(null, $con) as $relatedObject) { - if ($relatedObject->isVersioningNecessary($con)) { - $this->alreadyInSave = false; - - return true; - } - } - - $this->alreadyInSave = false; - } - - - return false; - } - - /** - * Creates a version of the current object and saves it. - * - * @param PropelPDO $con the connection to use - * - * @return ModelVersion A version object - */ - public function addVersion($con = null) - { - $this->enforceVersion = false; - - $version = new ModelVersion(); - $version->setId($this->getId()); - $version->setName($this->getName()); - $version->setTemplate($this->getTemplate()); - $version->setClassKey($this->getClassKey()); - $version->setCreatedAt($this->getCreatedAt()); - $version->setUpdatedAt($this->getUpdatedAt()); - $version->setVersion($this->getVersion()); - $version->setVersionCreatedAt($this->getVersionCreatedAt()); - $version->setVersionCreatedBy($this->getVersionCreatedBy()); - $version->setModel($this); - if ($relateds = $this->getBlocks($con)->toKeyValue('Id', 'Version')) { - $version->setNwsBlockIds(array_keys($relateds)); - $version->setNwsBlockVersions(array_values($relateds)); - } - $version->save($con); - - return $version; - } - - /** - * Sets the properties of the current object to the value they had at a specific version - * - * @param integer $versionNumber The version number to read - * @param PropelPDO $con the connection to use - * - * @return Model The current object (for fluent API support) - * @throws PropelException - if no object with the given version can be found. - */ - public function toVersion($versionNumber, $con = null) - { - $version = $this->getOneVersion($versionNumber, $con); - if (!$version) { - throw new PropelException(sprintf('No Model object found with version %d', $versionNumber)); - } - $this->populateFromVersion($version, $con); - - return $this; - } - - /** - * Sets the properties of the curent object to the value they had at a specific version - * - * @param ModelVersion $version The version object to use - * @param PropelPDO $con the connection to use - * @param array $loadedObjects objects thats been loaded in a chain of populateFromVersion calls on referrer or fk objects. - * - * @return Model The current object (for fluent API support) - */ - public function populateFromVersion($version, $con = null, &$loadedObjects = array()) - { - - $loadedObjects['Model'][$version->getId()][$version->getVersion()] = $this; - $this->setId($version->getId()); - $this->setName($version->getName()); - $this->setTemplate($version->getTemplate()); - $this->setClassKey($version->getClassKey()); - $this->setCreatedAt($version->getCreatedAt()); - $this->setUpdatedAt($version->getUpdatedAt()); - $this->setVersion($version->getVersion()); - $this->setVersionCreatedAt($version->getVersionCreatedAt()); - $this->setVersionCreatedBy($version->getVersionCreatedBy()); - if ($fkValues = $version->getNwsBlockIds()) { - $this->clearBlocks(); - $fkVersions = $version->getNwsBlockVersions(); - $query = BlockVersionQuery::create(); - foreach ($fkValues as $key => $value) { - $c1 = $query->getNewCriterion(BlockVersionPeer::ID, $value); - $c2 = $query->getNewCriterion(BlockVersionPeer::VERSION, $fkVersions[$key]); - $c1->addAnd($c2); - $query->addOr($c1); - } - foreach ($query->find($con) as $relatedVersion) { - if (isset($loadedObjects['Block']) && isset($loadedObjects['Block'][$relatedVersion->getId()]) && isset($loadedObjects['Block'][$relatedVersion->getId()][$relatedVersion->getVersion()])) { - $related = $loadedObjects['Block'][$relatedVersion->getId()][$relatedVersion->getVersion()]; - } else { - $related = new Block(); - $related->populateFromVersion($relatedVersion, $con, $loadedObjects); - $related->setNew(false); - } - $this->addBlock($related); - } - - $this->resetPartialBlocks(false); - } - - return $this; - } - - /** - * Gets the latest persisted version number for the current object - * - * @param PropelPDO $con the connection to use - * - * @return integer - */ - public function getLastVersionNumber($con = null) - { - $v = ModelVersionQuery::create() - ->filterByModel($this) - ->orderByVersion('desc') - ->findOne($con); - if (!$v) { - return 0; - } - - return $v->getVersion(); - } - - /** - * Checks whether the current object is the latest one - * - * @param PropelPDO $con the connection to use - * - * @return boolean - */ - public function isLastVersion($con = null) - { - return $this->getLastVersionNumber($con) == $this->getVersion(); - } - - /** - * Retrieves a version object for this entity and a version number - * - * @param integer $versionNumber The version number to read - * @param PropelPDO $con the connection to use - * - * @return ModelVersion A version object - */ - public function getOneVersion($versionNumber, $con = null) - { - return ModelVersionQuery::create() - ->filterByModel($this) - ->filterByVersion($versionNumber) - ->findOne($con); - } - - /** - * Gets all the versions of this object, in incremental order - * - * @param PropelPDO $con the connection to use - * - * @return PropelObjectCollection A list of ModelVersion objects - */ - public function getAllVersions($con = null) - { - $criteria = new Criteria(); - $criteria->addAscendingOrderByColumn(ModelVersionPeer::VERSION); - - return $this->getModelVersions($criteria, $con); - } - - /** - * Compares the current object with another of its version. - * - * print_r($book->compareVersion(1)); - * => array( - * '1' => array('Title' => 'Book title at version 1'), - * '2' => array('Title' => 'Book title at version 2') - * ); - * - * - * @param integer $versionNumber - * @param string $keys Main key used for the result diff (versions|columns) - * @param PropelPDO $con the connection to use - * @param array $ignoredColumns The columns to exclude from the diff. - * - * @return array A list of differences - */ - public function compareVersion($versionNumber, $keys = 'columns', $con = null, $ignoredColumns = array()) - { - $fromVersion = $this->toArray(); - $toVersion = $this->getOneVersion($versionNumber, $con)->toArray(); - - return $this->computeDiff($fromVersion, $toVersion, $keys, $ignoredColumns); - } - - /** - * Compares two versions of the current object. - * - * print_r($book->compareVersions(1, 2)); - * => array( - * '1' => array('Title' => 'Book title at version 1'), - * '2' => array('Title' => 'Book title at version 2') - * ); - * - * - * @param integer $fromVersionNumber - * @param integer $toVersionNumber - * @param string $keys Main key used for the result diff (versions|columns) - * @param PropelPDO $con the connection to use - * @param array $ignoredColumns The columns to exclude from the diff. - * - * @return array A list of differences - */ - public function compareVersions($fromVersionNumber, $toVersionNumber, $keys = 'columns', $con = null, $ignoredColumns = array()) - { - $fromVersion = $this->getOneVersion($fromVersionNumber, $con)->toArray(); - $toVersion = $this->getOneVersion($toVersionNumber, $con)->toArray(); - - return $this->computeDiff($fromVersion, $toVersion, $keys, $ignoredColumns); - } - - /** - * Computes the diff between two versions. - * - * print_r($this->computeDiff(1, 2)); - * => array( - * '1' => array('Title' => 'Book title at version 1'), - * '2' => array('Title' => 'Book title at version 2') - * ); - * - * - * @param array $fromVersion An array representing the original version. - * @param array $toVersion An array representing the destination version. - * @param string $keys Main key used for the result diff (versions|columns). - * @param array $ignoredColumns The columns to exclude from the diff. - * - * @return array A list of differences - */ - protected function computeDiff($fromVersion, $toVersion, $keys = 'columns', $ignoredColumns = array()) - { - $fromVersionNumber = $fromVersion['Version']; - $toVersionNumber = $toVersion['Version']; - $ignoredColumns = array_merge(array( - 'Version', - 'VersionCreatedAt', - 'VersionCreatedBy', - ), $ignoredColumns); - $diff = array(); - foreach ($fromVersion as $key => $value) { - if (in_array($key, $ignoredColumns)) { - continue; - } - if ($toVersion[$key] != $value) { - switch ($keys) { - case 'versions': - $diff[$fromVersionNumber][$key] = $value; - $diff[$toVersionNumber][$key] = $toVersion[$key]; - break; - default: - $diff[$key] = array( - $fromVersionNumber => $value, - $toVersionNumber => $toVersion[$key], - ); - break; - } - } - } - - return $diff; - } - /** - * retrieve the last $number versions. - * - * @param integer $number the number of record to return. - * @param ModelVersionQuery|Criteria $criteria Additional criteria to filter. - * @param PropelPDO $con An optional connection to use. - * - * @return PropelCollection|ModelVersion[] List of ModelVersion objects - */ - public function getLastVersions($number = 10, $criteria = null, PropelPDO $con = null) - { - $criteria = ModelVersionQuery::create(null, $criteria); - $criteria->addDescendingOrderByColumn(ModelVersionPeer::VERSION); - $criteria->limit($number); - - return $this->getModelVersions($criteria, $con); - } - // event behavior - public function preCommit(\PropelPDO $con = null){} - public function preCommitSave(\PropelPDO $con = null){} - public function preCommitDelete(\PropelPDO $con = null){} - public function preCommitUpdate(\PropelPDO $con = null){} - public function preCommitInsert(\PropelPDO $con = null){} - public function preRollback(\PropelPDO $con = null){} - public function preRollbackSave(\PropelPDO $con = null){} - public function preRollbackDelete(\PropelPDO $con = null){} - public function preRollbackUpdate(\PropelPDO $con = null){} - public function preRollbackInsert(\PropelPDO $con = null){} - -} diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModelPeer.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModelPeer.php deleted file mode 100644 index 7ed9e66..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModelPeer.php +++ /dev/null @@ -1,915 +0,0 @@ - array ('Id', 'Name', 'Template', 'ClassKey', 'CreatedAt', 'UpdatedAt', 'Version', 'VersionCreatedAt', 'VersionCreatedBy', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'name', 'template', 'classKey', 'createdAt', 'updatedAt', 'version', 'versionCreatedAt', 'versionCreatedBy', ), - BasePeer::TYPE_COLNAME => array (ModelPeer::ID, ModelPeer::NAME, ModelPeer::TEMPLATE, ModelPeer::CLASS_KEY, ModelPeer::CREATED_AT, ModelPeer::UPDATED_AT, ModelPeer::VERSION, ModelPeer::VERSION_CREATED_AT, ModelPeer::VERSION_CREATED_BY, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'TEMPLATE', 'CLASS_KEY', 'CREATED_AT', 'UPDATED_AT', 'VERSION', 'VERSION_CREATED_AT', 'VERSION_CREATED_BY', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'template', 'class_key', 'created_at', 'updated_at', 'version', 'version_created_at', 'version_created_by', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, ) - ); - - /** - * holds an array of keys for quick access to the fieldnames array - * - * first dimension keys are the type constants - * e.g. ModelPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 - */ - protected static $fieldKeys = array ( - BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Name' => 1, 'Template' => 2, 'ClassKey' => 3, 'CreatedAt' => 4, 'UpdatedAt' => 5, 'Version' => 6, 'VersionCreatedAt' => 7, 'VersionCreatedBy' => 8, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'name' => 1, 'template' => 2, 'classKey' => 3, 'createdAt' => 4, 'updatedAt' => 5, 'version' => 6, 'versionCreatedAt' => 7, 'versionCreatedBy' => 8, ), - BasePeer::TYPE_COLNAME => array (ModelPeer::ID => 0, ModelPeer::NAME => 1, ModelPeer::TEMPLATE => 2, ModelPeer::CLASS_KEY => 3, ModelPeer::CREATED_AT => 4, ModelPeer::UPDATED_AT => 5, ModelPeer::VERSION => 6, ModelPeer::VERSION_CREATED_AT => 7, ModelPeer::VERSION_CREATED_BY => 8, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'TEMPLATE' => 2, 'CLASS_KEY' => 3, 'CREATED_AT' => 4, 'UPDATED_AT' => 5, 'VERSION' => 6, 'VERSION_CREATED_AT' => 7, 'VERSION_CREATED_BY' => 8, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'template' => 2, 'class_key' => 3, 'created_at' => 4, 'updated_at' => 5, 'version' => 6, 'version_created_at' => 7, 'version_created_by' => 8, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, ) - ); - - /** - * 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 = ModelPeer::getFieldNames($toType); - $key = isset(ModelPeer::$fieldKeys[$fromType][$name]) ? ModelPeer::$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(ModelPeer::$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, ModelPeer::$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 ModelPeer::$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. ModelPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(ModelPeer::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(ModelPeer::ID); - $criteria->addSelectColumn(ModelPeer::NAME); - $criteria->addSelectColumn(ModelPeer::TEMPLATE); - $criteria->addSelectColumn(ModelPeer::CLASS_KEY); - $criteria->addSelectColumn(ModelPeer::CREATED_AT); - $criteria->addSelectColumn(ModelPeer::UPDATED_AT); - $criteria->addSelectColumn(ModelPeer::VERSION); - $criteria->addSelectColumn(ModelPeer::VERSION_CREATED_AT); - $criteria->addSelectColumn(ModelPeer::VERSION_CREATED_BY); - } else { - $criteria->addSelectColumn($alias . '.id'); - $criteria->addSelectColumn($alias . '.name'); - $criteria->addSelectColumn($alias . '.template'); - $criteria->addSelectColumn($alias . '.class_key'); - $criteria->addSelectColumn($alias . '.created_at'); - $criteria->addSelectColumn($alias . '.updated_at'); - $criteria->addSelectColumn($alias . '.version'); - $criteria->addSelectColumn($alias . '.version_created_at'); - $criteria->addSelectColumn($alias . '.version_created_by'); - } - } - - /** - * 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(ModelPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - ModelPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count - $criteria->setDbName(ModelPeer::DATABASE_NAME); // Set the correct dbName - - if ($con === null) { - $con = Propel::getConnection(ModelPeer::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 Model - * @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 = ModelPeer::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 ModelPeer::populateObjects(ModelPeer::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(ModelPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - ModelPeer::addSelectColumns($criteria); - } - - // Set the correct dbName - $criteria->setDbName(ModelPeer::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 Model $obj A Model 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 - ModelPeer::$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 Model 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 Model) { - $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 Model object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value,true))); - throw $e; - } - - unset(ModelPeer::$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 Model 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(ModelPeer::$instances[$key])) { - return ModelPeer::$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 (ModelPeer::$instances as $instance) { - $instance->clearAllReferences(true); - } - } - ModelPeer::$instances = array(); - } - - /** - * Method to invalidate the instance pool of all tables related to nws_model - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - // Invalidate objects in BlockPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - BlockPeer::clearInstancePool(); - // Invalidate objects in ModelVersionPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - ModelVersionPeer::clearInstancePool(); - } - - /** - * 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 = ModelPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = ModelPeer::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 = ModelPeer::getOMClass($row, 0); - $cls = substr('.'.$cls, strrpos('.'.$cls, '.') + 1); - $obj = new $cls(); - $obj->hydrate($row); - $results[] = $obj; - ModelPeer::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 (Model object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = ModelPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = ModelPeer::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 + ModelPeer::NUM_HYDRATE_COLUMNS; - } else { - $cls = ModelPeer::getOMClass($row, $startcol); - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - ModelPeer::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(ModelPeer::DATABASE_NAME)->getTable(ModelPeer::TABLE_NAME); - } - - /** - * Add a TableMap instance to the database for this peer class. - */ - public static function buildTableMap() - { - $dbMap = Propel::getDatabaseMap(BaseModelPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseModelPeer::TABLE_NAME)) { - $dbMap->addTableObject(new \Trinity\Bundle\NewsletterBundle\Model\map\ModelTableMap()); - } - } - - /** - * 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 = $row[$colnum + 3]; - $omClass = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1); - - } catch (Exception $e) { - throw new PropelException('Unable to get OM class.', $e); - } - - - $event = new DetectOMClassEvent($omClass); - EventDispatcherProxy::trigger('om.detect', $event); - if($event->isDetected()){ - return $event->getDetectedClass(); - } - - return $omClass; - } - - /** - * Performs an INSERT on the database, given a Model or Criteria object. - * - * @param mixed $values Criteria or Model 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(ModelPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from Model object - } - - if ($criteria->containsKey(ModelPeer::ID) && $criteria->keyContainsValue(ModelPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.ModelPeer::ID.')'); - } - - - // Set the correct dbName - $criteria->setDbName(ModelPeer::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 Model or Criteria object. - * - * @param mixed $values Criteria or Model 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(ModelPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(ModelPeer::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(ModelPeer::ID); - $value = $criteria->remove(ModelPeer::ID); - if ($value) { - $selectCriteria->add(ModelPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(ModelPeer::TABLE_NAME); - } - - } else { // $values is Model object - $criteria = $values->buildCriteria(); // gets full criteria - $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s) - } - - // set the correct dbName - $criteria->setDbName(ModelPeer::DATABASE_NAME); - - return BasePeer::doUpdate($selectCriteria, $criteria, $con); - } - - /** - * Deletes all rows from the nws_model 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(ModelPeer::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 += ModelPeer::doOnDeleteCascade(new Criteria(ModelPeer::DATABASE_NAME), $con); - $affectedRows += BasePeer::doDeleteAll(ModelPeer::TABLE_NAME, $con, ModelPeer::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). - ModelPeer::clearInstancePool(); - ModelPeer::clearRelatedInstancePool(); - $con->commit(); - - return $affectedRows; - } catch (Exception $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs a DELETE on the database, given a Model or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or Model 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(ModelPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof Model) { // it's a model object - // create criteria based on pk values - $criteria = $values->buildPkeyCriteria(); - } else { // it's a primary key, or an array of pks - $criteria = new Criteria(ModelPeer::DATABASE_NAME); - $criteria->add(ModelPeer::ID, (array) $values, Criteria::IN); - } - - // Set the correct dbName - $criteria->setDbName(ModelPeer::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(); - - // cloning the Criteria in case it's modified by doSelect() or doSelectStmt() - $c = clone $criteria; - $affectedRows += ModelPeer::doOnDeleteCascade($c, $con); - - // 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). - if ($values instanceof Criteria) { - ModelPeer::clearInstancePool(); - } elseif ($values instanceof Model) { // it's a model object - ModelPeer::removeInstanceFromPool($values); - } else { // it's a primary key, or an array of pks - foreach ((array) $values as $singleval) { - ModelPeer::removeInstanceFromPool($singleval); - } - } - - $affectedRows += BasePeer::doDelete($criteria, $con); - ModelPeer::clearRelatedInstancePool(); - $con->commit(); - - return $affectedRows; - } catch (Exception $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * This is a method for emulating ON DELETE CASCADE for DBs that don't support this - * feature (like MySQL or SQLite). - * - * This method is not very speedy because it must perform a query first to get - * the implicated records and then perform the deletes by calling those Peer classes. - * - * This method should be used within a transaction if possible. - * - * @param Criteria $criteria - * @param PropelPDO $con - * @return int The number of affected rows (if supported by underlying database driver). - */ - protected static function doOnDeleteCascade(Criteria $criteria, PropelPDO $con) - { - // initialize var to track total num of affected rows - $affectedRows = 0; - - // first find the objects that are implicated by the $criteria - $objects = ModelPeer::doSelect($criteria, $con); - foreach ($objects as $obj) { - - - // delete related Block objects - $criteria = new Criteria(BlockPeer::DATABASE_NAME); - - $criteria->add(BlockPeer::MODEL_ID, $obj->getId()); - $affectedRows += BlockPeer::doDelete($criteria, $con); - - // delete related ModelVersion objects - $criteria = new Criteria(ModelVersionPeer::DATABASE_NAME); - - $criteria->add(ModelVersionPeer::ID, $obj->getId()); - $affectedRows += ModelVersionPeer::doDelete($criteria, $con); - } - - return $affectedRows; - } - - /** - * Validates all modified columns of given Model 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 Model $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(ModelPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(ModelPeer::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(ModelPeer::DATABASE_NAME, ModelPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return Model - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = ModelPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(ModelPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(ModelPeer::DATABASE_NAME); - $criteria->add(ModelPeer::ID, $pk); - - $v = ModelPeer::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 Model[] - * @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(ModelPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(ModelPeer::DATABASE_NAME); - $criteria->add(ModelPeer::ID, $pks, Criteria::IN); - $objs = ModelPeer::doSelect($criteria, $con); - } - - return $objs; - } - - // versionable behavior - - /** - * Checks whether versioning is enabled - * - * @return boolean - */ - public static function isVersioningEnabled() - { - return self::$isVersioningEnabled; - } - - /** - * Enables versioning - */ - public static function enableVersioning() - { - self::$isVersioningEnabled = true; - } - - /** - * Disables versioning - */ - public static function disableVersioning() - { - self::$isVersioningEnabled = false; - } - -} // BaseModelPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseModelPeer::buildTableMap(); - -EventDispatcherProxy::trigger(array('construct','peer.construct'), new PeerEvent('Trinity\Bundle\NewsletterBundle\Model\om\BaseModelPeer')); diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModelQuery.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModelQuery.php deleted file mode 100644 index 9f746b2..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModelQuery.php +++ /dev/null @@ -1,988 +0,0 @@ -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 Model|Model[]|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ($key === null) { - return null; - } - if ((null !== ($obj = ModelPeer::getInstanceFromPool((string) $key))) && !$this->formatter) { - // the object is already in the instance pool - return $obj; - } - if ($con === null) { - $con = Propel::getConnection(ModelPeer::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 Model 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 Model A model object, or null if the key is not found - * @throws PropelException - */ - protected function findPkSimple($key, $con) - { - $sql = 'SELECT `id`, `name`, `template`, `class_key`, `created_at`, `updated_at`, `version`, `version_created_at`, `version_created_by` FROM `nws_model` 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 = ModelPeer::getOMClass($row, 0); - $obj = new $cls(); - $obj->hydrate($row); - ModelPeer::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 Model|Model[]|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|Model[]|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 ModelQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - - return $this->addUsingAlias(ModelPeer::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 ModelQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - - return $this->addUsingAlias(ModelPeer::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 ModelQuery 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(ModelPeer::ID, $id['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($id['max'])) { - $this->addUsingAlias(ModelPeer::ID, $id['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(ModelPeer::ID, $id, $comparison); - } - - /** - * Filter the query on the name column - * - * Example usage: - * - * $query->filterByName('fooValue'); // WHERE name = 'fooValue' - * $query->filterByName('%fooValue%'); // WHERE name LIKE '%fooValue%' - * - * - * @param string $name 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 ModelQuery The current query, for fluid interface - */ - public function filterByName($name = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($name)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $name)) { - $name = str_replace('*', '%', $name); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(ModelPeer::NAME, $name, $comparison); - } - - /** - * Filter the query on the template column - * - * Example usage: - * - * $query->filterByTemplate('fooValue'); // WHERE template = 'fooValue' - * $query->filterByTemplate('%fooValue%'); // WHERE template LIKE '%fooValue%' - * - * - * @param string $template 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 ModelQuery The current query, for fluid interface - */ - public function filterByTemplate($template = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($template)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $template)) { - $template = str_replace('*', '%', $template); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(ModelPeer::TEMPLATE, $template, $comparison); - } - - /** - * Filter the query on the class_key column - * - * Example usage: - * - * $query->filterByClassKey('fooValue'); // WHERE class_key = 'fooValue' - * $query->filterByClassKey('%fooValue%'); // WHERE class_key LIKE '%fooValue%' - * - * - * @param string $classKey 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 ModelQuery The current query, for fluid interface - */ - public function filterByClassKey($classKey = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($classKey)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $classKey)) { - $classKey = str_replace('*', '%', $classKey); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(ModelPeer::CLASS_KEY, $classKey, $comparison); - } - - /** - * Filter the query on the created_at column - * - * Example usage: - * - * $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14' - * $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14' - * $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at < '2011-03-13' - * - * - * @param mixed $createdAt The value to use as filter. - * Values can be integers (unix timestamps), DateTime objects, or strings. - * Empty strings are treated as NULL. - * 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 ModelQuery The current query, for fluid interface - */ - public function filterByCreatedAt($createdAt = null, $comparison = null) - { - if (is_array($createdAt)) { - $useMinMax = false; - if (isset($createdAt['min'])) { - $this->addUsingAlias(ModelPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($createdAt['max'])) { - $this->addUsingAlias(ModelPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(ModelPeer::CREATED_AT, $createdAt, $comparison); - } - - /** - * Filter the query on the updated_at column - * - * Example usage: - * - * $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14' - * $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14' - * $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at < '2011-03-13' - * - * - * @param mixed $updatedAt The value to use as filter. - * Values can be integers (unix timestamps), DateTime objects, or strings. - * Empty strings are treated as NULL. - * 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 ModelQuery The current query, for fluid interface - */ - public function filterByUpdatedAt($updatedAt = null, $comparison = null) - { - if (is_array($updatedAt)) { - $useMinMax = false; - if (isset($updatedAt['min'])) { - $this->addUsingAlias(ModelPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($updatedAt['max'])) { - $this->addUsingAlias(ModelPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(ModelPeer::UPDATED_AT, $updatedAt, $comparison); - } - - /** - * Filter the query on the version column - * - * Example usage: - * - * $query->filterByVersion(1234); // WHERE version = 1234 - * $query->filterByVersion(array(12, 34)); // WHERE version IN (12, 34) - * $query->filterByVersion(array('min' => 12)); // WHERE version >= 12 - * $query->filterByVersion(array('max' => 12)); // WHERE version <= 12 - * - * - * @param mixed $version 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 ModelQuery The current query, for fluid interface - */ - public function filterByVersion($version = null, $comparison = null) - { - if (is_array($version)) { - $useMinMax = false; - if (isset($version['min'])) { - $this->addUsingAlias(ModelPeer::VERSION, $version['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($version['max'])) { - $this->addUsingAlias(ModelPeer::VERSION, $version['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(ModelPeer::VERSION, $version, $comparison); - } - - /** - * Filter the query on the version_created_at column - * - * Example usage: - * - * $query->filterByVersionCreatedAt('2011-03-14'); // WHERE version_created_at = '2011-03-14' - * $query->filterByVersionCreatedAt('now'); // WHERE version_created_at = '2011-03-14' - * $query->filterByVersionCreatedAt(array('max' => 'yesterday')); // WHERE version_created_at < '2011-03-13' - * - * - * @param mixed $versionCreatedAt The value to use as filter. - * Values can be integers (unix timestamps), DateTime objects, or strings. - * Empty strings are treated as NULL. - * 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 ModelQuery The current query, for fluid interface - */ - public function filterByVersionCreatedAt($versionCreatedAt = null, $comparison = null) - { - if (is_array($versionCreatedAt)) { - $useMinMax = false; - if (isset($versionCreatedAt['min'])) { - $this->addUsingAlias(ModelPeer::VERSION_CREATED_AT, $versionCreatedAt['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($versionCreatedAt['max'])) { - $this->addUsingAlias(ModelPeer::VERSION_CREATED_AT, $versionCreatedAt['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(ModelPeer::VERSION_CREATED_AT, $versionCreatedAt, $comparison); - } - - /** - * Filter the query on the version_created_by column - * - * Example usage: - * - * $query->filterByVersionCreatedBy('fooValue'); // WHERE version_created_by = 'fooValue' - * $query->filterByVersionCreatedBy('%fooValue%'); // WHERE version_created_by LIKE '%fooValue%' - * - * - * @param string $versionCreatedBy 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 ModelQuery The current query, for fluid interface - */ - public function filterByVersionCreatedBy($versionCreatedBy = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($versionCreatedBy)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $versionCreatedBy)) { - $versionCreatedBy = str_replace('*', '%', $versionCreatedBy); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(ModelPeer::VERSION_CREATED_BY, $versionCreatedBy, $comparison); - } - - /** - * Filter the query by a related Newsletter object - * - * @param Newsletter|PropelObjectCollection $newsletter the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ModelQuery The current query, for fluid interface - * @throws PropelException - if the provided filter is invalid. - */ - public function filterByNewsletter($newsletter, $comparison = null) - { - if ($newsletter instanceof Newsletter) { - return $this - ->addUsingAlias(ModelPeer::ID, $newsletter->getModelId(), $comparison); - } elseif ($newsletter instanceof PropelObjectCollection) { - return $this - ->useNewsletterQuery() - ->filterByPrimaryKeys($newsletter->getPrimaryKeys()) - ->endUse(); - } else { - throw new PropelException('filterByNewsletter() only accepts arguments of type Newsletter or PropelCollection'); - } - } - - /** - * Adds a JOIN clause to the query using the Newsletter relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return ModelQuery The current query, for fluid interface - */ - public function joinNewsletter($relationAlias = null, $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('Newsletter'); - - // create a ModelJoin object for this join - $join = new ModelJoin(); - $join->setJoinType($joinType); - $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); - if ($previousJoin = $this->getPreviousJoin()) { - $join->setPreviousJoin($previousJoin); - } - - // add the ModelJoin to the current object - if ($relationAlias) { - $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); - $this->addJoinObject($join, $relationAlias); - } else { - $this->addJoinObject($join, 'Newsletter'); - } - - return $this; - } - - /** - * Use the Newsletter relation Newsletter object - * - * @see useQuery() - * - * @param string $relationAlias optional alias for the relation, - * to be used as main alias in the secondary query - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return \Trinity\Bundle\NewsletterBundle\Model\NewsletterQuery A secondary query class using the current class as primary query - */ - public function useNewsletterQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinNewsletter($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'Newsletter', '\Trinity\Bundle\NewsletterBundle\Model\NewsletterQuery'); - } - - /** - * Filter the query by a related Block object - * - * @param Block|PropelObjectCollection $block the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ModelQuery The current query, for fluid interface - * @throws PropelException - if the provided filter is invalid. - */ - public function filterByBlock($block, $comparison = null) - { - if ($block instanceof Block) { - return $this - ->addUsingAlias(ModelPeer::ID, $block->getModelId(), $comparison); - } elseif ($block instanceof PropelObjectCollection) { - return $this - ->useBlockQuery() - ->filterByPrimaryKeys($block->getPrimaryKeys()) - ->endUse(); - } else { - throw new PropelException('filterByBlock() only accepts arguments of type Block or PropelCollection'); - } - } - - /** - * Adds a JOIN clause to the query using the Block relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return ModelQuery The current query, for fluid interface - */ - public function joinBlock($relationAlias = null, $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('Block'); - - // create a ModelJoin object for this join - $join = new ModelJoin(); - $join->setJoinType($joinType); - $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); - if ($previousJoin = $this->getPreviousJoin()) { - $join->setPreviousJoin($previousJoin); - } - - // add the ModelJoin to the current object - if ($relationAlias) { - $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); - $this->addJoinObject($join, $relationAlias); - } else { - $this->addJoinObject($join, 'Block'); - } - - return $this; - } - - /** - * Use the Block relation Block object - * - * @see useQuery() - * - * @param string $relationAlias optional alias for the relation, - * to be used as main alias in the secondary query - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return \Trinity\Bundle\NewsletterBundle\Model\BlockQuery A secondary query class using the current class as primary query - */ - public function useBlockQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinBlock($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'Block', '\Trinity\Bundle\NewsletterBundle\Model\BlockQuery'); - } - - /** - * Filter the query by a related ModelVersion object - * - * @param ModelVersion|PropelObjectCollection $modelVersion the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ModelQuery The current query, for fluid interface - * @throws PropelException - if the provided filter is invalid. - */ - public function filterByModelVersion($modelVersion, $comparison = null) - { - if ($modelVersion instanceof ModelVersion) { - return $this - ->addUsingAlias(ModelPeer::ID, $modelVersion->getId(), $comparison); - } elseif ($modelVersion instanceof PropelObjectCollection) { - return $this - ->useModelVersionQuery() - ->filterByPrimaryKeys($modelVersion->getPrimaryKeys()) - ->endUse(); - } else { - throw new PropelException('filterByModelVersion() only accepts arguments of type ModelVersion or PropelCollection'); - } - } - - /** - * Adds a JOIN clause to the query using the ModelVersion relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return ModelQuery The current query, for fluid interface - */ - public function joinModelVersion($relationAlias = null, $joinType = Criteria::INNER_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('ModelVersion'); - - // create a ModelJoin object for this join - $join = new ModelJoin(); - $join->setJoinType($joinType); - $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); - if ($previousJoin = $this->getPreviousJoin()) { - $join->setPreviousJoin($previousJoin); - } - - // add the ModelJoin to the current object - if ($relationAlias) { - $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); - $this->addJoinObject($join, $relationAlias); - } else { - $this->addJoinObject($join, 'ModelVersion'); - } - - return $this; - } - - /** - * Use the ModelVersion relation ModelVersion object - * - * @see useQuery() - * - * @param string $relationAlias optional alias for the relation, - * to be used as main alias in the secondary query - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return \Trinity\Bundle\NewsletterBundle\Model\ModelVersionQuery A secondary query class using the current class as primary query - */ - public function useModelVersionQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) - { - return $this - ->joinModelVersion($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'ModelVersion', '\Trinity\Bundle\NewsletterBundle\Model\ModelVersionQuery'); - } - - /** - * Exclude object from result - * - * @param Model $model Object to remove from the list of results - * - * @return ModelQuery The current query, for fluid interface - */ - public function prune($model = null) - { - if ($model) { - $this->addUsingAlias(ModelPeer::ID, $model->getId(), Criteria::NOT_EQUAL); - } - - return $this; - } - - /** - * Code to execute before every SELECT statement - * - * @param PropelPDO $con The connection object used by the query - */ - protected function basePreSelect(PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger('query.select.pre', new QueryEvent($this)); - - return $this->preSelect($con); - } - - /** - * Code to execute before every DELETE statement - * - * @param PropelPDO $con The connection object used by the query - */ - protected function basePreDelete(PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger(array('delete.pre','query.delete.pre'), new QueryEvent($this)); - - return $this->preDelete($con); - } - - /** - * Code to execute after every DELETE statement - * - * @param int $affectedRows the number of deleted rows - * @param PropelPDO $con The connection object used by the query - */ - protected function basePostDelete($affectedRows, PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger(array('delete.post','query.delete.post'), new QueryEvent($this)); - - return $this->postDelete($affectedRows, $con); - } - - /** - * Code to execute before every UPDATE statement - * - * @param array $values The associative array of columns and values for the update - * @param PropelPDO $con The connection object used by the query - * @param boolean $forceIndividualSaves If false (default), the resulting call is a BasePeer::doUpdate(), otherwise it is a series of save() calls on all the found objects - */ - protected function basePreUpdate(&$values, PropelPDO $con, $forceIndividualSaves = false) - { - // event behavior - EventDispatcherProxy::trigger(array('update.pre', 'query.update.pre'), new QueryEvent($this)); - - return $this->preUpdate($values, $con, $forceIndividualSaves); - } - - /** - * Code to execute after every UPDATE statement - * - * @param int $affectedRows the number of updated rows - * @param PropelPDO $con The connection object used by the query - */ - protected function basePostUpdate($affectedRows, PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger(array('update.post', 'query.update.post'), new QueryEvent($this)); - - return $this->postUpdate($affectedRows, $con); - } - - // timestampable behavior - - /** - * Filter by the latest updated - * - * @param int $nbDays Maximum age of the latest update in days - * - * @return ModelQuery The current query, for fluid interface - */ - public function recentlyUpdated($nbDays = 7) - { - return $this->addUsingAlias(ModelPeer::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL); - } - - /** - * Order by update date desc - * - * @return ModelQuery The current query, for fluid interface - */ - public function lastUpdatedFirst() - { - return $this->addDescendingOrderByColumn(ModelPeer::UPDATED_AT); - } - - /** - * Order by update date asc - * - * @return ModelQuery The current query, for fluid interface - */ - public function firstUpdatedFirst() - { - return $this->addAscendingOrderByColumn(ModelPeer::UPDATED_AT); - } - - /** - * Filter by the latest created - * - * @param int $nbDays Maximum age of in days - * - * @return ModelQuery The current query, for fluid interface - */ - public function recentlyCreated($nbDays = 7) - { - return $this->addUsingAlias(ModelPeer::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL); - } - - /** - * Order by create date desc - * - * @return ModelQuery The current query, for fluid interface - */ - public function lastCreatedFirst() - { - return $this->addDescendingOrderByColumn(ModelPeer::CREATED_AT); - } - - /** - * Order by create date asc - * - * @return ModelQuery The current query, for fluid interface - */ - public function firstCreatedFirst() - { - return $this->addAscendingOrderByColumn(ModelPeer::CREATED_AT); - } - // extend behavior - public function setFormatter($formatter) - { - if (is_string($formatter) && $formatter === \ModelCriteria::FORMAT_ON_DEMAND) { - $formatter = '\Glorpen\Propel\PropelBundle\Formatter\PropelOnDemandFormatter'; - } - - return parent::setFormatter($formatter); - } -} diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModelVersion.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModelVersion.php deleted file mode 100644 index d1f050d..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModelVersion.php +++ /dev/null @@ -1,1722 +0,0 @@ -version = 0; - } - - /** - * Initializes internal state of BaseModelVersion object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - EventDispatcherProxy::trigger(array('construct','model.construct'), new ModelEvent($this)); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getId() - { - - return $this->id; - } - - /** - * Get the [name] column value. - * - * @return string - */ - public function getName() - { - - return $this->name; - } - - /** - * Get the [template] column value. - * - * @return string - */ - public function getTemplate() - { - - return $this->template; - } - - /** - * Get the [class_key] column value. - * - * @return string - */ - public function getClassKey() - { - - return $this->class_key; - } - - /** - * Get the [optionally formatted] temporal [created_at] column value. - * - * - * @param string $format The date/time format string (either date()-style or strftime()-style). - * If format is null, then the raw DateTime object will be returned. - * @return mixed Formatted date/time value as string or DateTime object (if format is null), null if column is null, and 0 if column value is 0000-00-00 00:00:00 - * @throws PropelException - if unable to parse/validate the date/time value. - */ - public function getCreatedAt($format = null) - { - if ($this->created_at === null) { - return null; - } - - if ($this->created_at === '0000-00-00 00:00:00') { - // while technically this is not a default value of null, - // this seems to be closest in meaning. - return null; - } - - try { - $dt = new DateTime($this->created_at); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->created_at, true), $x); - } - - if ($format === null) { - // Because propel.useDateTimeClass is true, we return a DateTime object. - return $dt; - } - - if (strpos($format, '%') !== false) { - return strftime($format, $dt->format('U')); - } - - return $dt->format($format); - - } - - /** - * Get the [optionally formatted] temporal [updated_at] column value. - * - * - * @param string $format The date/time format string (either date()-style or strftime()-style). - * If format is null, then the raw DateTime object will be returned. - * @return mixed Formatted date/time value as string or DateTime object (if format is null), null if column is null, and 0 if column value is 0000-00-00 00:00:00 - * @throws PropelException - if unable to parse/validate the date/time value. - */ - public function getUpdatedAt($format = null) - { - if ($this->updated_at === null) { - return null; - } - - if ($this->updated_at === '0000-00-00 00:00:00') { - // while technically this is not a default value of null, - // this seems to be closest in meaning. - return null; - } - - try { - $dt = new DateTime($this->updated_at); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->updated_at, true), $x); - } - - if ($format === null) { - // Because propel.useDateTimeClass is true, we return a DateTime object. - return $dt; - } - - if (strpos($format, '%') !== false) { - return strftime($format, $dt->format('U')); - } - - return $dt->format($format); - - } - - /** - * Get the [version] column value. - * - * @return int - */ - public function getVersion() - { - - return $this->version; - } - - /** - * Get the [optionally formatted] temporal [version_created_at] column value. - * - * - * @param string $format The date/time format string (either date()-style or strftime()-style). - * If format is null, then the raw DateTime object will be returned. - * @return mixed Formatted date/time value as string or DateTime object (if format is null), null if column is null, and 0 if column value is 0000-00-00 00:00:00 - * @throws PropelException - if unable to parse/validate the date/time value. - */ - public function getVersionCreatedAt($format = null) - { - if ($this->version_created_at === null) { - return null; - } - - if ($this->version_created_at === '0000-00-00 00:00:00') { - // while technically this is not a default value of null, - // this seems to be closest in meaning. - return null; - } - - try { - $dt = new DateTime($this->version_created_at); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->version_created_at, true), $x); - } - - if ($format === null) { - // Because propel.useDateTimeClass is true, we return a DateTime object. - return $dt; - } - - if (strpos($format, '%') !== false) { - return strftime($format, $dt->format('U')); - } - - return $dt->format($format); - - } - - /** - * Get the [version_created_by] column value. - * - * @return string - */ - public function getVersionCreatedBy() - { - - return $this->version_created_by; - } - - /** - * Get the [nws_block_ids] column value. - * - * @return array - */ - public function getNwsBlockIds() - { - if (null === $this->nws_block_ids_unserialized) { - $this->nws_block_ids_unserialized = array(); - } - if (!$this->nws_block_ids_unserialized && null !== $this->nws_block_ids) { - $nws_block_ids_unserialized = substr($this->nws_block_ids, 2, -2); - $this->nws_block_ids_unserialized = $nws_block_ids_unserialized ? explode(' | ', $nws_block_ids_unserialized) : array(); - } - - return $this->nws_block_ids_unserialized; - } - - /** - * Test the presence of a value in the [nws_block_ids] array column value. - * @param mixed $value - * - * @return boolean - */ - public function hasNwsBlockId($value) - { - return in_array($value, $this->getNwsBlockIds()); - } // hasNwsBlockId() - - /** - * Get the [nws_block_versions] column value. - * - * @return array - */ - public function getNwsBlockVersions() - { - if (null === $this->nws_block_versions_unserialized) { - $this->nws_block_versions_unserialized = array(); - } - if (!$this->nws_block_versions_unserialized && null !== $this->nws_block_versions) { - $nws_block_versions_unserialized = substr($this->nws_block_versions, 2, -2); - $this->nws_block_versions_unserialized = $nws_block_versions_unserialized ? explode(' | ', $nws_block_versions_unserialized) : array(); - } - - return $this->nws_block_versions_unserialized; - } - - /** - * Test the presence of a value in the [nws_block_versions] array column value. - * @param mixed $value - * - * @return boolean - */ - public function hasNwsBlockVersion($value) - { - return in_array($value, $this->getNwsBlockVersions()); - } // hasNwsBlockVersion() - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return ModelVersion 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[] = ModelVersionPeer::ID; - } - - if ($this->aModel !== null && $this->aModel->getId() !== $v) { - $this->aModel = null; - } - - - return $this; - } // setId() - - /** - * Set the value of [name] column. - * - * @param string $v new value - * @return ModelVersion The current object (for fluent API support) - */ - public function setName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->name !== $v) { - $this->name = $v; - $this->modifiedColumns[] = ModelVersionPeer::NAME; - } - - - return $this; - } // setName() - - /** - * Set the value of [template] column. - * - * @param string $v new value - * @return ModelVersion The current object (for fluent API support) - */ - public function setTemplate($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->template !== $v) { - $this->template = $v; - $this->modifiedColumns[] = ModelVersionPeer::TEMPLATE; - } - - - return $this; - } // setTemplate() - - /** - * Set the value of [class_key] column. - * - * @param string $v new value - * @return ModelVersion The current object (for fluent API support) - */ - public function setClassKey($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->class_key !== $v) { - $this->class_key = $v; - $this->modifiedColumns[] = ModelVersionPeer::CLASS_KEY; - } - - - return $this; - } // setClassKey() - - /** - * Sets the value of [created_at] column to a normalized version of the date/time value specified. - * - * @param mixed $v string, integer (timestamp), or DateTime value. - * Empty strings are treated as null. - * @return ModelVersion The current object (for fluent API support) - */ - public function setCreatedAt($v) - { - $dt = PropelDateTime::newInstance($v, null, 'DateTime'); - if ($this->created_at !== null || $dt !== null) { - $currentDateAsString = ($this->created_at !== null && $tmpDt = new DateTime($this->created_at)) ? $tmpDt->format('Y-m-d H:i:s') : null; - $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null; - if ($currentDateAsString !== $newDateAsString) { - $this->created_at = $newDateAsString; - $this->modifiedColumns[] = ModelVersionPeer::CREATED_AT; - } - } // if either are not null - - - return $this; - } // setCreatedAt() - - /** - * Sets the value of [updated_at] column to a normalized version of the date/time value specified. - * - * @param mixed $v string, integer (timestamp), or DateTime value. - * Empty strings are treated as null. - * @return ModelVersion The current object (for fluent API support) - */ - public function setUpdatedAt($v) - { - $dt = PropelDateTime::newInstance($v, null, 'DateTime'); - if ($this->updated_at !== null || $dt !== null) { - $currentDateAsString = ($this->updated_at !== null && $tmpDt = new DateTime($this->updated_at)) ? $tmpDt->format('Y-m-d H:i:s') : null; - $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null; - if ($currentDateAsString !== $newDateAsString) { - $this->updated_at = $newDateAsString; - $this->modifiedColumns[] = ModelVersionPeer::UPDATED_AT; - } - } // if either are not null - - - return $this; - } // setUpdatedAt() - - /** - * Set the value of [version] column. - * - * @param int $v new value - * @return ModelVersion The current object (for fluent API support) - */ - public function setVersion($v) - { - if ($v !== null && is_numeric($v)) { - $v = (int) $v; - } - - if ($this->version !== $v) { - $this->version = $v; - $this->modifiedColumns[] = ModelVersionPeer::VERSION; - } - - - return $this; - } // setVersion() - - /** - * Sets the value of [version_created_at] column to a normalized version of the date/time value specified. - * - * @param mixed $v string, integer (timestamp), or DateTime value. - * Empty strings are treated as null. - * @return ModelVersion The current object (for fluent API support) - */ - public function setVersionCreatedAt($v) - { - $dt = PropelDateTime::newInstance($v, null, 'DateTime'); - if ($this->version_created_at !== null || $dt !== null) { - $currentDateAsString = ($this->version_created_at !== null && $tmpDt = new DateTime($this->version_created_at)) ? $tmpDt->format('Y-m-d H:i:s') : null; - $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null; - if ($currentDateAsString !== $newDateAsString) { - $this->version_created_at = $newDateAsString; - $this->modifiedColumns[] = ModelVersionPeer::VERSION_CREATED_AT; - } - } // if either are not null - - - return $this; - } // setVersionCreatedAt() - - /** - * Set the value of [version_created_by] column. - * - * @param string $v new value - * @return ModelVersion The current object (for fluent API support) - */ - public function setVersionCreatedBy($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->version_created_by !== $v) { - $this->version_created_by = $v; - $this->modifiedColumns[] = ModelVersionPeer::VERSION_CREATED_BY; - } - - - return $this; - } // setVersionCreatedBy() - - /** - * Set the value of [nws_block_ids] column. - * - * @param array $v new value - * @return ModelVersion The current object (for fluent API support) - */ - public function setNwsBlockIds($v) - { - if ($this->nws_block_ids_unserialized !== $v) { - $this->nws_block_ids_unserialized = $v; - $this->nws_block_ids = '| ' . implode(' | ', (array) $v) . ' |'; - $this->modifiedColumns[] = ModelVersionPeer::NWS_BLOCK_IDS; - } - - - return $this; - } // setNwsBlockIds() - - /** - * Adds a value to the [nws_block_ids] array column value. - * @param mixed $value - * - * @return ModelVersion The current object (for fluent API support) - */ - public function addNwsBlockId($value) - { - $currentArray = $this->getNwsBlockIds(); - $currentArray []= $value; - $this->setNwsBlockIds($currentArray); - - return $this; - } // addNwsBlockId() - - /** - * Removes a value from the [nws_block_ids] array column value. - * @param mixed $value - * - * @return ModelVersion The current object (for fluent API support) - */ - public function removeNwsBlockId($value) - { - $targetArray = array(); - foreach ($this->getNwsBlockIds() as $element) { - if ($element != $value) { - $targetArray []= $element; - } - } - $this->setNwsBlockIds($targetArray); - - return $this; - } // removeNwsBlockId() - - /** - * Set the value of [nws_block_versions] column. - * - * @param array $v new value - * @return ModelVersion The current object (for fluent API support) - */ - public function setNwsBlockVersions($v) - { - if ($this->nws_block_versions_unserialized !== $v) { - $this->nws_block_versions_unserialized = $v; - $this->nws_block_versions = '| ' . implode(' | ', (array) $v) . ' |'; - $this->modifiedColumns[] = ModelVersionPeer::NWS_BLOCK_VERSIONS; - } - - - return $this; - } // setNwsBlockVersions() - - /** - * Adds a value to the [nws_block_versions] array column value. - * @param mixed $value - * - * @return ModelVersion The current object (for fluent API support) - */ - public function addNwsBlockVersion($value) - { - $currentArray = $this->getNwsBlockVersions(); - $currentArray []= $value; - $this->setNwsBlockVersions($currentArray); - - return $this; - } // addNwsBlockVersion() - - /** - * Removes a value from the [nws_block_versions] array column value. - * @param mixed $value - * - * @return ModelVersion The current object (for fluent API support) - */ - public function removeNwsBlockVersion($value) - { - $targetArray = array(); - foreach ($this->getNwsBlockVersions() as $element) { - if ($element != $value) { - $targetArray []= $element; - } - } - $this->setNwsBlockVersions($targetArray); - - return $this; - } // removeNwsBlockVersion() - - /** - * 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() - { - if ($this->version !== 0) { - return false; - } - - // 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->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->template = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->class_key = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->created_at = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->updated_at = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; - $this->version = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null; - $this->version_created_at = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null; - $this->version_created_by = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; - $this->nws_block_ids = $row[$startcol + 9]; - $this->nws_block_ids_unserialized = null; - $this->nws_block_versions = $row[$startcol + 10]; - $this->nws_block_versions_unserialized = null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - $this->postHydrate($row, $startcol, $rehydrate); - - return $startcol + 11; // 11 = ModelVersionPeer::NUM_HYDRATE_COLUMNS. - - } catch (Exception $e) { - throw new PropelException("Error populating ModelVersion 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() - { - - if ($this->aModel !== null && $this->id !== $this->aModel->getId()) { - $this->aModel = null; - } - } // 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(ModelVersionPeer::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 = ModelVersionPeer::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? - - $this->aModel = null; - } // 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(ModelVersionPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $deleteQuery = ModelVersionQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()); - $ret = $this->preDelete($con); - // event behavior - EventDispatcherProxy::trigger(array('delete.pre','model.delete.pre'), new ModelEvent($this)); - if ($ret) { - $deleteQuery->delete($con); - $this->postDelete($con); - // event behavior - EventDispatcherProxy::trigger(array('delete.post', 'model.delete.post'), new ModelEvent($this)); - $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(ModelVersionPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - // event behavior - EventDispatcherProxy::trigger('model.save.pre', new ModelEvent($this)); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - // event behavior - EventDispatcherProxy::trigger('model.insert.pre', new ModelEvent($this)); - } else { - $ret = $ret && $this->preUpdate($con); - // event behavior - EventDispatcherProxy::trigger(array('update.pre', 'model.update.pre'), new ModelEvent($this)); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - // event behavior - EventDispatcherProxy::trigger('model.insert.post', new ModelEvent($this)); - } else { - $this->postUpdate($con); - // event behavior - EventDispatcherProxy::trigger(array('update.post', 'model.update.post'), new ModelEvent($this)); - } - $this->postSave($con); - // event behavior - EventDispatcherProxy::trigger('model.save.post', new ModelEvent($this)); - ModelVersionPeer::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; - - // We call the save method on the following object(s) if they - // were passed to this object by their corresponding set - // method. This object relates to these object(s) by a - // foreign key reference. - - if ($this->aModel !== null) { - if ($this->aModel->isModified() || $this->aModel->isNew()) { - $affectedRows += $this->aModel->save($con); - } - $this->setModel($this->aModel); - } - - 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; - - - // check the columns in natural order for more readable SQL queries - if ($this->isColumnModified(ModelVersionPeer::ID)) { - $modifiedColumns[':p' . $index++] = '`id`'; - } - if ($this->isColumnModified(ModelVersionPeer::NAME)) { - $modifiedColumns[':p' . $index++] = '`name`'; - } - if ($this->isColumnModified(ModelVersionPeer::TEMPLATE)) { - $modifiedColumns[':p' . $index++] = '`template`'; - } - if ($this->isColumnModified(ModelVersionPeer::CLASS_KEY)) { - $modifiedColumns[':p' . $index++] = '`class_key`'; - } - if ($this->isColumnModified(ModelVersionPeer::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`created_at`'; - } - if ($this->isColumnModified(ModelVersionPeer::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`updated_at`'; - } - if ($this->isColumnModified(ModelVersionPeer::VERSION)) { - $modifiedColumns[':p' . $index++] = '`version`'; - } - if ($this->isColumnModified(ModelVersionPeer::VERSION_CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`version_created_at`'; - } - if ($this->isColumnModified(ModelVersionPeer::VERSION_CREATED_BY)) { - $modifiedColumns[':p' . $index++] = '`version_created_by`'; - } - if ($this->isColumnModified(ModelVersionPeer::NWS_BLOCK_IDS)) { - $modifiedColumns[':p' . $index++] = '`nws_block_ids`'; - } - if ($this->isColumnModified(ModelVersionPeer::NWS_BLOCK_VERSIONS)) { - $modifiedColumns[':p' . $index++] = '`nws_block_versions`'; - } - - $sql = sprintf( - 'INSERT INTO `nws_model_version` (%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 '`name`': - $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR); - break; - case '`template`': - $stmt->bindValue($identifier, $this->template, PDO::PARAM_STR); - break; - case '`class_key`': - $stmt->bindValue($identifier, $this->class_key, PDO::PARAM_STR); - break; - case '`created_at`': - $stmt->bindValue($identifier, $this->created_at, PDO::PARAM_STR); - break; - case '`updated_at`': - $stmt->bindValue($identifier, $this->updated_at, PDO::PARAM_STR); - break; - case '`version`': - $stmt->bindValue($identifier, $this->version, PDO::PARAM_INT); - break; - case '`version_created_at`': - $stmt->bindValue($identifier, $this->version_created_at, PDO::PARAM_STR); - break; - case '`version_created_by`': - $stmt->bindValue($identifier, $this->version_created_by, PDO::PARAM_STR); - break; - case '`nws_block_ids`': - $stmt->bindValue($identifier, $this->nws_block_ids, PDO::PARAM_STR); - break; - case '`nws_block_versions`': - $stmt->bindValue($identifier, $this->nws_block_versions, 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); - } - - $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(); - - - // We call the validate method on the following object(s) if they - // were passed to this object by their corresponding set - // method. This object relates to these object(s) by a - // foreign key reference. - - if ($this->aModel !== null) { - if (!$this->aModel->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aModel->getValidationFailures()); - } - } - - - if (($retval = ModelVersionPeer::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 = ModelVersionPeer::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->getName(); - break; - case 2: - return $this->getTemplate(); - break; - case 3: - return $this->getClassKey(); - break; - case 4: - return $this->getCreatedAt(); - break; - case 5: - return $this->getUpdatedAt(); - break; - case 6: - return $this->getVersion(); - break; - case 7: - return $this->getVersionCreatedAt(); - break; - case 8: - return $this->getVersionCreatedBy(); - break; - case 9: - return $this->getNwsBlockIds(); - break; - case 10: - return $this->getNwsBlockVersions(); - 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 - * @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false) - { - if (isset($alreadyDumpedObjects['ModelVersion'][serialize($this->getPrimaryKey())])) { - return '*RECURSION*'; - } - $alreadyDumpedObjects['ModelVersion'][serialize($this->getPrimaryKey())] = true; - $keys = ModelVersionPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getId(), - $keys[1] => $this->getName(), - $keys[2] => $this->getTemplate(), - $keys[3] => $this->getClassKey(), - $keys[4] => $this->getCreatedAt(), - $keys[5] => $this->getUpdatedAt(), - $keys[6] => $this->getVersion(), - $keys[7] => $this->getVersionCreatedAt(), - $keys[8] => $this->getVersionCreatedBy(), - $keys[9] => $this->getNwsBlockIds(), - $keys[10] => $this->getNwsBlockVersions(), - ); - $virtualColumns = $this->virtualColumns; - foreach ($virtualColumns as $key => $virtualColumn) { - $result[$key] = $virtualColumn; - } - - if ($includeForeignObjects) { - if (null !== $this->aModel) { - $result['Model'] = $this->aModel->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); - } - } - - 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 = ModelVersionPeer::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->setName($value); - break; - case 2: - $this->setTemplate($value); - break; - case 3: - $this->setClassKey($value); - break; - case 4: - $this->setCreatedAt($value); - break; - case 5: - $this->setUpdatedAt($value); - break; - case 6: - $this->setVersion($value); - break; - case 7: - $this->setVersionCreatedAt($value); - break; - case 8: - $this->setVersionCreatedBy($value); - break; - case 9: - if (!is_array($value)) { - $v = trim(substr($value, 2, -2)); - $value = $v ? explode(' | ', $v) : array(); - } - $this->setNwsBlockIds($value); - break; - case 10: - if (!is_array($value)) { - $v = trim(substr($value, 2, -2)); - $value = $v ? explode(' | ', $v) : array(); - } - $this->setNwsBlockVersions($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 = ModelVersionPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setName($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setTemplate($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setClassKey($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setCreatedAt($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setUpdatedAt($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setVersion($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setVersionCreatedAt($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setVersionCreatedBy($arr[$keys[8]]); - if (array_key_exists($keys[9], $arr)) $this->setNwsBlockIds($arr[$keys[9]]); - if (array_key_exists($keys[10], $arr)) $this->setNwsBlockVersions($arr[$keys[10]]); - } - - /** - * 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(ModelVersionPeer::DATABASE_NAME); - - if ($this->isColumnModified(ModelVersionPeer::ID)) $criteria->add(ModelVersionPeer::ID, $this->id); - if ($this->isColumnModified(ModelVersionPeer::NAME)) $criteria->add(ModelVersionPeer::NAME, $this->name); - if ($this->isColumnModified(ModelVersionPeer::TEMPLATE)) $criteria->add(ModelVersionPeer::TEMPLATE, $this->template); - if ($this->isColumnModified(ModelVersionPeer::CLASS_KEY)) $criteria->add(ModelVersionPeer::CLASS_KEY, $this->class_key); - if ($this->isColumnModified(ModelVersionPeer::CREATED_AT)) $criteria->add(ModelVersionPeer::CREATED_AT, $this->created_at); - if ($this->isColumnModified(ModelVersionPeer::UPDATED_AT)) $criteria->add(ModelVersionPeer::UPDATED_AT, $this->updated_at); - if ($this->isColumnModified(ModelVersionPeer::VERSION)) $criteria->add(ModelVersionPeer::VERSION, $this->version); - if ($this->isColumnModified(ModelVersionPeer::VERSION_CREATED_AT)) $criteria->add(ModelVersionPeer::VERSION_CREATED_AT, $this->version_created_at); - if ($this->isColumnModified(ModelVersionPeer::VERSION_CREATED_BY)) $criteria->add(ModelVersionPeer::VERSION_CREATED_BY, $this->version_created_by); - if ($this->isColumnModified(ModelVersionPeer::NWS_BLOCK_IDS)) $criteria->add(ModelVersionPeer::NWS_BLOCK_IDS, $this->nws_block_ids); - if ($this->isColumnModified(ModelVersionPeer::NWS_BLOCK_VERSIONS)) $criteria->add(ModelVersionPeer::NWS_BLOCK_VERSIONS, $this->nws_block_versions); - - 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(ModelVersionPeer::DATABASE_NAME); - $criteria->add(ModelVersionPeer::ID, $this->id); - $criteria->add(ModelVersionPeer::VERSION, $this->version); - - return $criteria; - } - - /** - * Returns the composite primary key for this object. - * The array elements will be in same order as specified in XML. - * @return array - */ - public function getPrimaryKey() - { - $pks = array(); - $pks[0] = $this->getId(); - $pks[1] = $this->getVersion(); - - return $pks; - } - - /** - * Set the [composite] primary key. - * - * @param array $keys The elements of the composite key (order must match the order in XML file). - * @return void - */ - public function setPrimaryKey($keys) - { - $this->setId($keys[0]); - $this->setVersion($keys[1]); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - - return (null === $this->getId()) && (null === $this->getVersion()); - } - - /** - * 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 ModelVersion (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->setId($this->getId()); - $copyObj->setName($this->getName()); - $copyObj->setTemplate($this->getTemplate()); - $copyObj->setClassKey($this->getClassKey()); - $copyObj->setCreatedAt($this->getCreatedAt()); - $copyObj->setUpdatedAt($this->getUpdatedAt()); - $copyObj->setVersion($this->getVersion()); - $copyObj->setVersionCreatedAt($this->getVersionCreatedAt()); - $copyObj->setVersionCreatedBy($this->getVersionCreatedBy()); - $copyObj->setNwsBlockIds($this->getNwsBlockIds()); - $copyObj->setNwsBlockVersions($this->getNwsBlockVersions()); - - if ($deepCopy && !$this->startCopy) { - // important: temporarily setNew(false) because this affects the behavior of - // the getter/setter methods for fkey referrer objects. - $copyObj->setNew(false); - // store object hash to prevent cycle - $this->startCopy = true; - - //unflag object copy - $this->startCopy = false; - } // if ($deepCopy) - - if ($makeNew) { - $copyObj->setNew(true); - } - } - - /** - * 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 ModelVersion 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 ModelVersionPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new ModelVersionPeer(); - } - - return self::$peer; - } - - /** - * Declares an association between this object and a Model object. - * - * @param Model $v - * @return ModelVersion The current object (for fluent API support) - * @throws PropelException - */ - public function setModel(Model $v = null) - { - if ($v === null) { - $this->setId(NULL); - } else { - $this->setId($v->getId()); - } - - $this->aModel = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the Model object, it will not be re-added. - if ($v !== null) { - $v->addModelVersion($this); - } - - - return $this; - } - - - /** - * Get the associated Model object - * - * @param PropelPDO $con Optional Connection object. - * @param $doQuery Executes a query to get the object if required - * @return Model The associated Model object. - * @throws PropelException - */ - public function getModel(PropelPDO $con = null, $doQuery = true) - { - if ($this->aModel === null && ($this->id !== null) && $doQuery) { - $this->aModel = ModelQuery::create()->findPk($this->id, $con); - /* The following can be used additionally to - guarantee the related object contains a reference - to this object. This level of coupling may, however, be - undesirable since it could result in an only partially populated collection - in the referenced object. - $this->aModel->addModelVersions($this); - */ - } - - return $this->aModel; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->name = null; - $this->template = null; - $this->class_key = null; - $this->created_at = null; - $this->updated_at = null; - $this->version = null; - $this->version_created_at = null; - $this->version_created_by = null; - $this->nws_block_ids = null; - $this->nws_block_ids_unserialized = null; - $this->nws_block_versions = null; - $this->nws_block_versions_unserialized = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->alreadyInClearAllReferencesDeep = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $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; - if ($this->aModel instanceof Persistent) { - $this->aModel->clearAllReferences($deep); - } - - $this->alreadyInClearAllReferencesDeep = false; - } // if ($deep) - - $this->aModel = null; - } - - /** - * return the string representation of this object - * - * @return string - */ - public function __toString() - { - return (string) $this->exportTo(ModelVersionPeer::DEFAULT_STRING_FORMAT); - } - - /** - * return true is the object is in saving state - * - * @return boolean - */ - public function isAlreadyInSave() - { - return $this->alreadyInSave; - } - - // event behavior - public function preCommit(\PropelPDO $con = null){} - public function preCommitSave(\PropelPDO $con = null){} - public function preCommitDelete(\PropelPDO $con = null){} - public function preCommitUpdate(\PropelPDO $con = null){} - public function preCommitInsert(\PropelPDO $con = null){} - public function preRollback(\PropelPDO $con = null){} - public function preRollbackSave(\PropelPDO $con = null){} - public function preRollbackDelete(\PropelPDO $con = null){} - public function preRollbackUpdate(\PropelPDO $con = null){} - public function preRollbackInsert(\PropelPDO $con = null){} - -} diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModelVersionPeer.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModelVersionPeer.php deleted file mode 100644 index df2cd0e..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModelVersionPeer.php +++ /dev/null @@ -1,1060 +0,0 @@ - array ('Id', 'Name', 'Template', 'ClassKey', 'CreatedAt', 'UpdatedAt', 'Version', 'VersionCreatedAt', 'VersionCreatedBy', 'NwsBlockIds', 'NwsBlockVersions', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'name', 'template', 'classKey', 'createdAt', 'updatedAt', 'version', 'versionCreatedAt', 'versionCreatedBy', 'nwsBlockIds', 'nwsBlockVersions', ), - BasePeer::TYPE_COLNAME => array (ModelVersionPeer::ID, ModelVersionPeer::NAME, ModelVersionPeer::TEMPLATE, ModelVersionPeer::CLASS_KEY, ModelVersionPeer::CREATED_AT, ModelVersionPeer::UPDATED_AT, ModelVersionPeer::VERSION, ModelVersionPeer::VERSION_CREATED_AT, ModelVersionPeer::VERSION_CREATED_BY, ModelVersionPeer::NWS_BLOCK_IDS, ModelVersionPeer::NWS_BLOCK_VERSIONS, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'TEMPLATE', 'CLASS_KEY', 'CREATED_AT', 'UPDATED_AT', 'VERSION', 'VERSION_CREATED_AT', 'VERSION_CREATED_BY', 'NWS_BLOCK_IDS', 'NWS_BLOCK_VERSIONS', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'template', 'class_key', 'created_at', 'updated_at', 'version', 'version_created_at', 'version_created_by', 'nws_block_ids', 'nws_block_versions', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ) - ); - - /** - * holds an array of keys for quick access to the fieldnames array - * - * first dimension keys are the type constants - * e.g. ModelVersionPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 - */ - protected static $fieldKeys = array ( - BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Name' => 1, 'Template' => 2, 'ClassKey' => 3, 'CreatedAt' => 4, 'UpdatedAt' => 5, 'Version' => 6, 'VersionCreatedAt' => 7, 'VersionCreatedBy' => 8, 'NwsBlockIds' => 9, 'NwsBlockVersions' => 10, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'name' => 1, 'template' => 2, 'classKey' => 3, 'createdAt' => 4, 'updatedAt' => 5, 'version' => 6, 'versionCreatedAt' => 7, 'versionCreatedBy' => 8, 'nwsBlockIds' => 9, 'nwsBlockVersions' => 10, ), - BasePeer::TYPE_COLNAME => array (ModelVersionPeer::ID => 0, ModelVersionPeer::NAME => 1, ModelVersionPeer::TEMPLATE => 2, ModelVersionPeer::CLASS_KEY => 3, ModelVersionPeer::CREATED_AT => 4, ModelVersionPeer::UPDATED_AT => 5, ModelVersionPeer::VERSION => 6, ModelVersionPeer::VERSION_CREATED_AT => 7, ModelVersionPeer::VERSION_CREATED_BY => 8, ModelVersionPeer::NWS_BLOCK_IDS => 9, ModelVersionPeer::NWS_BLOCK_VERSIONS => 10, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'TEMPLATE' => 2, 'CLASS_KEY' => 3, 'CREATED_AT' => 4, 'UPDATED_AT' => 5, 'VERSION' => 6, 'VERSION_CREATED_AT' => 7, 'VERSION_CREATED_BY' => 8, 'NWS_BLOCK_IDS' => 9, 'NWS_BLOCK_VERSIONS' => 10, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'template' => 2, 'class_key' => 3, 'created_at' => 4, 'updated_at' => 5, 'version' => 6, 'version_created_at' => 7, 'version_created_by' => 8, 'nws_block_ids' => 9, 'nws_block_versions' => 10, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ) - ); - - /** - * 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 = ModelVersionPeer::getFieldNames($toType); - $key = isset(ModelVersionPeer::$fieldKeys[$fromType][$name]) ? ModelVersionPeer::$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(ModelVersionPeer::$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, ModelVersionPeer::$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 ModelVersionPeer::$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. ModelVersionPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(ModelVersionPeer::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(ModelVersionPeer::ID); - $criteria->addSelectColumn(ModelVersionPeer::NAME); - $criteria->addSelectColumn(ModelVersionPeer::TEMPLATE); - $criteria->addSelectColumn(ModelVersionPeer::CLASS_KEY); - $criteria->addSelectColumn(ModelVersionPeer::CREATED_AT); - $criteria->addSelectColumn(ModelVersionPeer::UPDATED_AT); - $criteria->addSelectColumn(ModelVersionPeer::VERSION); - $criteria->addSelectColumn(ModelVersionPeer::VERSION_CREATED_AT); - $criteria->addSelectColumn(ModelVersionPeer::VERSION_CREATED_BY); - $criteria->addSelectColumn(ModelVersionPeer::NWS_BLOCK_IDS); - $criteria->addSelectColumn(ModelVersionPeer::NWS_BLOCK_VERSIONS); - } else { - $criteria->addSelectColumn($alias . '.id'); - $criteria->addSelectColumn($alias . '.name'); - $criteria->addSelectColumn($alias . '.template'); - $criteria->addSelectColumn($alias . '.class_key'); - $criteria->addSelectColumn($alias . '.created_at'); - $criteria->addSelectColumn($alias . '.updated_at'); - $criteria->addSelectColumn($alias . '.version'); - $criteria->addSelectColumn($alias . '.version_created_at'); - $criteria->addSelectColumn($alias . '.version_created_by'); - $criteria->addSelectColumn($alias . '.nws_block_ids'); - $criteria->addSelectColumn($alias . '.nws_block_versions'); - } - } - - /** - * 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(ModelVersionPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - ModelVersionPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count - $criteria->setDbName(ModelVersionPeer::DATABASE_NAME); // Set the correct dbName - - if ($con === null) { - $con = Propel::getConnection(ModelVersionPeer::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 ModelVersion - * @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 = ModelVersionPeer::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 ModelVersionPeer::populateObjects(ModelVersionPeer::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(ModelVersionPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - ModelVersionPeer::addSelectColumns($criteria); - } - - // Set the correct dbName - $criteria->setDbName(ModelVersionPeer::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 ModelVersion $obj A ModelVersion 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 = serialize(array((string) $obj->getId(), (string) $obj->getVersion())); - } // if key === null - ModelVersionPeer::$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 ModelVersion 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 ModelVersion) { - $key = serialize(array((string) $value->getId(), (string) $value->getVersion())); - } elseif (is_array($value) && count($value) === 2) { - // assume we've been passed a primary key - $key = serialize(array((string) $value[0], (string) $value[1])); - } else { - $e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or ModelVersion object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value,true))); - throw $e; - } - - unset(ModelVersionPeer::$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 ModelVersion 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(ModelVersionPeer::$instances[$key])) { - return ModelVersionPeer::$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 (ModelVersionPeer::$instances as $instance) { - $instance->clearAllReferences(true); - } - } - ModelVersionPeer::$instances = array(); - } - - /** - * Method to invalidate the instance pool of all tables related to nws_model_version - * 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 && $row[$startcol + 6] === null) { - return null; - } - - return serialize(array((string) $row[$startcol], (string) $row[$startcol + 6])); - } - - /** - * 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 array((int) $row[$startcol], (int) $row[$startcol + 6]); - } - - /** - * 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 = ModelVersionPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = ModelVersionPeer::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 = ModelVersionPeer::getOMClass($row, 0); - $cls = substr('.'.$cls, strrpos('.'.$cls, '.') + 1); - $obj = new $cls(); - $obj->hydrate($row); - $results[] = $obj; - ModelVersionPeer::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 (ModelVersion object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = ModelVersionPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = ModelVersionPeer::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 + ModelVersionPeer::NUM_HYDRATE_COLUMNS; - } else { - $cls = ModelVersionPeer::getOMClass($row, $startcol); - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - ModelVersionPeer::addInstanceToPool($obj, $key); - } - - return array($obj, $col); - } - - - /** - * Returns the number of rows matching criteria, joining the related Model table - * - * @param Criteria $criteria - * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead. - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return int Number of matching rows. - */ - public static function doCountJoinModel(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - // we're going to 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(ModelVersionPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - ModelVersionPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count - - // Set the correct dbName - $criteria->setDbName(ModelVersionPeer::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(ModelVersionPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(ModelVersionPeer::ID, ModelPeer::ID, $join_behavior); - - $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 a collection of ModelVersion objects pre-filled with their Model objects. - * @param Criteria $criteria - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return array Array of ModelVersion objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinModel(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(ModelVersionPeer::DATABASE_NAME); - } - - ModelVersionPeer::addSelectColumns($criteria); - $startcol = ModelVersionPeer::NUM_HYDRATE_COLUMNS; - ModelPeer::addSelectColumns($criteria); - - $criteria->addJoin(ModelVersionPeer::ID, ModelPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = ModelVersionPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = ModelVersionPeer::getInstanceFromPool($key1))) { - // We no longer rehydrate the object, since this can cause data loss. - // See http://www.propelorm.org/ticket/509 - // $obj1->hydrate($row, 0, true); // rehydrate - } else { - - $omClass = ModelVersionPeer::getOMClass($row, 0); - $cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1); - - $obj1 = new $cls(); - $obj1->hydrate($row); - ModelVersionPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = ModelPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = ModelPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $omClass = ModelPeer::getOMClass($row, $startcol); - $cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - ModelPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (ModelVersion) to $obj2 (Model) - $obj2->addModelVersion($obj1); - - } // if joined row was not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - - return $results; - } - - - /** - * Returns the number of rows matching criteria, joining all related tables - * - * @param Criteria $criteria - * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead. - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return int Number of matching rows. - */ - public static function doCountJoinAll(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - // we're going to 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(ModelVersionPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - ModelVersionPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count - - // Set the correct dbName - $criteria->setDbName(ModelVersionPeer::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(ModelVersionPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(ModelVersionPeer::ID, ModelPeer::ID, $join_behavior); - - $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 a collection of ModelVersion objects pre-filled with all related objects. - * - * @param Criteria $criteria - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return array Array of ModelVersion objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(ModelVersionPeer::DATABASE_NAME); - } - - ModelVersionPeer::addSelectColumns($criteria); - $startcol2 = ModelVersionPeer::NUM_HYDRATE_COLUMNS; - - ModelPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + ModelPeer::NUM_HYDRATE_COLUMNS; - - $criteria->addJoin(ModelVersionPeer::ID, ModelPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = ModelVersionPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = ModelVersionPeer::getInstanceFromPool($key1))) { - // We no longer rehydrate the object, since this can cause data loss. - // See http://www.propelorm.org/ticket/509 - // $obj1->hydrate($row, 0, true); // rehydrate - } else { - $omClass = ModelVersionPeer::getOMClass($row, 0); - $cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1); - - $obj1 = new $cls(); - $obj1->hydrate($row); - ModelVersionPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined Model rows - - $key2 = ModelPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = ModelPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $omClass = ModelPeer::getOMClass($row, $startcol2); - $cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - ModelPeer::addInstanceToPool($obj2, $key2); - } // if obj2 loaded - - // Add the $obj1 (ModelVersion) to the collection in $obj2 (Model) - $obj2->addModelVersion($obj1); - } // if joined row not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - - return $results; - } - - /** - * 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(ModelVersionPeer::DATABASE_NAME)->getTable(ModelVersionPeer::TABLE_NAME); - } - - /** - * Add a TableMap instance to the database for this peer class. - */ - public static function buildTableMap() - { - $dbMap = Propel::getDatabaseMap(BaseModelVersionPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseModelVersionPeer::TABLE_NAME)) { - $dbMap->addTableObject(new \Trinity\Bundle\NewsletterBundle\Model\map\ModelVersionTableMap()); - } - } - - /** - * 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 = $row[$colnum + 3]; - $omClass = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1); - - } catch (Exception $e) { - throw new PropelException('Unable to get OM class.', $e); - } - - - $event = new DetectOMClassEvent($omClass); - EventDispatcherProxy::trigger('om.detect', $event); - if($event->isDetected()){ - return $event->getDetectedClass(); - } - - return $omClass; - } - - /** - * Performs an INSERT on the database, given a ModelVersion or Criteria object. - * - * @param mixed $values Criteria or ModelVersion 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(ModelVersionPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from ModelVersion object - } - - - // Set the correct dbName - $criteria->setDbName(ModelVersionPeer::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 ModelVersion or Criteria object. - * - * @param mixed $values Criteria or ModelVersion 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(ModelVersionPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(ModelVersionPeer::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(ModelVersionPeer::ID); - $value = $criteria->remove(ModelVersionPeer::ID); - if ($value) { - $selectCriteria->add(ModelVersionPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(ModelVersionPeer::TABLE_NAME); - } - - $comparison = $criteria->getComparison(ModelVersionPeer::VERSION); - $value = $criteria->remove(ModelVersionPeer::VERSION); - if ($value) { - $selectCriteria->add(ModelVersionPeer::VERSION, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(ModelVersionPeer::TABLE_NAME); - } - - } else { // $values is ModelVersion object - $criteria = $values->buildCriteria(); // gets full criteria - $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s) - } - - // set the correct dbName - $criteria->setDbName(ModelVersionPeer::DATABASE_NAME); - - return BasePeer::doUpdate($selectCriteria, $criteria, $con); - } - - /** - * Deletes all rows from the nws_model_version 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(ModelVersionPeer::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(ModelVersionPeer::TABLE_NAME, $con, ModelVersionPeer::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). - ModelVersionPeer::clearInstancePool(); - ModelVersionPeer::clearRelatedInstancePool(); - $con->commit(); - - return $affectedRows; - } catch (Exception $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs a DELETE on the database, given a ModelVersion or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or ModelVersion 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(ModelVersionPeer::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. - ModelVersionPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof ModelVersion) { // it's a model object - // invalidate the cache for this single object - ModelVersionPeer::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(ModelVersionPeer::DATABASE_NAME); - // primary key is composite; we therefore, expect - // the primary key passed to be an array of pkey values - if (count($values) == count($values, COUNT_RECURSIVE)) { - // array is not multi-dimensional - $values = array($values); - } - foreach ($values as $value) { - $criterion = $criteria->getNewCriterion(ModelVersionPeer::ID, $value[0]); - $criterion->addAnd($criteria->getNewCriterion(ModelVersionPeer::VERSION, $value[1])); - $criteria->addOr($criterion); - // we can invalidate the cache for this single PK - ModelVersionPeer::removeInstanceFromPool($value); - } - } - - // Set the correct dbName - $criteria->setDbName(ModelVersionPeer::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); - ModelVersionPeer::clearRelatedInstancePool(); - $con->commit(); - - return $affectedRows; - } catch (Exception $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given ModelVersion 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 ModelVersion $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(ModelVersionPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(ModelVersionPeer::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(ModelVersionPeer::DATABASE_NAME, ModelVersionPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve object using using composite pkey values. - * @param int $id - * @param int $version - * @param PropelPDO $con - * @return ModelVersion - */ - public static function retrieveByPK($id, $version, PropelPDO $con = null) { - $_instancePoolKey = serialize(array((string) $id, (string) $version)); - if (null !== ($obj = ModelVersionPeer::getInstanceFromPool($_instancePoolKey))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(ModelVersionPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - $criteria = new Criteria(ModelVersionPeer::DATABASE_NAME); - $criteria->add(ModelVersionPeer::ID, $id); - $criteria->add(ModelVersionPeer::VERSION, $version); - $v = ModelVersionPeer::doSelect($criteria, $con); - - return !empty($v) ? $v[0] : null; - } -} // BaseModelVersionPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseModelVersionPeer::buildTableMap(); - -EventDispatcherProxy::trigger(array('construct','peer.construct'), new PeerEvent('Trinity\Bundle\NewsletterBundle\Model\om\BaseModelVersionPeer')); diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModelVersionQuery.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModelVersionQuery.php deleted file mode 100644 index c117181..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseModelVersionQuery.php +++ /dev/null @@ -1,941 +0,0 @@ -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(array(12, 34), $con); - * - * - * @param array $key Primary key to use for the query - A Primary key composition: [$id, $version] - * @param PropelPDO $con an optional connection object - * - * @return ModelVersion|ModelVersion[]|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ($key === null) { - return null; - } - if ((null !== ($obj = ModelVersionPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) { - // the object is already in the instance pool - return $obj; - } - if ($con === null) { - $con = Propel::getConnection(ModelVersionPeer::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); - } - } - - /** - * 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 ModelVersion A model object, or null if the key is not found - * @throws PropelException - */ - protected function findPkSimple($key, $con) - { - $sql = 'SELECT `id`, `name`, `template`, `class_key`, `created_at`, `updated_at`, `version`, `version_created_at`, `version_created_by`, `nws_block_ids`, `nws_block_versions` FROM `nws_model_version` WHERE `id` = :p0 AND `version` = :p1'; - try { - $stmt = $con->prepare($sql); - $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); - $stmt->bindValue(':p1', $key[1], 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 = ModelVersionPeer::getOMClass($row, 0); - $obj = new $cls(); - $obj->hydrate($row); - ModelVersionPeer::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1]))); - } - $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 ModelVersion|ModelVersion[]|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(array(12, 56), array(832, 123), array(123, 456)), $con); - * - * @param array $keys Primary keys to use for the query - * @param PropelPDO $con an optional connection object - * - * @return PropelObjectCollection|ModelVersion[]|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 ModelVersionQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - $this->addUsingAlias(ModelVersionPeer::ID, $key[0], Criteria::EQUAL); - $this->addUsingAlias(ModelVersionPeer::VERSION, $key[1], Criteria::EQUAL); - - return $this; - } - - /** - * Filter the query by a list of primary keys - * - * @param array $keys The list of primary key to use for the query - * - * @return ModelVersionQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - if (empty($keys)) { - return $this->add(null, '1<>1', Criteria::CUSTOM); - } - foreach ($keys as $key) { - $cton0 = $this->getNewCriterion(ModelVersionPeer::ID, $key[0], Criteria::EQUAL); - $cton1 = $this->getNewCriterion(ModelVersionPeer::VERSION, $key[1], Criteria::EQUAL); - $cton0->addAnd($cton1); - $this->addOr($cton0); - } - - return $this; - } - - /** - * 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 - * - * - * @see filterByModel() - * - * @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 ModelVersionQuery 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(ModelVersionPeer::ID, $id['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($id['max'])) { - $this->addUsingAlias(ModelVersionPeer::ID, $id['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(ModelVersionPeer::ID, $id, $comparison); - } - - /** - * Filter the query on the name column - * - * Example usage: - * - * $query->filterByName('fooValue'); // WHERE name = 'fooValue' - * $query->filterByName('%fooValue%'); // WHERE name LIKE '%fooValue%' - * - * - * @param string $name 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 ModelVersionQuery The current query, for fluid interface - */ - public function filterByName($name = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($name)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $name)) { - $name = str_replace('*', '%', $name); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(ModelVersionPeer::NAME, $name, $comparison); - } - - /** - * Filter the query on the template column - * - * Example usage: - * - * $query->filterByTemplate('fooValue'); // WHERE template = 'fooValue' - * $query->filterByTemplate('%fooValue%'); // WHERE template LIKE '%fooValue%' - * - * - * @param string $template 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 ModelVersionQuery The current query, for fluid interface - */ - public function filterByTemplate($template = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($template)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $template)) { - $template = str_replace('*', '%', $template); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(ModelVersionPeer::TEMPLATE, $template, $comparison); - } - - /** - * Filter the query on the class_key column - * - * Example usage: - * - * $query->filterByClassKey('fooValue'); // WHERE class_key = 'fooValue' - * $query->filterByClassKey('%fooValue%'); // WHERE class_key LIKE '%fooValue%' - * - * - * @param string $classKey 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 ModelVersionQuery The current query, for fluid interface - */ - public function filterByClassKey($classKey = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($classKey)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $classKey)) { - $classKey = str_replace('*', '%', $classKey); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(ModelVersionPeer::CLASS_KEY, $classKey, $comparison); - } - - /** - * Filter the query on the created_at column - * - * Example usage: - * - * $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14' - * $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14' - * $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at < '2011-03-13' - * - * - * @param mixed $createdAt The value to use as filter. - * Values can be integers (unix timestamps), DateTime objects, or strings. - * Empty strings are treated as NULL. - * 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 ModelVersionQuery The current query, for fluid interface - */ - public function filterByCreatedAt($createdAt = null, $comparison = null) - { - if (is_array($createdAt)) { - $useMinMax = false; - if (isset($createdAt['min'])) { - $this->addUsingAlias(ModelVersionPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($createdAt['max'])) { - $this->addUsingAlias(ModelVersionPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(ModelVersionPeer::CREATED_AT, $createdAt, $comparison); - } - - /** - * Filter the query on the updated_at column - * - * Example usage: - * - * $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14' - * $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14' - * $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at < '2011-03-13' - * - * - * @param mixed $updatedAt The value to use as filter. - * Values can be integers (unix timestamps), DateTime objects, or strings. - * Empty strings are treated as NULL. - * 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 ModelVersionQuery The current query, for fluid interface - */ - public function filterByUpdatedAt($updatedAt = null, $comparison = null) - { - if (is_array($updatedAt)) { - $useMinMax = false; - if (isset($updatedAt['min'])) { - $this->addUsingAlias(ModelVersionPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($updatedAt['max'])) { - $this->addUsingAlias(ModelVersionPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(ModelVersionPeer::UPDATED_AT, $updatedAt, $comparison); - } - - /** - * Filter the query on the version column - * - * Example usage: - * - * $query->filterByVersion(1234); // WHERE version = 1234 - * $query->filterByVersion(array(12, 34)); // WHERE version IN (12, 34) - * $query->filterByVersion(array('min' => 12)); // WHERE version >= 12 - * $query->filterByVersion(array('max' => 12)); // WHERE version <= 12 - * - * - * @param mixed $version 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 ModelVersionQuery The current query, for fluid interface - */ - public function filterByVersion($version = null, $comparison = null) - { - if (is_array($version)) { - $useMinMax = false; - if (isset($version['min'])) { - $this->addUsingAlias(ModelVersionPeer::VERSION, $version['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($version['max'])) { - $this->addUsingAlias(ModelVersionPeer::VERSION, $version['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(ModelVersionPeer::VERSION, $version, $comparison); - } - - /** - * Filter the query on the version_created_at column - * - * Example usage: - * - * $query->filterByVersionCreatedAt('2011-03-14'); // WHERE version_created_at = '2011-03-14' - * $query->filterByVersionCreatedAt('now'); // WHERE version_created_at = '2011-03-14' - * $query->filterByVersionCreatedAt(array('max' => 'yesterday')); // WHERE version_created_at < '2011-03-13' - * - * - * @param mixed $versionCreatedAt The value to use as filter. - * Values can be integers (unix timestamps), DateTime objects, or strings. - * Empty strings are treated as NULL. - * 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 ModelVersionQuery The current query, for fluid interface - */ - public function filterByVersionCreatedAt($versionCreatedAt = null, $comparison = null) - { - if (is_array($versionCreatedAt)) { - $useMinMax = false; - if (isset($versionCreatedAt['min'])) { - $this->addUsingAlias(ModelVersionPeer::VERSION_CREATED_AT, $versionCreatedAt['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($versionCreatedAt['max'])) { - $this->addUsingAlias(ModelVersionPeer::VERSION_CREATED_AT, $versionCreatedAt['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(ModelVersionPeer::VERSION_CREATED_AT, $versionCreatedAt, $comparison); - } - - /** - * Filter the query on the version_created_by column - * - * Example usage: - * - * $query->filterByVersionCreatedBy('fooValue'); // WHERE version_created_by = 'fooValue' - * $query->filterByVersionCreatedBy('%fooValue%'); // WHERE version_created_by LIKE '%fooValue%' - * - * - * @param string $versionCreatedBy 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 ModelVersionQuery The current query, for fluid interface - */ - public function filterByVersionCreatedBy($versionCreatedBy = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($versionCreatedBy)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $versionCreatedBy)) { - $versionCreatedBy = str_replace('*', '%', $versionCreatedBy); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(ModelVersionPeer::VERSION_CREATED_BY, $versionCreatedBy, $comparison); - } - - /** - * Filter the query on the nws_block_ids column - * - * @param array $nwsBlockIds The values to use as filter. - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ModelVersionQuery The current query, for fluid interface - */ - public function filterByNwsBlockIds($nwsBlockIds = null, $comparison = null) - { - $key = $this->getAliasedColName(ModelVersionPeer::NWS_BLOCK_IDS); - if (null === $comparison || $comparison == Criteria::CONTAINS_ALL) { - foreach ($nwsBlockIds as $value) { - $value = '%| ' . $value . ' |%'; - if ($this->containsKey($key)) { - $this->addAnd($key, $value, Criteria::LIKE); - } else { - $this->add($key, $value, Criteria::LIKE); - } - } - - return $this; - } elseif ($comparison == Criteria::CONTAINS_SOME) { - foreach ($nwsBlockIds as $value) { - $value = '%| ' . $value . ' |%'; - if ($this->containsKey($key)) { - $this->addOr($key, $value, Criteria::LIKE); - } else { - $this->add($key, $value, Criteria::LIKE); - } - } - - return $this; - } elseif ($comparison == Criteria::CONTAINS_NONE) { - foreach ($nwsBlockIds as $value) { - $value = '%| ' . $value . ' |%'; - if ($this->containsKey($key)) { - $this->addAnd($key, $value, Criteria::NOT_LIKE); - } else { - $this->add($key, $value, Criteria::NOT_LIKE); - } - } - $this->addOr($key, null, Criteria::ISNULL); - - return $this; - } - - return $this->addUsingAlias(ModelVersionPeer::NWS_BLOCK_IDS, $nwsBlockIds, $comparison); - } - - /** - * Filter the query on the nws_block_ids column - * @param mixed $nwsBlockIds The value to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::CONTAINS_ALL - * - * @return ModelVersionQuery The current query, for fluid interface - */ - public function filterByNwsBlockId($nwsBlockIds = null, $comparison = null) - { - if (null === $comparison || $comparison == Criteria::CONTAINS_ALL) { - if (is_scalar($nwsBlockIds)) { - $nwsBlockIds = '%| ' . $nwsBlockIds . ' |%'; - $comparison = Criteria::LIKE; - } - } elseif ($comparison == Criteria::CONTAINS_NONE) { - $nwsBlockIds = '%| ' . $nwsBlockIds . ' |%'; - $comparison = Criteria::NOT_LIKE; - $key = $this->getAliasedColName(ModelVersionPeer::NWS_BLOCK_IDS); - if ($this->containsKey($key)) { - $this->addAnd($key, $nwsBlockIds, $comparison); - } else { - $this->addAnd($key, $nwsBlockIds, $comparison); - } - $this->addOr($key, null, Criteria::ISNULL); - - return $this; - } - - return $this->addUsingAlias(ModelVersionPeer::NWS_BLOCK_IDS, $nwsBlockIds, $comparison); - } - - /** - * Filter the query on the nws_block_versions column - * - * @param array $nwsBlockVersions The values to use as filter. - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ModelVersionQuery The current query, for fluid interface - */ - public function filterByNwsBlockVersions($nwsBlockVersions = null, $comparison = null) - { - $key = $this->getAliasedColName(ModelVersionPeer::NWS_BLOCK_VERSIONS); - if (null === $comparison || $comparison == Criteria::CONTAINS_ALL) { - foreach ($nwsBlockVersions as $value) { - $value = '%| ' . $value . ' |%'; - if ($this->containsKey($key)) { - $this->addAnd($key, $value, Criteria::LIKE); - } else { - $this->add($key, $value, Criteria::LIKE); - } - } - - return $this; - } elseif ($comparison == Criteria::CONTAINS_SOME) { - foreach ($nwsBlockVersions as $value) { - $value = '%| ' . $value . ' |%'; - if ($this->containsKey($key)) { - $this->addOr($key, $value, Criteria::LIKE); - } else { - $this->add($key, $value, Criteria::LIKE); - } - } - - return $this; - } elseif ($comparison == Criteria::CONTAINS_NONE) { - foreach ($nwsBlockVersions as $value) { - $value = '%| ' . $value . ' |%'; - if ($this->containsKey($key)) { - $this->addAnd($key, $value, Criteria::NOT_LIKE); - } else { - $this->add($key, $value, Criteria::NOT_LIKE); - } - } - $this->addOr($key, null, Criteria::ISNULL); - - return $this; - } - - return $this->addUsingAlias(ModelVersionPeer::NWS_BLOCK_VERSIONS, $nwsBlockVersions, $comparison); - } - - /** - * Filter the query on the nws_block_versions column - * @param mixed $nwsBlockVersions The value to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::CONTAINS_ALL - * - * @return ModelVersionQuery The current query, for fluid interface - */ - public function filterByNwsBlockVersion($nwsBlockVersions = null, $comparison = null) - { - if (null === $comparison || $comparison == Criteria::CONTAINS_ALL) { - if (is_scalar($nwsBlockVersions)) { - $nwsBlockVersions = '%| ' . $nwsBlockVersions . ' |%'; - $comparison = Criteria::LIKE; - } - } elseif ($comparison == Criteria::CONTAINS_NONE) { - $nwsBlockVersions = '%| ' . $nwsBlockVersions . ' |%'; - $comparison = Criteria::NOT_LIKE; - $key = $this->getAliasedColName(ModelVersionPeer::NWS_BLOCK_VERSIONS); - if ($this->containsKey($key)) { - $this->addAnd($key, $nwsBlockVersions, $comparison); - } else { - $this->addAnd($key, $nwsBlockVersions, $comparison); - } - $this->addOr($key, null, Criteria::ISNULL); - - return $this; - } - - return $this->addUsingAlias(ModelVersionPeer::NWS_BLOCK_VERSIONS, $nwsBlockVersions, $comparison); - } - - /** - * Filter the query by a related Model object - * - * @param Model|PropelObjectCollection $model The related object(s) to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ModelVersionQuery The current query, for fluid interface - * @throws PropelException - if the provided filter is invalid. - */ - public function filterByModel($model, $comparison = null) - { - if ($model instanceof Model) { - return $this - ->addUsingAlias(ModelVersionPeer::ID, $model->getId(), $comparison); - } elseif ($model instanceof PropelObjectCollection) { - if (null === $comparison) { - $comparison = Criteria::IN; - } - - return $this - ->addUsingAlias(ModelVersionPeer::ID, $model->toKeyValue('PrimaryKey', 'Id'), $comparison); - } else { - throw new PropelException('filterByModel() only accepts arguments of type Model or PropelCollection'); - } - } - - /** - * Adds a JOIN clause to the query using the Model relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return ModelVersionQuery The current query, for fluid interface - */ - public function joinModel($relationAlias = null, $joinType = Criteria::INNER_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('Model'); - - // create a ModelJoin object for this join - $join = new ModelJoin(); - $join->setJoinType($joinType); - $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); - if ($previousJoin = $this->getPreviousJoin()) { - $join->setPreviousJoin($previousJoin); - } - - // add the ModelJoin to the current object - if ($relationAlias) { - $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); - $this->addJoinObject($join, $relationAlias); - } else { - $this->addJoinObject($join, 'Model'); - } - - return $this; - } - - /** - * Use the Model relation Model object - * - * @see useQuery() - * - * @param string $relationAlias optional alias for the relation, - * to be used as main alias in the secondary query - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return \Trinity\Bundle\NewsletterBundle\Model\ModelQuery A secondary query class using the current class as primary query - */ - public function useModelQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) - { - return $this - ->joinModel($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'Model', '\Trinity\Bundle\NewsletterBundle\Model\ModelQuery'); - } - - /** - * Exclude object from result - * - * @param ModelVersion $modelVersion Object to remove from the list of results - * - * @return ModelVersionQuery The current query, for fluid interface - */ - public function prune($modelVersion = null) - { - if ($modelVersion) { - $this->addCond('pruneCond0', $this->getAliasedColName(ModelVersionPeer::ID), $modelVersion->getId(), Criteria::NOT_EQUAL); - $this->addCond('pruneCond1', $this->getAliasedColName(ModelVersionPeer::VERSION), $modelVersion->getVersion(), Criteria::NOT_EQUAL); - $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR); - } - - return $this; - } - - /** - * Code to execute before every SELECT statement - * - * @param PropelPDO $con The connection object used by the query - */ - protected function basePreSelect(PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger('query.select.pre', new QueryEvent($this)); - - return $this->preSelect($con); - } - - /** - * Code to execute before every DELETE statement - * - * @param PropelPDO $con The connection object used by the query - */ - protected function basePreDelete(PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger(array('delete.pre','query.delete.pre'), new QueryEvent($this)); - - return $this->preDelete($con); - } - - /** - * Code to execute after every DELETE statement - * - * @param int $affectedRows the number of deleted rows - * @param PropelPDO $con The connection object used by the query - */ - protected function basePostDelete($affectedRows, PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger(array('delete.post','query.delete.post'), new QueryEvent($this)); - - return $this->postDelete($affectedRows, $con); - } - - /** - * Code to execute before every UPDATE statement - * - * @param array $values The associative array of columns and values for the update - * @param PropelPDO $con The connection object used by the query - * @param boolean $forceIndividualSaves If false (default), the resulting call is a BasePeer::doUpdate(), otherwise it is a series of save() calls on all the found objects - */ - protected function basePreUpdate(&$values, PropelPDO $con, $forceIndividualSaves = false) - { - // event behavior - EventDispatcherProxy::trigger(array('update.pre', 'query.update.pre'), new QueryEvent($this)); - - return $this->preUpdate($values, $con, $forceIndividualSaves); - } - - /** - * Code to execute after every UPDATE statement - * - * @param int $affectedRows the number of updated rows - * @param PropelPDO $con The connection object used by the query - */ - protected function basePostUpdate($affectedRows, PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger(array('update.post', 'query.update.post'), new QueryEvent($this)); - - return $this->postUpdate($affectedRows, $con); - } - - // extend behavior - public function setFormatter($formatter) - { - if (is_string($formatter) && $formatter === \ModelCriteria::FORMAT_ON_DEMAND) { - $formatter = '\Glorpen\Propel\PropelBundle\Formatter\PropelOnDemandFormatter'; - } - - return parent::setFormatter($formatter); - } -} diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletter.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletter.php deleted file mode 100644 index af20822..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletter.php +++ /dev/null @@ -1,2058 +0,0 @@ -id; - } - - public function __construct(){ - parent::__construct(); - EventDispatcherProxy::trigger(array('construct','model.construct'), new ModelEvent($this)); - } - - /** - * Get the [name] column value. - * - * @return string - */ - public function getName() - { - - return $this->name; - } - - /** - * Get the [sender_name] column value. - * - * @return string - */ - public function getSenderName() - { - - return $this->sender_name; - } - - /** - * Get the [sender_email] column value. - * - * @return string - */ - public function getSenderEmail() - { - - return $this->sender_email; - } - - /** - * Get the [model_id] column value. - * - * @return int - */ - public function getModelId() - { - - return $this->model_id; - } - - /** - * Get the [email_listing] column value. - * - * @return string - */ - public function getEmailListing() - { - - return $this->email_listing; - } - - /** - * Get the [optionally formatted] temporal [sent_at] column value. - * - * - * @param string $format The date/time format string (either date()-style or strftime()-style). - * If format is null, then the raw DateTime object will be returned. - * @return mixed Formatted date/time value as string or DateTime object (if format is null), null if column is null, and 0 if column value is 0000-00-00 00:00:00 - * @throws PropelException - if unable to parse/validate the date/time value. - */ - public function getSentAt($format = null) - { - if ($this->sent_at === null) { - return null; - } - - if ($this->sent_at === '0000-00-00 00:00:00') { - // while technically this is not a default value of null, - // this seems to be closest in meaning. - return null; - } - - try { - $dt = new DateTime($this->sent_at); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->sent_at, true), $x); - } - - if ($format === null) { - // Because propel.useDateTimeClass is true, we return a DateTime object. - return $dt; - } - - if (strpos($format, '%') !== false) { - return strftime($format, $dt->format('U')); - } - - return $dt->format($format); - - } - - /** - * Get the [optionally formatted] temporal [created_at] column value. - * - * - * @param string $format The date/time format string (either date()-style or strftime()-style). - * If format is null, then the raw DateTime object will be returned. - * @return mixed Formatted date/time value as string or DateTime object (if format is null), null if column is null, and 0 if column value is 0000-00-00 00:00:00 - * @throws PropelException - if unable to parse/validate the date/time value. - */ - public function getCreatedAt($format = null) - { - if ($this->created_at === null) { - return null; - } - - if ($this->created_at === '0000-00-00 00:00:00') { - // while technically this is not a default value of null, - // this seems to be closest in meaning. - return null; - } - - try { - $dt = new DateTime($this->created_at); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->created_at, true), $x); - } - - if ($format === null) { - // Because propel.useDateTimeClass is true, we return a DateTime object. - return $dt; - } - - if (strpos($format, '%') !== false) { - return strftime($format, $dt->format('U')); - } - - return $dt->format($format); - - } - - /** - * Get the [optionally formatted] temporal [updated_at] column value. - * - * - * @param string $format The date/time format string (either date()-style or strftime()-style). - * If format is null, then the raw DateTime object will be returned. - * @return mixed Formatted date/time value as string or DateTime object (if format is null), null if column is null, and 0 if column value is 0000-00-00 00:00:00 - * @throws PropelException - if unable to parse/validate the date/time value. - */ - public function getUpdatedAt($format = null) - { - if ($this->updated_at === null) { - return null; - } - - if ($this->updated_at === '0000-00-00 00:00:00') { - // while technically this is not a default value of null, - // this seems to be closest in meaning. - return null; - } - - try { - $dt = new DateTime($this->updated_at); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->updated_at, true), $x); - } - - if ($format === null) { - // Because propel.useDateTimeClass is true, we return a DateTime object. - return $dt; - } - - if (strpos($format, '%') !== false) { - return strftime($format, $dt->format('U')); - } - - return $dt->format($format); - - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return Newsletter 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[] = NewsletterPeer::ID; - } - - - return $this; - } // setId() - - /** - * Set the value of [name] column. - * - * @param string $v new value - * @return Newsletter The current object (for fluent API support) - */ - public function setName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->name !== $v) { - $this->name = $v; - $this->modifiedColumns[] = NewsletterPeer::NAME; - } - - - return $this; - } // setName() - - /** - * Set the value of [sender_name] column. - * - * @param string $v new value - * @return Newsletter The current object (for fluent API support) - */ - public function setSenderName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->sender_name !== $v) { - $this->sender_name = $v; - $this->modifiedColumns[] = NewsletterPeer::SENDER_NAME; - } - - - return $this; - } // setSenderName() - - /** - * Set the value of [sender_email] column. - * - * @param string $v new value - * @return Newsletter The current object (for fluent API support) - */ - public function setSenderEmail($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->sender_email !== $v) { - $this->sender_email = $v; - $this->modifiedColumns[] = NewsletterPeer::SENDER_EMAIL; - } - - - return $this; - } // setSenderEmail() - - /** - * Set the value of [model_id] column. - * - * @param int $v new value - * @return Newsletter The current object (for fluent API support) - */ - public function setModelId($v) - { - if ($v !== null && is_numeric($v)) { - $v = (int) $v; - } - - if ($this->model_id !== $v) { - $this->model_id = $v; - $this->modifiedColumns[] = NewsletterPeer::MODEL_ID; - } - - if ($this->aModel !== null && $this->aModel->getId() !== $v) { - $this->aModel = null; - } - - - return $this; - } // setModelId() - - /** - * Set the value of [email_listing] column. - * - * @param string $v new value - * @return Newsletter The current object (for fluent API support) - */ - public function setEmailListing($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->email_listing !== $v) { - $this->email_listing = $v; - $this->modifiedColumns[] = NewsletterPeer::EMAIL_LISTING; - } - - - return $this; - } // setEmailListing() - - /** - * Sets the value of [sent_at] column to a normalized version of the date/time value specified. - * - * @param mixed $v string, integer (timestamp), or DateTime value. - * Empty strings are treated as null. - * @return Newsletter The current object (for fluent API support) - */ - public function setSentAt($v) - { - $dt = PropelDateTime::newInstance($v, null, 'DateTime'); - if ($this->sent_at !== null || $dt !== null) { - $currentDateAsString = ($this->sent_at !== null && $tmpDt = new DateTime($this->sent_at)) ? $tmpDt->format('Y-m-d H:i:s') : null; - $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null; - if ($currentDateAsString !== $newDateAsString) { - $this->sent_at = $newDateAsString; - $this->modifiedColumns[] = NewsletterPeer::SENT_AT; - } - } // if either are not null - - - return $this; - } // setSentAt() - - /** - * Sets the value of [created_at] column to a normalized version of the date/time value specified. - * - * @param mixed $v string, integer (timestamp), or DateTime value. - * Empty strings are treated as null. - * @return Newsletter The current object (for fluent API support) - */ - public function setCreatedAt($v) - { - $dt = PropelDateTime::newInstance($v, null, 'DateTime'); - if ($this->created_at !== null || $dt !== null) { - $currentDateAsString = ($this->created_at !== null && $tmpDt = new DateTime($this->created_at)) ? $tmpDt->format('Y-m-d H:i:s') : null; - $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null; - if ($currentDateAsString !== $newDateAsString) { - $this->created_at = $newDateAsString; - $this->modifiedColumns[] = NewsletterPeer::CREATED_AT; - } - } // if either are not null - - - return $this; - } // setCreatedAt() - - /** - * Sets the value of [updated_at] column to a normalized version of the date/time value specified. - * - * @param mixed $v string, integer (timestamp), or DateTime value. - * Empty strings are treated as null. - * @return Newsletter The current object (for fluent API support) - */ - public function setUpdatedAt($v) - { - $dt = PropelDateTime::newInstance($v, null, 'DateTime'); - if ($this->updated_at !== null || $dt !== null) { - $currentDateAsString = ($this->updated_at !== null && $tmpDt = new DateTime($this->updated_at)) ? $tmpDt->format('Y-m-d H:i:s') : null; - $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null; - if ($currentDateAsString !== $newDateAsString) { - $this->updated_at = $newDateAsString; - $this->modifiedColumns[] = NewsletterPeer::UPDATED_AT; - } - } // if either are not null - - - return $this; - } // setUpdatedAt() - - /** - * 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->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->sender_name = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->sender_email = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->model_id = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null; - $this->email_listing = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; - $this->sent_at = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; - $this->created_at = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null; - $this->updated_at = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - $this->postHydrate($row, $startcol, $rehydrate); - - return $startcol + 9; // 9 = NewsletterPeer::NUM_HYDRATE_COLUMNS. - - } catch (Exception $e) { - throw new PropelException("Error populating Newsletter 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() - { - - if ($this->aModel !== null && $this->model_id !== $this->aModel->getId()) { - $this->aModel = null; - } - } // 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(NewsletterPeer::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 = NewsletterPeer::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? - - $this->aModel = null; - $this->collNewsletterRecipientss = null; - - $this->collGroups = null; - } // 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(NewsletterPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $deleteQuery = NewsletterQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()); - $ret = $this->preDelete($con); - // event behavior - EventDispatcherProxy::trigger(array('delete.pre','model.delete.pre'), new ModelEvent($this)); - if ($ret) { - $deleteQuery->delete($con); - $this->postDelete($con); - // event behavior - EventDispatcherProxy::trigger(array('delete.post', 'model.delete.post'), new ModelEvent($this)); - $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(NewsletterPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - // event behavior - EventDispatcherProxy::trigger('model.save.pre', new ModelEvent($this)); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - // timestampable behavior - if (!$this->isColumnModified(NewsletterPeer::CREATED_AT)) { - $this->setCreatedAt(time()); - } - if (!$this->isColumnModified(NewsletterPeer::UPDATED_AT)) { - $this->setUpdatedAt(time()); - } - // event behavior - EventDispatcherProxy::trigger('model.insert.pre', new ModelEvent($this)); - } else { - $ret = $ret && $this->preUpdate($con); - // timestampable behavior - if ($this->isModified() && !$this->isColumnModified(NewsletterPeer::UPDATED_AT)) { - $this->setUpdatedAt(time()); - } - // event behavior - EventDispatcherProxy::trigger(array('update.pre', 'model.update.pre'), new ModelEvent($this)); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - // event behavior - EventDispatcherProxy::trigger('model.insert.post', new ModelEvent($this)); - } else { - $this->postUpdate($con); - // event behavior - EventDispatcherProxy::trigger(array('update.post', 'model.update.post'), new ModelEvent($this)); - } - $this->postSave($con); - // event behavior - EventDispatcherProxy::trigger('model.save.post', new ModelEvent($this)); - NewsletterPeer::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; - - // We call the save method on the following object(s) if they - // were passed to this object by their corresponding set - // method. This object relates to these object(s) by a - // foreign key reference. - - if ($this->aModel !== null) { - if ($this->aModel->isModified() || $this->aModel->isNew()) { - $affectedRows += $this->aModel->save($con); - } - $this->setModel($this->aModel); - } - - if ($this->isNew() || $this->isModified()) { - // persist changes - if ($this->isNew()) { - $this->doInsert($con); - } else { - $this->doUpdate($con); - } - $affectedRows += 1; - $this->resetModified(); - } - - if ($this->groupsScheduledForDeletion !== null) { - if (!$this->groupsScheduledForDeletion->isEmpty()) { - $pks = array(); - $pk = $this->getPrimaryKey(); - foreach ($this->groupsScheduledForDeletion->getPrimaryKeys(false) as $remotePk) { - $pks[] = array($pk, $remotePk); - } - NewsletterRecipientsQuery::create() - ->filterByPrimaryKeys($pks) - ->delete($con); - $this->groupsScheduledForDeletion = null; - } - - foreach ($this->getGroups() as $group) { - if ($group->isModified()) { - $group->save($con); - } - } - } elseif ($this->collGroups) { - foreach ($this->collGroups as $group) { - if ($group->isModified()) { - $group->save($con); - } - } - } - - if ($this->newsletterRecipientssScheduledForDeletion !== null) { - if (!$this->newsletterRecipientssScheduledForDeletion->isEmpty()) { - NewsletterRecipientsQuery::create() - ->filterByPrimaryKeys($this->newsletterRecipientssScheduledForDeletion->getPrimaryKeys(false)) - ->delete($con); - $this->newsletterRecipientssScheduledForDeletion = null; - } - } - - if ($this->collNewsletterRecipientss !== null) { - foreach ($this->collNewsletterRecipientss as $referrerFK) { - if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { - $affectedRows += $referrerFK->save($con); - } - } - } - - $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[] = NewsletterPeer::ID; - if (null !== $this->id) { - throw new PropelException('Cannot insert a value for auto-increment primary key (' . NewsletterPeer::ID . ')'); - } - - // check the columns in natural order for more readable SQL queries - if ($this->isColumnModified(NewsletterPeer::ID)) { - $modifiedColumns[':p' . $index++] = '`id`'; - } - if ($this->isColumnModified(NewsletterPeer::NAME)) { - $modifiedColumns[':p' . $index++] = '`name`'; - } - if ($this->isColumnModified(NewsletterPeer::SENDER_NAME)) { - $modifiedColumns[':p' . $index++] = '`sender_name`'; - } - if ($this->isColumnModified(NewsletterPeer::SENDER_EMAIL)) { - $modifiedColumns[':p' . $index++] = '`sender_email`'; - } - if ($this->isColumnModified(NewsletterPeer::MODEL_ID)) { - $modifiedColumns[':p' . $index++] = '`model_id`'; - } - if ($this->isColumnModified(NewsletterPeer::EMAIL_LISTING)) { - $modifiedColumns[':p' . $index++] = '`email_listing`'; - } - if ($this->isColumnModified(NewsletterPeer::SENT_AT)) { - $modifiedColumns[':p' . $index++] = '`sent_at`'; - } - if ($this->isColumnModified(NewsletterPeer::CREATED_AT)) { - $modifiedColumns[':p' . $index++] = '`created_at`'; - } - if ($this->isColumnModified(NewsletterPeer::UPDATED_AT)) { - $modifiedColumns[':p' . $index++] = '`updated_at`'; - } - - $sql = sprintf( - 'INSERT INTO `nws_newsletter` (%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 '`name`': - $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR); - break; - case '`sender_name`': - $stmt->bindValue($identifier, $this->sender_name, PDO::PARAM_STR); - break; - case '`sender_email`': - $stmt->bindValue($identifier, $this->sender_email, PDO::PARAM_STR); - break; - case '`model_id`': - $stmt->bindValue($identifier, $this->model_id, PDO::PARAM_INT); - break; - case '`email_listing`': - $stmt->bindValue($identifier, $this->email_listing, PDO::PARAM_STR); - break; - case '`sent_at`': - $stmt->bindValue($identifier, $this->sent_at, PDO::PARAM_STR); - break; - case '`created_at`': - $stmt->bindValue($identifier, $this->created_at, PDO::PARAM_STR); - break; - case '`updated_at`': - $stmt->bindValue($identifier, $this->updated_at, 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(); - - - // We call the validate method on the following object(s) if they - // were passed to this object by their corresponding set - // method. This object relates to these object(s) by a - // foreign key reference. - - if ($this->aModel !== null) { - if (!$this->aModel->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aModel->getValidationFailures()); - } - } - - - if (($retval = NewsletterPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - if ($this->collNewsletterRecipientss !== null) { - foreach ($this->collNewsletterRecipientss as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - - $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 = NewsletterPeer::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->getName(); - break; - case 2: - return $this->getSenderName(); - break; - case 3: - return $this->getSenderEmail(); - break; - case 4: - return $this->getModelId(); - break; - case 5: - return $this->getEmailListing(); - break; - case 6: - return $this->getSentAt(); - break; - case 7: - return $this->getCreatedAt(); - break; - case 8: - return $this->getUpdatedAt(); - 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 - * @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false) - { - if (isset($alreadyDumpedObjects['Newsletter'][$this->getPrimaryKey()])) { - return '*RECURSION*'; - } - $alreadyDumpedObjects['Newsletter'][$this->getPrimaryKey()] = true; - $keys = NewsletterPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getId(), - $keys[1] => $this->getName(), - $keys[2] => $this->getSenderName(), - $keys[3] => $this->getSenderEmail(), - $keys[4] => $this->getModelId(), - $keys[5] => $this->getEmailListing(), - $keys[6] => $this->getSentAt(), - $keys[7] => $this->getCreatedAt(), - $keys[8] => $this->getUpdatedAt(), - ); - $virtualColumns = $this->virtualColumns; - foreach ($virtualColumns as $key => $virtualColumn) { - $result[$key] = $virtualColumn; - } - - if ($includeForeignObjects) { - if (null !== $this->aModel) { - $result['Model'] = $this->aModel->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); - } - if (null !== $this->collNewsletterRecipientss) { - $result['NewsletterRecipientss'] = $this->collNewsletterRecipientss->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); - } - } - - 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 = NewsletterPeer::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->setName($value); - break; - case 2: - $this->setSenderName($value); - break; - case 3: - $this->setSenderEmail($value); - break; - case 4: - $this->setModelId($value); - break; - case 5: - $this->setEmailListing($value); - break; - case 6: - $this->setSentAt($value); - break; - case 7: - $this->setCreatedAt($value); - break; - case 8: - $this->setUpdatedAt($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 = NewsletterPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setName($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setSenderName($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setSenderEmail($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setModelId($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setEmailListing($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setSentAt($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setCreatedAt($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setUpdatedAt($arr[$keys[8]]); - } - - /** - * 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(NewsletterPeer::DATABASE_NAME); - - if ($this->isColumnModified(NewsletterPeer::ID)) $criteria->add(NewsletterPeer::ID, $this->id); - if ($this->isColumnModified(NewsletterPeer::NAME)) $criteria->add(NewsletterPeer::NAME, $this->name); - if ($this->isColumnModified(NewsletterPeer::SENDER_NAME)) $criteria->add(NewsletterPeer::SENDER_NAME, $this->sender_name); - if ($this->isColumnModified(NewsletterPeer::SENDER_EMAIL)) $criteria->add(NewsletterPeer::SENDER_EMAIL, $this->sender_email); - if ($this->isColumnModified(NewsletterPeer::MODEL_ID)) $criteria->add(NewsletterPeer::MODEL_ID, $this->model_id); - if ($this->isColumnModified(NewsletterPeer::EMAIL_LISTING)) $criteria->add(NewsletterPeer::EMAIL_LISTING, $this->email_listing); - if ($this->isColumnModified(NewsletterPeer::SENT_AT)) $criteria->add(NewsletterPeer::SENT_AT, $this->sent_at); - if ($this->isColumnModified(NewsletterPeer::CREATED_AT)) $criteria->add(NewsletterPeer::CREATED_AT, $this->created_at); - if ($this->isColumnModified(NewsletterPeer::UPDATED_AT)) $criteria->add(NewsletterPeer::UPDATED_AT, $this->updated_at); - - 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(NewsletterPeer::DATABASE_NAME); - $criteria->add(NewsletterPeer::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 Newsletter (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->setName($this->getName()); - $copyObj->setSenderName($this->getSenderName()); - $copyObj->setSenderEmail($this->getSenderEmail()); - $copyObj->setModelId($this->getModelId()); - $copyObj->setEmailListing($this->getEmailListing()); - $copyObj->setSentAt($this->getSentAt()); - $copyObj->setCreatedAt($this->getCreatedAt()); - $copyObj->setUpdatedAt($this->getUpdatedAt()); - - if ($deepCopy && !$this->startCopy) { - // important: temporarily setNew(false) because this affects the behavior of - // the getter/setter methods for fkey referrer objects. - $copyObj->setNew(false); - // store object hash to prevent cycle - $this->startCopy = true; - - foreach ($this->getNewsletterRecipientss() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addNewsletterRecipients($relObj->copy($deepCopy)); - } - } - - //unflag object copy - $this->startCopy = false; - } // if ($deepCopy) - - 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 Newsletter 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 NewsletterPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new NewsletterPeer(); - } - - return self::$peer; - } - - /** - * Declares an association between this object and a Model object. - * - * @param Model $v - * @return Newsletter The current object (for fluent API support) - * @throws PropelException - */ - public function setModel(Model $v = null) - { - if ($v === null) { - $this->setModelId(NULL); - } else { - $this->setModelId($v->getId()); - } - - $this->aModel = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the Model object, it will not be re-added. - if ($v !== null) { - $v->addNewsletter($this); - } - - - return $this; - } - - - /** - * Get the associated Model object - * - * @param PropelPDO $con Optional Connection object. - * @param $doQuery Executes a query to get the object if required - * @return Model The associated Model object. - * @throws PropelException - */ - public function getModel(PropelPDO $con = null, $doQuery = true) - { - if ($this->aModel === null && ($this->model_id !== null) && $doQuery) { - $this->aModel = ModelQuery::create()->findPk($this->model_id, $con); - /* The following can be used additionally to - guarantee the related object contains a reference - to this object. This level of coupling may, however, be - undesirable since it could result in an only partially populated collection - in the referenced object. - $this->aModel->addNewsletters($this); - */ - } - - return $this->aModel; - } - - - /** - * Initializes a collection based on the name of a relation. - * Avoids crafting an 'init[$relationName]s' method name - * that wouldn't work when StandardEnglishPluralizer is used. - * - * @param string $relationName The name of the relation to initialize - * @return void - */ - public function initRelation($relationName) - { - if ('NewsletterRecipients' == $relationName) { - $this->initNewsletterRecipientss(); - } - } - - /** - * Clears out the collNewsletterRecipientss collection - * - * This does not modify the database; however, it will remove any associated objects, causing - * them to be refetched by subsequent calls to accessor method. - * - * @return Newsletter The current object (for fluent API support) - * @see addNewsletterRecipientss() - */ - public function clearNewsletterRecipientss() - { - $this->collNewsletterRecipientss = null; // important to set this to null since that means it is uninitialized - $this->collNewsletterRecipientssPartial = null; - - return $this; - } - - /** - * reset is the collNewsletterRecipientss collection loaded partially - * - * @return void - */ - public function resetPartialNewsletterRecipientss($v = true) - { - $this->collNewsletterRecipientssPartial = $v; - } - - /** - * Initializes the collNewsletterRecipientss collection. - * - * By default this just sets the collNewsletterRecipientss collection to an empty array (like clearcollNewsletterRecipientss()); - * however, you may wish to override this method in your stub class to provide setting appropriate - * to your application -- for example, setting the initial array to the values stored in database. - * - * @param boolean $overrideExisting If set to true, the method call initializes - * the collection even if it is not empty - * - * @return void - */ - public function initNewsletterRecipientss($overrideExisting = true) - { - if (null !== $this->collNewsletterRecipientss && !$overrideExisting) { - return; - } - $this->collNewsletterRecipientss = new PropelObjectCollection(); - $this->collNewsletterRecipientss->setModel('NewsletterRecipients'); - } - - /** - * Gets an array of NewsletterRecipients objects which contain a foreign key that references this object. - * - * If the $criteria is not null, it is used to always fetch the results from the database. - * Otherwise the results are fetched from the database the first time, then cached. - * Next time the same method is called without $criteria, the cached collection is returned. - * If this Newsletter is new, it will return - * an empty collection or the current collection; the criteria is ignored on a new object. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @return PropelObjectCollection|NewsletterRecipients[] List of NewsletterRecipients objects - * @throws PropelException - */ - public function getNewsletterRecipientss($criteria = null, PropelPDO $con = null) - { - $partial = $this->collNewsletterRecipientssPartial && !$this->isNew(); - if (null === $this->collNewsletterRecipientss || null !== $criteria || $partial) { - if ($this->isNew() && null === $this->collNewsletterRecipientss) { - // return empty collection - $this->initNewsletterRecipientss(); - } else { - $collNewsletterRecipientss = NewsletterRecipientsQuery::create(null, $criteria) - ->filterByNewsletter($this) - ->find($con); - if (null !== $criteria) { - if (false !== $this->collNewsletterRecipientssPartial && count($collNewsletterRecipientss)) { - $this->initNewsletterRecipientss(false); - - foreach ($collNewsletterRecipientss as $obj) { - if (false == $this->collNewsletterRecipientss->contains($obj)) { - $this->collNewsletterRecipientss->append($obj); - } - } - - $this->collNewsletterRecipientssPartial = true; - } - - $collNewsletterRecipientss->getInternalIterator()->rewind(); - - return $collNewsletterRecipientss; - } - - if ($partial && $this->collNewsletterRecipientss) { - foreach ($this->collNewsletterRecipientss as $obj) { - if ($obj->isNew()) { - $collNewsletterRecipientss[] = $obj; - } - } - } - - $this->collNewsletterRecipientss = $collNewsletterRecipientss; - $this->collNewsletterRecipientssPartial = false; - } - } - - return $this->collNewsletterRecipientss; - } - - /** - * Sets a collection of NewsletterRecipients objects related by a one-to-many relationship - * to the current object. - * It will also schedule objects for deletion based on a diff between old objects (aka persisted) - * and new objects from the given Propel collection. - * - * @param PropelCollection $newsletterRecipientss A Propel collection. - * @param PropelPDO $con Optional connection object - * @return Newsletter The current object (for fluent API support) - */ - public function setNewsletterRecipientss(PropelCollection $newsletterRecipientss, PropelPDO $con = null) - { - $newsletterRecipientssToDelete = $this->getNewsletterRecipientss(new Criteria(), $con)->diff($newsletterRecipientss); - - - //since at least one column in the foreign key is at the same time a PK - //we can not just set a PK to NULL in the lines below. We have to store - //a backup of all values, so we are able to manipulate these items based on the onDelete value later. - $this->newsletterRecipientssScheduledForDeletion = clone $newsletterRecipientssToDelete; - - foreach ($newsletterRecipientssToDelete as $newsletterRecipientsRemoved) { - $newsletterRecipientsRemoved->setNewsletter(null); - } - - $this->collNewsletterRecipientss = null; - foreach ($newsletterRecipientss as $newsletterRecipients) { - $this->addNewsletterRecipients($newsletterRecipients); - } - - $this->collNewsletterRecipientss = $newsletterRecipientss; - $this->collNewsletterRecipientssPartial = false; - - return $this; - } - - /** - * Returns the number of related NewsletterRecipients objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related NewsletterRecipients objects. - * @throws PropelException - */ - public function countNewsletterRecipientss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - $partial = $this->collNewsletterRecipientssPartial && !$this->isNew(); - if (null === $this->collNewsletterRecipientss || null !== $criteria || $partial) { - if ($this->isNew() && null === $this->collNewsletterRecipientss) { - return 0; - } - - if ($partial && !$criteria) { - return count($this->getNewsletterRecipientss()); - } - $query = NewsletterRecipientsQuery::create(null, $criteria); - if ($distinct) { - $query->distinct(); - } - - return $query - ->filterByNewsletter($this) - ->count($con); - } - - return count($this->collNewsletterRecipientss); - } - - /** - * Method called to associate a NewsletterRecipients object to this object - * through the NewsletterRecipients foreign key attribute. - * - * @param NewsletterRecipients $l NewsletterRecipients - * @return Newsletter The current object (for fluent API support) - */ - public function addNewsletterRecipients(NewsletterRecipients $l) - { - if ($this->collNewsletterRecipientss === null) { - $this->initNewsletterRecipientss(); - $this->collNewsletterRecipientssPartial = true; - } - - if (!in_array($l, $this->collNewsletterRecipientss->getArrayCopy(), true)) { // only add it if the **same** object is not already associated - $this->doAddNewsletterRecipients($l); - - if ($this->newsletterRecipientssScheduledForDeletion and $this->newsletterRecipientssScheduledForDeletion->contains($l)) { - $this->newsletterRecipientssScheduledForDeletion->remove($this->newsletterRecipientssScheduledForDeletion->search($l)); - } - } - - return $this; - } - - /** - * @param NewsletterRecipients $newsletterRecipients The newsletterRecipients object to add. - */ - protected function doAddNewsletterRecipients($newsletterRecipients) - { - $this->collNewsletterRecipientss[]= $newsletterRecipients; - $newsletterRecipients->setNewsletter($this); - } - - /** - * @param NewsletterRecipients $newsletterRecipients The newsletterRecipients object to remove. - * @return Newsletter The current object (for fluent API support) - */ - public function removeNewsletterRecipients($newsletterRecipients) - { - if ($this->getNewsletterRecipientss()->contains($newsletterRecipients)) { - $this->collNewsletterRecipientss->remove($this->collNewsletterRecipientss->search($newsletterRecipients)); - if (null === $this->newsletterRecipientssScheduledForDeletion) { - $this->newsletterRecipientssScheduledForDeletion = clone $this->collNewsletterRecipientss; - $this->newsletterRecipientssScheduledForDeletion->clear(); - } - $this->newsletterRecipientssScheduledForDeletion[]= clone $newsletterRecipients; - $newsletterRecipients->setNewsletter(null); - } - - return $this; - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this Newsletter is new, it will return - * an empty collection; or if this Newsletter has previously - * been saved, it will retrieve related NewsletterRecipientss from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in Newsletter. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelObjectCollection|NewsletterRecipients[] List of NewsletterRecipients objects - */ - public function getNewsletterRecipientssJoinGroup($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = NewsletterRecipientsQuery::create(null, $criteria); - $query->joinWith('Group', $join_behavior); - - return $this->getNewsletterRecipientss($query, $con); - } - - /** - * Clears out the collGroups collection - * - * This does not modify the database; however, it will remove any associated objects, causing - * them to be refetched by subsequent calls to accessor method. - * - * @return Newsletter The current object (for fluent API support) - * @see addGroups() - */ - public function clearGroups() - { - $this->collGroups = null; // important to set this to null since that means it is uninitialized - $this->collGroupsPartial = null; - - return $this; - } - - /** - * Initializes the collGroups collection. - * - * By default this just sets the collGroups collection to an empty collection (like clearGroups()); - * however, you may wish to override this method in your stub class to provide setting appropriate - * to your application -- for example, setting the initial array to the values stored in database. - * - * @return void - */ - public function initGroups() - { - $this->collGroups = new PropelObjectCollection(); - $this->collGroups->setModel('Group'); - } - - /** - * Gets a collection of Group objects related by a many-to-many relationship - * to the current object by way of the nws_newsletter_recipients cross-reference table. - * - * If the $criteria is not null, it is used to always fetch the results from the database. - * Otherwise the results are fetched from the database the first time, then cached. - * Next time the same method is called without $criteria, the cached collection is returned. - * If this Newsletter is new, it will return - * an empty collection or the current collection; the criteria is ignored on a new object. - * - * @param Criteria $criteria Optional query object to filter the query - * @param PropelPDO $con Optional connection object - * - * @return PropelObjectCollection|Group[] List of Group objects - */ - public function getGroups($criteria = null, PropelPDO $con = null) - { - if (null === $this->collGroups || null !== $criteria) { - if ($this->isNew() && null === $this->collGroups) { - // return empty collection - $this->initGroups(); - } else { - $collGroups = GroupQuery::create(null, $criteria) - ->filterByNewsletter($this) - ->find($con); - if (null !== $criteria) { - return $collGroups; - } - $this->collGroups = $collGroups; - } - } - - return $this->collGroups; - } - - /** - * Sets a collection of Group objects related by a many-to-many relationship - * to the current object by way of the nws_newsletter_recipients cross-reference table. - * It will also schedule objects for deletion based on a diff between old objects (aka persisted) - * and new objects from the given Propel collection. - * - * @param PropelCollection $groups A Propel collection. - * @param PropelPDO $con Optional connection object - * @return Newsletter The current object (for fluent API support) - */ - public function setGroups(PropelCollection $groups, PropelPDO $con = null) - { - $this->clearGroups(); - $currentGroups = $this->getGroups(null, $con); - - $this->groupsScheduledForDeletion = $currentGroups->diff($groups); - - foreach ($groups as $group) { - if (!$currentGroups->contains($group)) { - $this->doAddGroup($group); - } - } - - $this->collGroups = $groups; - - return $this; - } - - /** - * Gets the number of Group objects related by a many-to-many relationship - * to the current object by way of the nws_newsletter_recipients cross-reference table. - * - * @param Criteria $criteria Optional query object to filter the query - * @param boolean $distinct Set to true to force count distinct - * @param PropelPDO $con Optional connection object - * - * @return int the number of related Group objects - */ - public function countGroups($criteria = null, $distinct = false, PropelPDO $con = null) - { - if (null === $this->collGroups || null !== $criteria) { - if ($this->isNew() && null === $this->collGroups) { - return 0; - } else { - $query = GroupQuery::create(null, $criteria); - if ($distinct) { - $query->distinct(); - } - - return $query - ->filterByNewsletter($this) - ->count($con); - } - } else { - return count($this->collGroups); - } - } - - /** - * Associate a Group object to this object - * through the nws_newsletter_recipients cross reference table. - * - * @param Group $group The NewsletterRecipients object to relate - * @return Newsletter The current object (for fluent API support) - */ - public function addGroup(Group $group) - { - if ($this->collGroups === null) { - $this->initGroups(); - } - - if (!$this->collGroups->contains($group)) { // only add it if the **same** object is not already associated - $this->doAddGroup($group); - $this->collGroups[] = $group; - - if ($this->groupsScheduledForDeletion and $this->groupsScheduledForDeletion->contains($group)) { - $this->groupsScheduledForDeletion->remove($this->groupsScheduledForDeletion->search($group)); - } - } - - return $this; - } - - /** - * @param Group $group The group object to add. - */ - protected function doAddGroup(Group $group) - { - // set the back reference to this object directly as using provided method either results - // in endless loop or in multiple relations - if (!$group->getNewsletters()->contains($this)) { $newsletterRecipients = new NewsletterRecipients(); - $newsletterRecipients->setGroup($group); - $this->addNewsletterRecipients($newsletterRecipients); - - $foreignCollection = $group->getNewsletters(); - $foreignCollection[] = $this; - } - } - - /** - * Remove a Group object to this object - * through the nws_newsletter_recipients cross reference table. - * - * @param Group $group The NewsletterRecipients object to relate - * @return Newsletter The current object (for fluent API support) - */ - public function removeGroup(Group $group) - { - if ($this->getGroups()->contains($group)) { - $this->collGroups->remove($this->collGroups->search($group)); - if (null === $this->groupsScheduledForDeletion) { - $this->groupsScheduledForDeletion = clone $this->collGroups; - $this->groupsScheduledForDeletion->clear(); - } - $this->groupsScheduledForDeletion[]= $group; - } - - return $this; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->name = null; - $this->sender_name = null; - $this->sender_email = null; - $this->model_id = null; - $this->email_listing = null; - $this->sent_at = null; - $this->created_at = null; - $this->updated_at = 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; - if ($this->collNewsletterRecipientss) { - foreach ($this->collNewsletterRecipientss as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collGroups) { - foreach ($this->collGroups as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->aModel instanceof Persistent) { - $this->aModel->clearAllReferences($deep); - } - - $this->alreadyInClearAllReferencesDeep = false; - } // if ($deep) - - if ($this->collNewsletterRecipientss instanceof PropelCollection) { - $this->collNewsletterRecipientss->clearIterator(); - } - $this->collNewsletterRecipientss = null; - if ($this->collGroups instanceof PropelCollection) { - $this->collGroups->clearIterator(); - } - $this->collGroups = null; - $this->aModel = null; - } - - /** - * return the string representation of this object - * - * @return string - */ - public function __toString() - { - return (string) $this->exportTo(NewsletterPeer::DEFAULT_STRING_FORMAT); - } - - /** - * return true is the object is in saving state - * - * @return boolean - */ - public function isAlreadyInSave() - { - return $this->alreadyInSave; - } - - // timestampable behavior - - /** - * Mark the current object so that the update date doesn't get updated during next save - * - * @return Newsletter The current object (for fluent API support) - */ - public function keepUpdateDateUnchanged() - { - $this->modifiedColumns[] = NewsletterPeer::UPDATED_AT; - - return $this; - } - - // event behavior - public function preCommit(\PropelPDO $con = null){} - public function preCommitSave(\PropelPDO $con = null){} - public function preCommitDelete(\PropelPDO $con = null){} - public function preCommitUpdate(\PropelPDO $con = null){} - public function preCommitInsert(\PropelPDO $con = null){} - public function preRollback(\PropelPDO $con = null){} - public function preRollbackSave(\PropelPDO $con = null){} - public function preRollbackDelete(\PropelPDO $con = null){} - public function preRollbackUpdate(\PropelPDO $con = null){} - public function preRollbackInsert(\PropelPDO $con = null){} - -} diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletterPeer.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletterPeer.php deleted file mode 100644 index b920c3f..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletterPeer.php +++ /dev/null @@ -1,1053 +0,0 @@ - array ('Id', 'Name', 'SenderName', 'SenderEmail', 'ModelId', 'EmailListing', 'SentAt', 'CreatedAt', 'UpdatedAt', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'name', 'senderName', 'senderEmail', 'modelId', 'emailListing', 'sentAt', 'createdAt', 'updatedAt', ), - BasePeer::TYPE_COLNAME => array (NewsletterPeer::ID, NewsletterPeer::NAME, NewsletterPeer::SENDER_NAME, NewsletterPeer::SENDER_EMAIL, NewsletterPeer::MODEL_ID, NewsletterPeer::EMAIL_LISTING, NewsletterPeer::SENT_AT, NewsletterPeer::CREATED_AT, NewsletterPeer::UPDATED_AT, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'SENDER_NAME', 'SENDER_EMAIL', 'MODEL_ID', 'EMAIL_LISTING', 'SENT_AT', 'CREATED_AT', 'UPDATED_AT', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'sender_name', 'sender_email', 'model_id', 'email_listing', 'sent_at', 'created_at', 'updated_at', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, ) - ); - - /** - * holds an array of keys for quick access to the fieldnames array - * - * first dimension keys are the type constants - * e.g. NewsletterPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 - */ - protected static $fieldKeys = array ( - BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Name' => 1, 'SenderName' => 2, 'SenderEmail' => 3, 'ModelId' => 4, 'EmailListing' => 5, 'SentAt' => 6, 'CreatedAt' => 7, 'UpdatedAt' => 8, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'name' => 1, 'senderName' => 2, 'senderEmail' => 3, 'modelId' => 4, 'emailListing' => 5, 'sentAt' => 6, 'createdAt' => 7, 'updatedAt' => 8, ), - BasePeer::TYPE_COLNAME => array (NewsletterPeer::ID => 0, NewsletterPeer::NAME => 1, NewsletterPeer::SENDER_NAME => 2, NewsletterPeer::SENDER_EMAIL => 3, NewsletterPeer::MODEL_ID => 4, NewsletterPeer::EMAIL_LISTING => 5, NewsletterPeer::SENT_AT => 6, NewsletterPeer::CREATED_AT => 7, NewsletterPeer::UPDATED_AT => 8, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'SENDER_NAME' => 2, 'SENDER_EMAIL' => 3, 'MODEL_ID' => 4, 'EMAIL_LISTING' => 5, 'SENT_AT' => 6, 'CREATED_AT' => 7, 'UPDATED_AT' => 8, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'sender_name' => 2, 'sender_email' => 3, 'model_id' => 4, 'email_listing' => 5, 'sent_at' => 6, 'created_at' => 7, 'updated_at' => 8, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, ) - ); - - /** - * 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 = NewsletterPeer::getFieldNames($toType); - $key = isset(NewsletterPeer::$fieldKeys[$fromType][$name]) ? NewsletterPeer::$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(NewsletterPeer::$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, NewsletterPeer::$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 NewsletterPeer::$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. NewsletterPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(NewsletterPeer::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(NewsletterPeer::ID); - $criteria->addSelectColumn(NewsletterPeer::NAME); - $criteria->addSelectColumn(NewsletterPeer::SENDER_NAME); - $criteria->addSelectColumn(NewsletterPeer::SENDER_EMAIL); - $criteria->addSelectColumn(NewsletterPeer::MODEL_ID); - $criteria->addSelectColumn(NewsletterPeer::EMAIL_LISTING); - $criteria->addSelectColumn(NewsletterPeer::SENT_AT); - $criteria->addSelectColumn(NewsletterPeer::CREATED_AT); - $criteria->addSelectColumn(NewsletterPeer::UPDATED_AT); - } else { - $criteria->addSelectColumn($alias . '.id'); - $criteria->addSelectColumn($alias . '.name'); - $criteria->addSelectColumn($alias . '.sender_name'); - $criteria->addSelectColumn($alias . '.sender_email'); - $criteria->addSelectColumn($alias . '.model_id'); - $criteria->addSelectColumn($alias . '.email_listing'); - $criteria->addSelectColumn($alias . '.sent_at'); - $criteria->addSelectColumn($alias . '.created_at'); - $criteria->addSelectColumn($alias . '.updated_at'); - } - } - - /** - * 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(NewsletterPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - NewsletterPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count - $criteria->setDbName(NewsletterPeer::DATABASE_NAME); // Set the correct dbName - - if ($con === null) { - $con = Propel::getConnection(NewsletterPeer::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 Newsletter - * @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 = NewsletterPeer::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 NewsletterPeer::populateObjects(NewsletterPeer::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(NewsletterPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - NewsletterPeer::addSelectColumns($criteria); - } - - // Set the correct dbName - $criteria->setDbName(NewsletterPeer::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 Newsletter $obj A Newsletter 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 - NewsletterPeer::$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 Newsletter 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 Newsletter) { - $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 Newsletter object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value,true))); - throw $e; - } - - unset(NewsletterPeer::$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 Newsletter 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(NewsletterPeer::$instances[$key])) { - return NewsletterPeer::$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 (NewsletterPeer::$instances as $instance) { - $instance->clearAllReferences(true); - } - } - NewsletterPeer::$instances = array(); - } - - /** - * Method to invalidate the instance pool of all tables related to nws_newsletter - * 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 = NewsletterPeer::getOMClass(); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = NewsletterPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = NewsletterPeer::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; - NewsletterPeer::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 (Newsletter object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = NewsletterPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = NewsletterPeer::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 + NewsletterPeer::NUM_HYDRATE_COLUMNS; - } else { - $cls = NewsletterPeer::getOMClass($row, $startcol); - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - NewsletterPeer::addInstanceToPool($obj, $key); - } - - return array($obj, $col); - } - - - /** - * Returns the number of rows matching criteria, joining the related Model table - * - * @param Criteria $criteria - * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead. - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return int Number of matching rows. - */ - public static function doCountJoinModel(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - // we're going to 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(NewsletterPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - NewsletterPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count - - // Set the correct dbName - $criteria->setDbName(NewsletterPeer::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(NewsletterPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(NewsletterPeer::MODEL_ID, ModelPeer::ID, $join_behavior); - - $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 a collection of Newsletter objects pre-filled with their Model objects. - * @param Criteria $criteria - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return array Array of Newsletter objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinModel(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(NewsletterPeer::DATABASE_NAME); - } - - NewsletterPeer::addSelectColumns($criteria); - $startcol = NewsletterPeer::NUM_HYDRATE_COLUMNS; - ModelPeer::addSelectColumns($criteria); - - $criteria->addJoin(NewsletterPeer::MODEL_ID, ModelPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = NewsletterPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = NewsletterPeer::getInstanceFromPool($key1))) { - // We no longer rehydrate the object, since this can cause data loss. - // See http://www.propelorm.org/ticket/509 - // $obj1->hydrate($row, 0, true); // rehydrate - } else { - - $cls = NewsletterPeer::getOMClass(); - - $obj1 = new $cls(); - $obj1->hydrate($row); - NewsletterPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = ModelPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = ModelPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $omClass = ModelPeer::getOMClass($row, $startcol); - $cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - ModelPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (Newsletter) to $obj2 (Model) - $obj2->addNewsletter($obj1); - - } // if joined row was not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - - return $results; - } - - - /** - * Returns the number of rows matching criteria, joining all related tables - * - * @param Criteria $criteria - * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead. - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return int Number of matching rows. - */ - public static function doCountJoinAll(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - // we're going to 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(NewsletterPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - NewsletterPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count - - // Set the correct dbName - $criteria->setDbName(NewsletterPeer::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(NewsletterPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(NewsletterPeer::MODEL_ID, ModelPeer::ID, $join_behavior); - - $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 a collection of Newsletter objects pre-filled with all related objects. - * - * @param Criteria $criteria - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return array Array of Newsletter objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(NewsletterPeer::DATABASE_NAME); - } - - NewsletterPeer::addSelectColumns($criteria); - $startcol2 = NewsletterPeer::NUM_HYDRATE_COLUMNS; - - ModelPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + ModelPeer::NUM_HYDRATE_COLUMNS; - - $criteria->addJoin(NewsletterPeer::MODEL_ID, ModelPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = NewsletterPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = NewsletterPeer::getInstanceFromPool($key1))) { - // We no longer rehydrate the object, since this can cause data loss. - // See http://www.propelorm.org/ticket/509 - // $obj1->hydrate($row, 0, true); // rehydrate - } else { - $cls = NewsletterPeer::getOMClass(); - - $obj1 = new $cls(); - $obj1->hydrate($row); - NewsletterPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined Model rows - - $key2 = ModelPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = ModelPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $omClass = ModelPeer::getOMClass($row, $startcol2); - $cls = substr('.'.$omClass, strrpos('.'.$omClass, '.') + 1); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - ModelPeer::addInstanceToPool($obj2, $key2); - } // if obj2 loaded - - // Add the $obj1 (Newsletter) to the collection in $obj2 (Model) - $obj2->addNewsletter($obj1); - } // if joined row not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - - return $results; - } - - /** - * 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(NewsletterPeer::DATABASE_NAME)->getTable(NewsletterPeer::TABLE_NAME); - } - - /** - * Add a TableMap instance to the database for this peer class. - */ - public static function buildTableMap() - { - $dbMap = Propel::getDatabaseMap(BaseNewsletterPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseNewsletterPeer::TABLE_NAME)) { - $dbMap->addTableObject(new \Trinity\Bundle\NewsletterBundle\Model\map\NewsletterTableMap()); - } - } - - /** - * The class that the Peer will make instances of. - * - * - * @return string ClassName - */ - public static function getOMClass($row = 0, $colnum = 0) - { - - $event = new DetectOMClassEvent(NewsletterPeer::OM_CLASS); - EventDispatcherProxy::trigger('om.detect', $event); - if($event->isDetected()){ - return $event->getDetectedClass(); - } - - return NewsletterPeer::OM_CLASS; - } - - /** - * Performs an INSERT on the database, given a Newsletter or Criteria object. - * - * @param mixed $values Criteria or Newsletter 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(NewsletterPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from Newsletter object - } - - if ($criteria->containsKey(NewsletterPeer::ID) && $criteria->keyContainsValue(NewsletterPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.NewsletterPeer::ID.')'); - } - - - // Set the correct dbName - $criteria->setDbName(NewsletterPeer::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 Newsletter or Criteria object. - * - * @param mixed $values Criteria or Newsletter 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(NewsletterPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(NewsletterPeer::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(NewsletterPeer::ID); - $value = $criteria->remove(NewsletterPeer::ID); - if ($value) { - $selectCriteria->add(NewsletterPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(NewsletterPeer::TABLE_NAME); - } - - } else { // $values is Newsletter object - $criteria = $values->buildCriteria(); // gets full criteria - $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s) - } - - // set the correct dbName - $criteria->setDbName(NewsletterPeer::DATABASE_NAME); - - return BasePeer::doUpdate($selectCriteria, $criteria, $con); - } - - /** - * Deletes all rows from the nws_newsletter 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(NewsletterPeer::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(NewsletterPeer::TABLE_NAME, $con, NewsletterPeer::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). - NewsletterPeer::clearInstancePool(); - NewsletterPeer::clearRelatedInstancePool(); - $con->commit(); - - return $affectedRows; - } catch (Exception $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs a DELETE on the database, given a Newsletter or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or Newsletter 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(NewsletterPeer::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. - NewsletterPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof Newsletter) { // it's a model object - // invalidate the cache for this single object - NewsletterPeer::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(NewsletterPeer::DATABASE_NAME); - $criteria->add(NewsletterPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - NewsletterPeer::removeInstanceFromPool($singleval); - } - } - - // Set the correct dbName - $criteria->setDbName(NewsletterPeer::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); - NewsletterPeer::clearRelatedInstancePool(); - $con->commit(); - - return $affectedRows; - } catch (Exception $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given Newsletter 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 Newsletter $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(NewsletterPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(NewsletterPeer::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(NewsletterPeer::DATABASE_NAME, NewsletterPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return Newsletter - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = NewsletterPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(NewsletterPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(NewsletterPeer::DATABASE_NAME); - $criteria->add(NewsletterPeer::ID, $pk); - - $v = NewsletterPeer::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 Newsletter[] - * @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(NewsletterPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(NewsletterPeer::DATABASE_NAME); - $criteria->add(NewsletterPeer::ID, $pks, Criteria::IN); - $objs = NewsletterPeer::doSelect($criteria, $con); - } - - return $objs; - } - -} // BaseNewsletterPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseNewsletterPeer::buildTableMap(); - -EventDispatcherProxy::trigger(array('construct','peer.construct'), new PeerEvent('Trinity\Bundle\NewsletterBundle\Model\om\BaseNewsletterPeer')); diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletterQuery.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletterQuery.php deleted file mode 100644 index a197258..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletterQuery.php +++ /dev/null @@ -1,931 +0,0 @@ -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 Newsletter|Newsletter[]|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ($key === null) { - return null; - } - if ((null !== ($obj = NewsletterPeer::getInstanceFromPool((string) $key))) && !$this->formatter) { - // the object is already in the instance pool - return $obj; - } - if ($con === null) { - $con = Propel::getConnection(NewsletterPeer::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 Newsletter 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 Newsletter A model object, or null if the key is not found - * @throws PropelException - */ - protected function findPkSimple($key, $con) - { - $sql = 'SELECT `id`, `name`, `sender_name`, `sender_email`, `model_id`, `email_listing`, `sent_at`, `created_at`, `updated_at` FROM `nws_newsletter` 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 = NewsletterPeer::getOMClass(); - $obj = new $cls; - $obj->hydrate($row); - NewsletterPeer::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 Newsletter|Newsletter[]|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|Newsletter[]|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 NewsletterQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - - return $this->addUsingAlias(NewsletterPeer::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 NewsletterQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - - return $this->addUsingAlias(NewsletterPeer::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 NewsletterQuery 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(NewsletterPeer::ID, $id['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($id['max'])) { - $this->addUsingAlias(NewsletterPeer::ID, $id['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(NewsletterPeer::ID, $id, $comparison); - } - - /** - * Filter the query on the name column - * - * Example usage: - * - * $query->filterByName('fooValue'); // WHERE name = 'fooValue' - * $query->filterByName('%fooValue%'); // WHERE name LIKE '%fooValue%' - * - * - * @param string $name 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 NewsletterQuery The current query, for fluid interface - */ - public function filterByName($name = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($name)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $name)) { - $name = str_replace('*', '%', $name); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(NewsletterPeer::NAME, $name, $comparison); - } - - /** - * Filter the query on the sender_name column - * - * Example usage: - * - * $query->filterBySenderName('fooValue'); // WHERE sender_name = 'fooValue' - * $query->filterBySenderName('%fooValue%'); // WHERE sender_name LIKE '%fooValue%' - * - * - * @param string $senderName 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 NewsletterQuery The current query, for fluid interface - */ - public function filterBySenderName($senderName = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($senderName)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $senderName)) { - $senderName = str_replace('*', '%', $senderName); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(NewsletterPeer::SENDER_NAME, $senderName, $comparison); - } - - /** - * Filter the query on the sender_email column - * - * Example usage: - * - * $query->filterBySenderEmail('fooValue'); // WHERE sender_email = 'fooValue' - * $query->filterBySenderEmail('%fooValue%'); // WHERE sender_email LIKE '%fooValue%' - * - * - * @param string $senderEmail 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 NewsletterQuery The current query, for fluid interface - */ - public function filterBySenderEmail($senderEmail = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($senderEmail)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $senderEmail)) { - $senderEmail = str_replace('*', '%', $senderEmail); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(NewsletterPeer::SENDER_EMAIL, $senderEmail, $comparison); - } - - /** - * Filter the query on the model_id column - * - * Example usage: - * - * $query->filterByModelId(1234); // WHERE model_id = 1234 - * $query->filterByModelId(array(12, 34)); // WHERE model_id IN (12, 34) - * $query->filterByModelId(array('min' => 12)); // WHERE model_id >= 12 - * $query->filterByModelId(array('max' => 12)); // WHERE model_id <= 12 - * - * - * @see filterByModel() - * - * @param mixed $modelId 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 NewsletterQuery The current query, for fluid interface - */ - public function filterByModelId($modelId = null, $comparison = null) - { - if (is_array($modelId)) { - $useMinMax = false; - if (isset($modelId['min'])) { - $this->addUsingAlias(NewsletterPeer::MODEL_ID, $modelId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($modelId['max'])) { - $this->addUsingAlias(NewsletterPeer::MODEL_ID, $modelId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(NewsletterPeer::MODEL_ID, $modelId, $comparison); - } - - /** - * Filter the query on the email_listing column - * - * Example usage: - * - * $query->filterByEmailListing('fooValue'); // WHERE email_listing = 'fooValue' - * $query->filterByEmailListing('%fooValue%'); // WHERE email_listing LIKE '%fooValue%' - * - * - * @param string $emailListing 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 NewsletterQuery The current query, for fluid interface - */ - public function filterByEmailListing($emailListing = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($emailListing)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $emailListing)) { - $emailListing = str_replace('*', '%', $emailListing); - $comparison = Criteria::LIKE; - } - } - - return $this->addUsingAlias(NewsletterPeer::EMAIL_LISTING, $emailListing, $comparison); - } - - /** - * Filter the query on the sent_at column - * - * Example usage: - * - * $query->filterBySentAt('2011-03-14'); // WHERE sent_at = '2011-03-14' - * $query->filterBySentAt('now'); // WHERE sent_at = '2011-03-14' - * $query->filterBySentAt(array('max' => 'yesterday')); // WHERE sent_at < '2011-03-13' - * - * - * @param mixed $sentAt The value to use as filter. - * Values can be integers (unix timestamps), DateTime objects, or strings. - * Empty strings are treated as NULL. - * 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 NewsletterQuery The current query, for fluid interface - */ - public function filterBySentAt($sentAt = null, $comparison = null) - { - if (is_array($sentAt)) { - $useMinMax = false; - if (isset($sentAt['min'])) { - $this->addUsingAlias(NewsletterPeer::SENT_AT, $sentAt['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($sentAt['max'])) { - $this->addUsingAlias(NewsletterPeer::SENT_AT, $sentAt['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(NewsletterPeer::SENT_AT, $sentAt, $comparison); - } - - /** - * Filter the query on the created_at column - * - * Example usage: - * - * $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14' - * $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14' - * $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at < '2011-03-13' - * - * - * @param mixed $createdAt The value to use as filter. - * Values can be integers (unix timestamps), DateTime objects, or strings. - * Empty strings are treated as NULL. - * 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 NewsletterQuery The current query, for fluid interface - */ - public function filterByCreatedAt($createdAt = null, $comparison = null) - { - if (is_array($createdAt)) { - $useMinMax = false; - if (isset($createdAt['min'])) { - $this->addUsingAlias(NewsletterPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($createdAt['max'])) { - $this->addUsingAlias(NewsletterPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(NewsletterPeer::CREATED_AT, $createdAt, $comparison); - } - - /** - * Filter the query on the updated_at column - * - * Example usage: - * - * $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14' - * $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14' - * $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at < '2011-03-13' - * - * - * @param mixed $updatedAt The value to use as filter. - * Values can be integers (unix timestamps), DateTime objects, or strings. - * Empty strings are treated as NULL. - * 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 NewsletterQuery The current query, for fluid interface - */ - public function filterByUpdatedAt($updatedAt = null, $comparison = null) - { - if (is_array($updatedAt)) { - $useMinMax = false; - if (isset($updatedAt['min'])) { - $this->addUsingAlias(NewsletterPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($updatedAt['max'])) { - $this->addUsingAlias(NewsletterPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(NewsletterPeer::UPDATED_AT, $updatedAt, $comparison); - } - - /** - * Filter the query by a related Model object - * - * @param Model|PropelObjectCollection $model The related object(s) to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return NewsletterQuery The current query, for fluid interface - * @throws PropelException - if the provided filter is invalid. - */ - public function filterByModel($model, $comparison = null) - { - if ($model instanceof Model) { - return $this - ->addUsingAlias(NewsletterPeer::MODEL_ID, $model->getId(), $comparison); - } elseif ($model instanceof PropelObjectCollection) { - if (null === $comparison) { - $comparison = Criteria::IN; - } - - return $this - ->addUsingAlias(NewsletterPeer::MODEL_ID, $model->toKeyValue('PrimaryKey', 'Id'), $comparison); - } else { - throw new PropelException('filterByModel() only accepts arguments of type Model or PropelCollection'); - } - } - - /** - * Adds a JOIN clause to the query using the Model relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return NewsletterQuery The current query, for fluid interface - */ - public function joinModel($relationAlias = null, $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('Model'); - - // create a ModelJoin object for this join - $join = new ModelJoin(); - $join->setJoinType($joinType); - $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); - if ($previousJoin = $this->getPreviousJoin()) { - $join->setPreviousJoin($previousJoin); - } - - // add the ModelJoin to the current object - if ($relationAlias) { - $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); - $this->addJoinObject($join, $relationAlias); - } else { - $this->addJoinObject($join, 'Model'); - } - - return $this; - } - - /** - * Use the Model relation Model object - * - * @see useQuery() - * - * @param string $relationAlias optional alias for the relation, - * to be used as main alias in the secondary query - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return \Trinity\Bundle\NewsletterBundle\Model\ModelQuery A secondary query class using the current class as primary query - */ - public function useModelQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinModel($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'Model', '\Trinity\Bundle\NewsletterBundle\Model\ModelQuery'); - } - - /** - * Filter the query by a related NewsletterRecipients object - * - * @param NewsletterRecipients|PropelObjectCollection $newsletterRecipients the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return NewsletterQuery The current query, for fluid interface - * @throws PropelException - if the provided filter is invalid. - */ - public function filterByNewsletterRecipients($newsletterRecipients, $comparison = null) - { - if ($newsletterRecipients instanceof NewsletterRecipients) { - return $this - ->addUsingAlias(NewsletterPeer::ID, $newsletterRecipients->getNwsNewsletterId(), $comparison); - } elseif ($newsletterRecipients instanceof PropelObjectCollection) { - return $this - ->useNewsletterRecipientsQuery() - ->filterByPrimaryKeys($newsletterRecipients->getPrimaryKeys()) - ->endUse(); - } else { - throw new PropelException('filterByNewsletterRecipients() only accepts arguments of type NewsletterRecipients or PropelCollection'); - } - } - - /** - * Adds a JOIN clause to the query using the NewsletterRecipients relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return NewsletterQuery The current query, for fluid interface - */ - public function joinNewsletterRecipients($relationAlias = null, $joinType = Criteria::INNER_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('NewsletterRecipients'); - - // create a ModelJoin object for this join - $join = new ModelJoin(); - $join->setJoinType($joinType); - $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); - if ($previousJoin = $this->getPreviousJoin()) { - $join->setPreviousJoin($previousJoin); - } - - // add the ModelJoin to the current object - if ($relationAlias) { - $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); - $this->addJoinObject($join, $relationAlias); - } else { - $this->addJoinObject($join, 'NewsletterRecipients'); - } - - return $this; - } - - /** - * Use the NewsletterRecipients relation NewsletterRecipients object - * - * @see useQuery() - * - * @param string $relationAlias optional alias for the relation, - * to be used as main alias in the secondary query - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return \Trinity\Bundle\NewsletterBundle\Model\NewsletterRecipientsQuery A secondary query class using the current class as primary query - */ - public function useNewsletterRecipientsQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) - { - return $this - ->joinNewsletterRecipients($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'NewsletterRecipients', '\Trinity\Bundle\NewsletterBundle\Model\NewsletterRecipientsQuery'); - } - - /** - * Filter the query by a related Group object - * using the nws_newsletter_recipients table as cross reference - * - * @param Group $group the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return NewsletterQuery The current query, for fluid interface - */ - public function filterByGroup($group, $comparison = Criteria::EQUAL) - { - return $this - ->useNewsletterRecipientsQuery() - ->filterByGroup($group, $comparison) - ->endUse(); - } - - /** - * Exclude object from result - * - * @param Newsletter $newsletter Object to remove from the list of results - * - * @return NewsletterQuery The current query, for fluid interface - */ - public function prune($newsletter = null) - { - if ($newsletter) { - $this->addUsingAlias(NewsletterPeer::ID, $newsletter->getId(), Criteria::NOT_EQUAL); - } - - return $this; - } - - /** - * Code to execute before every SELECT statement - * - * @param PropelPDO $con The connection object used by the query - */ - protected function basePreSelect(PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger('query.select.pre', new QueryEvent($this)); - - return $this->preSelect($con); - } - - /** - * Code to execute before every DELETE statement - * - * @param PropelPDO $con The connection object used by the query - */ - protected function basePreDelete(PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger(array('delete.pre','query.delete.pre'), new QueryEvent($this)); - - return $this->preDelete($con); - } - - /** - * Code to execute after every DELETE statement - * - * @param int $affectedRows the number of deleted rows - * @param PropelPDO $con The connection object used by the query - */ - protected function basePostDelete($affectedRows, PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger(array('delete.post','query.delete.post'), new QueryEvent($this)); - - return $this->postDelete($affectedRows, $con); - } - - /** - * Code to execute before every UPDATE statement - * - * @param array $values The associative array of columns and values for the update - * @param PropelPDO $con The connection object used by the query - * @param boolean $forceIndividualSaves If false (default), the resulting call is a BasePeer::doUpdate(), otherwise it is a series of save() calls on all the found objects - */ - protected function basePreUpdate(&$values, PropelPDO $con, $forceIndividualSaves = false) - { - // event behavior - EventDispatcherProxy::trigger(array('update.pre', 'query.update.pre'), new QueryEvent($this)); - - return $this->preUpdate($values, $con, $forceIndividualSaves); - } - - /** - * Code to execute after every UPDATE statement - * - * @param int $affectedRows the number of updated rows - * @param PropelPDO $con The connection object used by the query - */ - protected function basePostUpdate($affectedRows, PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger(array('update.post', 'query.update.post'), new QueryEvent($this)); - - return $this->postUpdate($affectedRows, $con); - } - - // timestampable behavior - - /** - * Filter by the latest updated - * - * @param int $nbDays Maximum age of the latest update in days - * - * @return NewsletterQuery The current query, for fluid interface - */ - public function recentlyUpdated($nbDays = 7) - { - return $this->addUsingAlias(NewsletterPeer::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL); - } - - /** - * Order by update date desc - * - * @return NewsletterQuery The current query, for fluid interface - */ - public function lastUpdatedFirst() - { - return $this->addDescendingOrderByColumn(NewsletterPeer::UPDATED_AT); - } - - /** - * Order by update date asc - * - * @return NewsletterQuery The current query, for fluid interface - */ - public function firstUpdatedFirst() - { - return $this->addAscendingOrderByColumn(NewsletterPeer::UPDATED_AT); - } - - /** - * Filter by the latest created - * - * @param int $nbDays Maximum age of in days - * - * @return NewsletterQuery The current query, for fluid interface - */ - public function recentlyCreated($nbDays = 7) - { - return $this->addUsingAlias(NewsletterPeer::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL); - } - - /** - * Order by create date desc - * - * @return NewsletterQuery The current query, for fluid interface - */ - public function lastCreatedFirst() - { - return $this->addDescendingOrderByColumn(NewsletterPeer::CREATED_AT); - } - - /** - * Order by create date asc - * - * @return NewsletterQuery The current query, for fluid interface - */ - public function firstCreatedFirst() - { - return $this->addAscendingOrderByColumn(NewsletterPeer::CREATED_AT); - } - // extend behavior - public function setFormatter($formatter) - { - if (is_string($formatter) && $formatter === \ModelCriteria::FORMAT_ON_DEMAND) { - $formatter = '\Glorpen\Propel\PropelBundle\Formatter\PropelOnDemandFormatter'; - } - - return parent::setFormatter($formatter); - } -} diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletterRecipients.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletterRecipients.php deleted file mode 100644 index b138be9..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletterRecipients.php +++ /dev/null @@ -1,1063 +0,0 @@ -nws_newsletter_id; - } - - public function __construct(){ - parent::__construct(); - EventDispatcherProxy::trigger(array('construct','model.construct'), new ModelEvent($this)); - } - - /** - * Get the [fos_group_id] column value. - * - * @return int - */ - public function getFosGroupId() - { - - return $this->fos_group_id; - } - - /** - * Set the value of [nws_newsletter_id] column. - * - * @param int $v new value - * @return NewsletterRecipients The current object (for fluent API support) - */ - public function setNwsNewsletterId($v) - { - if ($v !== null && is_numeric($v)) { - $v = (int) $v; - } - - if ($this->nws_newsletter_id !== $v) { - $this->nws_newsletter_id = $v; - $this->modifiedColumns[] = NewsletterRecipientsPeer::NWS_NEWSLETTER_ID; - } - - if ($this->aNewsletter !== null && $this->aNewsletter->getId() !== $v) { - $this->aNewsletter = null; - } - - - return $this; - } // setNwsNewsletterId() - - /** - * Set the value of [fos_group_id] column. - * - * @param int $v new value - * @return NewsletterRecipients The current object (for fluent API support) - */ - public function setFosGroupId($v) - { - if ($v !== null && is_numeric($v)) { - $v = (int) $v; - } - - if ($this->fos_group_id !== $v) { - $this->fos_group_id = $v; - $this->modifiedColumns[] = NewsletterRecipientsPeer::FOS_GROUP_ID; - } - - if ($this->aGroup !== null && $this->aGroup->getId() !== $v) { - $this->aGroup = null; - } - - - return $this; - } // setFosGroupId() - - /** - * 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->nws_newsletter_id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->fos_group_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - $this->postHydrate($row, $startcol, $rehydrate); - - return $startcol + 2; // 2 = NewsletterRecipientsPeer::NUM_HYDRATE_COLUMNS. - - } catch (Exception $e) { - throw new PropelException("Error populating NewsletterRecipients 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() - { - - if ($this->aNewsletter !== null && $this->nws_newsletter_id !== $this->aNewsletter->getId()) { - $this->aNewsletter = null; - } - if ($this->aGroup !== null && $this->fos_group_id !== $this->aGroup->getId()) { - $this->aGroup = null; - } - } // 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(NewsletterRecipientsPeer::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 = NewsletterRecipientsPeer::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? - - $this->aNewsletter = null; - $this->aGroup = null; - } // 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(NewsletterRecipientsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $deleteQuery = NewsletterRecipientsQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()); - $ret = $this->preDelete($con); - // event behavior - EventDispatcherProxy::trigger(array('delete.pre','model.delete.pre'), new ModelEvent($this)); - if ($ret) { - $deleteQuery->delete($con); - $this->postDelete($con); - // event behavior - EventDispatcherProxy::trigger(array('delete.post', 'model.delete.post'), new ModelEvent($this)); - $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(NewsletterRecipientsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - // event behavior - EventDispatcherProxy::trigger('model.save.pre', new ModelEvent($this)); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - // event behavior - EventDispatcherProxy::trigger('model.insert.pre', new ModelEvent($this)); - } else { - $ret = $ret && $this->preUpdate($con); - // event behavior - EventDispatcherProxy::trigger(array('update.pre', 'model.update.pre'), new ModelEvent($this)); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - // event behavior - EventDispatcherProxy::trigger('model.insert.post', new ModelEvent($this)); - } else { - $this->postUpdate($con); - // event behavior - EventDispatcherProxy::trigger(array('update.post', 'model.update.post'), new ModelEvent($this)); - } - $this->postSave($con); - // event behavior - EventDispatcherProxy::trigger('model.save.post', new ModelEvent($this)); - NewsletterRecipientsPeer::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; - - // We call the save method on the following object(s) if they - // were passed to this object by their corresponding set - // method. This object relates to these object(s) by a - // foreign key reference. - - if ($this->aNewsletter !== null) { - if ($this->aNewsletter->isModified() || $this->aNewsletter->isNew()) { - $affectedRows += $this->aNewsletter->save($con); - } - $this->setNewsletter($this->aNewsletter); - } - - if ($this->aGroup !== null) { - if ($this->aGroup->isModified() || $this->aGroup->isNew()) { - $affectedRows += $this->aGroup->save($con); - } - $this->setGroup($this->aGroup); - } - - 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; - - - // check the columns in natural order for more readable SQL queries - if ($this->isColumnModified(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID)) { - $modifiedColumns[':p' . $index++] = '`nws_newsletter_id`'; - } - if ($this->isColumnModified(NewsletterRecipientsPeer::FOS_GROUP_ID)) { - $modifiedColumns[':p' . $index++] = '`fos_group_id`'; - } - - $sql = sprintf( - 'INSERT INTO `nws_newsletter_recipients` (%s) VALUES (%s)', - implode(', ', $modifiedColumns), - implode(', ', array_keys($modifiedColumns)) - ); - - try { - $stmt = $con->prepare($sql); - foreach ($modifiedColumns as $identifier => $columnName) { - switch ($columnName) { - case '`nws_newsletter_id`': - $stmt->bindValue($identifier, $this->nws_newsletter_id, PDO::PARAM_INT); - break; - case '`fos_group_id`': - $stmt->bindValue($identifier, $this->fos_group_id, 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); - } - - $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(); - - - // We call the validate method on the following object(s) if they - // were passed to this object by their corresponding set - // method. This object relates to these object(s) by a - // foreign key reference. - - if ($this->aNewsletter !== null) { - if (!$this->aNewsletter->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aNewsletter->getValidationFailures()); - } - } - - if ($this->aGroup !== null) { - if (!$this->aGroup->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aGroup->getValidationFailures()); - } - } - - - if (($retval = NewsletterRecipientsPeer::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 = NewsletterRecipientsPeer::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->getNwsNewsletterId(); - break; - case 1: - return $this->getFosGroupId(); - 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 - * @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false) - { - if (isset($alreadyDumpedObjects['NewsletterRecipients'][serialize($this->getPrimaryKey())])) { - return '*RECURSION*'; - } - $alreadyDumpedObjects['NewsletterRecipients'][serialize($this->getPrimaryKey())] = true; - $keys = NewsletterRecipientsPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getNwsNewsletterId(), - $keys[1] => $this->getFosGroupId(), - ); - $virtualColumns = $this->virtualColumns; - foreach ($virtualColumns as $key => $virtualColumn) { - $result[$key] = $virtualColumn; - } - - if ($includeForeignObjects) { - if (null !== $this->aNewsletter) { - $result['Newsletter'] = $this->aNewsletter->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); - } - if (null !== $this->aGroup) { - $result['Group'] = $this->aGroup->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); - } - } - - 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 = NewsletterRecipientsPeer::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->setNwsNewsletterId($value); - break; - case 1: - $this->setFosGroupId($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 = NewsletterRecipientsPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setNwsNewsletterId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setFosGroupId($arr[$keys[1]]); - } - - /** - * 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(NewsletterRecipientsPeer::DATABASE_NAME); - - if ($this->isColumnModified(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID)) $criteria->add(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID, $this->nws_newsletter_id); - if ($this->isColumnModified(NewsletterRecipientsPeer::FOS_GROUP_ID)) $criteria->add(NewsletterRecipientsPeer::FOS_GROUP_ID, $this->fos_group_id); - - 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(NewsletterRecipientsPeer::DATABASE_NAME); - $criteria->add(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID, $this->nws_newsletter_id); - $criteria->add(NewsletterRecipientsPeer::FOS_GROUP_ID, $this->fos_group_id); - - return $criteria; - } - - /** - * Returns the composite primary key for this object. - * The array elements will be in same order as specified in XML. - * @return array - */ - public function getPrimaryKey() - { - $pks = array(); - $pks[0] = $this->getNwsNewsletterId(); - $pks[1] = $this->getFosGroupId(); - - return $pks; - } - - /** - * Set the [composite] primary key. - * - * @param array $keys The elements of the composite key (order must match the order in XML file). - * @return void - */ - public function setPrimaryKey($keys) - { - $this->setNwsNewsletterId($keys[0]); - $this->setFosGroupId($keys[1]); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - - return (null === $this->getNwsNewsletterId()) && (null === $this->getFosGroupId()); - } - - /** - * 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 NewsletterRecipients (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->setNwsNewsletterId($this->getNwsNewsletterId()); - $copyObj->setFosGroupId($this->getFosGroupId()); - - if ($deepCopy && !$this->startCopy) { - // important: temporarily setNew(false) because this affects the behavior of - // the getter/setter methods for fkey referrer objects. - $copyObj->setNew(false); - // store object hash to prevent cycle - $this->startCopy = true; - - //unflag object copy - $this->startCopy = false; - } // if ($deepCopy) - - if ($makeNew) { - $copyObj->setNew(true); - } - } - - /** - * 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 NewsletterRecipients 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 NewsletterRecipientsPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new NewsletterRecipientsPeer(); - } - - return self::$peer; - } - - /** - * Declares an association between this object and a Newsletter object. - * - * @param Newsletter $v - * @return NewsletterRecipients The current object (for fluent API support) - * @throws PropelException - */ - public function setNewsletter(Newsletter $v = null) - { - if ($v === null) { - $this->setNwsNewsletterId(NULL); - } else { - $this->setNwsNewsletterId($v->getId()); - } - - $this->aNewsletter = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the Newsletter object, it will not be re-added. - if ($v !== null) { - $v->addNewsletterRecipients($this); - } - - - return $this; - } - - - /** - * Get the associated Newsletter object - * - * @param PropelPDO $con Optional Connection object. - * @param $doQuery Executes a query to get the object if required - * @return Newsletter The associated Newsletter object. - * @throws PropelException - */ - public function getNewsletter(PropelPDO $con = null, $doQuery = true) - { - if ($this->aNewsletter === null && ($this->nws_newsletter_id !== null) && $doQuery) { - $this->aNewsletter = NewsletterQuery::create()->findPk($this->nws_newsletter_id, $con); - /* The following can be used additionally to - guarantee the related object contains a reference - to this object. This level of coupling may, however, be - undesirable since it could result in an only partially populated collection - in the referenced object. - $this->aNewsletter->addNewsletterRecipientss($this); - */ - } - - return $this->aNewsletter; - } - - /** - * Declares an association between this object and a Group object. - * - * @param Group $v - * @return NewsletterRecipients The current object (for fluent API support) - * @throws PropelException - */ - public function setGroup(Group $v = null) - { - if ($v === null) { - $this->setFosGroupId(NULL); - } else { - $this->setFosGroupId($v->getId()); - } - - $this->aGroup = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the Group object, it will not be re-added. - if ($v !== null) { - $v->addNewsletterRecipients($this); - } - - - return $this; - } - - - /** - * Get the associated Group object - * - * @param PropelPDO $con Optional Connection object. - * @param $doQuery Executes a query to get the object if required - * @return Group The associated Group object. - * @throws PropelException - */ - public function getGroup(PropelPDO $con = null, $doQuery = true) - { - if ($this->aGroup === null && ($this->fos_group_id !== null) && $doQuery) { - $this->aGroup = GroupQuery::create()->findPk($this->fos_group_id, $con); - /* The following can be used additionally to - guarantee the related object contains a reference - to this object. This level of coupling may, however, be - undesirable since it could result in an only partially populated collection - in the referenced object. - $this->aGroup->addNewsletterRecipientss($this); - */ - } - - return $this->aGroup; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->nws_newsletter_id = null; - $this->fos_group_id = 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; - if ($this->aNewsletter instanceof Persistent) { - $this->aNewsletter->clearAllReferences($deep); - } - if ($this->aGroup instanceof Persistent) { - $this->aGroup->clearAllReferences($deep); - } - - $this->alreadyInClearAllReferencesDeep = false; - } // if ($deep) - - $this->aNewsletter = null; - $this->aGroup = null; - } - - /** - * return the string representation of this object - * - * @return string - */ - public function __toString() - { - return (string) $this->exportTo(NewsletterRecipientsPeer::DEFAULT_STRING_FORMAT); - } - - /** - * return true is the object is in saving state - * - * @return boolean - */ - public function isAlreadyInSave() - { - return $this->alreadyInSave; - } - - // event behavior - public function preCommit(\PropelPDO $con = null){} - public function preCommitSave(\PropelPDO $con = null){} - public function preCommitDelete(\PropelPDO $con = null){} - public function preCommitUpdate(\PropelPDO $con = null){} - public function preCommitInsert(\PropelPDO $con = null){} - public function preRollback(\PropelPDO $con = null){} - public function preRollbackSave(\PropelPDO $con = null){} - public function preRollbackDelete(\PropelPDO $con = null){} - public function preRollbackUpdate(\PropelPDO $con = null){} - public function preRollbackInsert(\PropelPDO $con = null){} - -} diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletterRecipientsPeer.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletterRecipientsPeer.php deleted file mode 100644 index 6bef74e..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletterRecipientsPeer.php +++ /dev/null @@ -1,1392 +0,0 @@ - array ('NwsNewsletterId', 'FosGroupId', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('nwsNewsletterId', 'fosGroupId', ), - BasePeer::TYPE_COLNAME => array (NewsletterRecipientsPeer::NWS_NEWSLETTER_ID, NewsletterRecipientsPeer::FOS_GROUP_ID, ), - BasePeer::TYPE_RAW_COLNAME => array ('NWS_NEWSLETTER_ID', 'FOS_GROUP_ID', ), - BasePeer::TYPE_FIELDNAME => array ('nws_newsletter_id', 'fos_group_id', ), - BasePeer::TYPE_NUM => array (0, 1, ) - ); - - /** - * holds an array of keys for quick access to the fieldnames array - * - * first dimension keys are the type constants - * e.g. NewsletterRecipientsPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 - */ - protected static $fieldKeys = array ( - BasePeer::TYPE_PHPNAME => array ('NwsNewsletterId' => 0, 'FosGroupId' => 1, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('nwsNewsletterId' => 0, 'fosGroupId' => 1, ), - BasePeer::TYPE_COLNAME => array (NewsletterRecipientsPeer::NWS_NEWSLETTER_ID => 0, NewsletterRecipientsPeer::FOS_GROUP_ID => 1, ), - BasePeer::TYPE_RAW_COLNAME => array ('NWS_NEWSLETTER_ID' => 0, 'FOS_GROUP_ID' => 1, ), - BasePeer::TYPE_FIELDNAME => array ('nws_newsletter_id' => 0, 'fos_group_id' => 1, ), - BasePeer::TYPE_NUM => array (0, 1, ) - ); - - /** - * 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 = NewsletterRecipientsPeer::getFieldNames($toType); - $key = isset(NewsletterRecipientsPeer::$fieldKeys[$fromType][$name]) ? NewsletterRecipientsPeer::$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(NewsletterRecipientsPeer::$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, NewsletterRecipientsPeer::$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 NewsletterRecipientsPeer::$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. NewsletterRecipientsPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(NewsletterRecipientsPeer::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(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID); - $criteria->addSelectColumn(NewsletterRecipientsPeer::FOS_GROUP_ID); - } else { - $criteria->addSelectColumn($alias . '.nws_newsletter_id'); - $criteria->addSelectColumn($alias . '.fos_group_id'); - } - } - - /** - * 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(NewsletterRecipientsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - NewsletterRecipientsPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count - $criteria->setDbName(NewsletterRecipientsPeer::DATABASE_NAME); // Set the correct dbName - - if ($con === null) { - $con = Propel::getConnection(NewsletterRecipientsPeer::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 NewsletterRecipients - * @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 = NewsletterRecipientsPeer::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 NewsletterRecipientsPeer::populateObjects(NewsletterRecipientsPeer::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(NewsletterRecipientsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - NewsletterRecipientsPeer::addSelectColumns($criteria); - } - - // Set the correct dbName - $criteria->setDbName(NewsletterRecipientsPeer::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 NewsletterRecipients $obj A NewsletterRecipients 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 = serialize(array((string) $obj->getNwsNewsletterId(), (string) $obj->getFosGroupId())); - } // if key === null - NewsletterRecipientsPeer::$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 NewsletterRecipients 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 NewsletterRecipients) { - $key = serialize(array((string) $value->getNwsNewsletterId(), (string) $value->getFosGroupId())); - } elseif (is_array($value) && count($value) === 2) { - // assume we've been passed a primary key - $key = serialize(array((string) $value[0], (string) $value[1])); - } else { - $e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or NewsletterRecipients object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value,true))); - throw $e; - } - - unset(NewsletterRecipientsPeer::$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 NewsletterRecipients 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(NewsletterRecipientsPeer::$instances[$key])) { - return NewsletterRecipientsPeer::$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 (NewsletterRecipientsPeer::$instances as $instance) { - $instance->clearAllReferences(true); - } - } - NewsletterRecipientsPeer::$instances = array(); - } - - /** - * Method to invalidate the instance pool of all tables related to nws_newsletter_recipients - * 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 && $row[$startcol + 1] === null) { - return null; - } - - return serialize(array((string) $row[$startcol], (string) $row[$startcol + 1])); - } - - /** - * 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 array((int) $row[$startcol], (int) $row[$startcol + 1]); - } - - /** - * 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 = NewsletterRecipientsPeer::getOMClass(); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = NewsletterRecipientsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = NewsletterRecipientsPeer::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; - NewsletterRecipientsPeer::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 (NewsletterRecipients object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = NewsletterRecipientsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = NewsletterRecipientsPeer::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 + NewsletterRecipientsPeer::NUM_HYDRATE_COLUMNS; - } else { - $cls = NewsletterRecipientsPeer::getOMClass($row, $startcol); - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - NewsletterRecipientsPeer::addInstanceToPool($obj, $key); - } - - return array($obj, $col); - } - - - /** - * Returns the number of rows matching criteria, joining the related Newsletter table - * - * @param Criteria $criteria - * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead. - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return int Number of matching rows. - */ - public static function doCountJoinNewsletter(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - // we're going to 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(NewsletterRecipientsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - NewsletterRecipientsPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count - - // Set the correct dbName - $criteria->setDbName(NewsletterRecipientsPeer::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(NewsletterRecipientsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID, NewsletterPeer::ID, $join_behavior); - - $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; - } - - - /** - * Returns the number of rows matching criteria, joining the related Group table - * - * @param Criteria $criteria - * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead. - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return int Number of matching rows. - */ - public static function doCountJoinGroup(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - // we're going to 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(NewsletterRecipientsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - NewsletterRecipientsPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count - - // Set the correct dbName - $criteria->setDbName(NewsletterRecipientsPeer::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(NewsletterRecipientsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(NewsletterRecipientsPeer::FOS_GROUP_ID, GroupPeer::ID, $join_behavior); - - $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 a collection of NewsletterRecipients objects pre-filled with their Newsletter objects. - * @param Criteria $criteria - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return array Array of NewsletterRecipients objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinNewsletter(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(NewsletterRecipientsPeer::DATABASE_NAME); - } - - NewsletterRecipientsPeer::addSelectColumns($criteria); - $startcol = NewsletterRecipientsPeer::NUM_HYDRATE_COLUMNS; - NewsletterPeer::addSelectColumns($criteria); - - $criteria->addJoin(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID, NewsletterPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = NewsletterRecipientsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = NewsletterRecipientsPeer::getInstanceFromPool($key1))) { - // We no longer rehydrate the object, since this can cause data loss. - // See http://www.propelorm.org/ticket/509 - // $obj1->hydrate($row, 0, true); // rehydrate - } else { - - $cls = NewsletterRecipientsPeer::getOMClass(); - - $obj1 = new $cls(); - $obj1->hydrate($row); - NewsletterRecipientsPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = NewsletterPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = NewsletterPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = NewsletterPeer::getOMClass(); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - NewsletterPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (NewsletterRecipients) to $obj2 (Newsletter) - $obj2->addNewsletterRecipients($obj1); - - } // if joined row was not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - - return $results; - } - - - /** - * Selects a collection of NewsletterRecipients objects pre-filled with their Group objects. - * @param Criteria $criteria - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return array Array of NewsletterRecipients objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinGroup(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(NewsletterRecipientsPeer::DATABASE_NAME); - } - - NewsletterRecipientsPeer::addSelectColumns($criteria); - $startcol = NewsletterRecipientsPeer::NUM_HYDRATE_COLUMNS; - GroupPeer::addSelectColumns($criteria); - - $criteria->addJoin(NewsletterRecipientsPeer::FOS_GROUP_ID, GroupPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = NewsletterRecipientsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = NewsletterRecipientsPeer::getInstanceFromPool($key1))) { - // We no longer rehydrate the object, since this can cause data loss. - // See http://www.propelorm.org/ticket/509 - // $obj1->hydrate($row, 0, true); // rehydrate - } else { - - $cls = NewsletterRecipientsPeer::getOMClass(); - - $obj1 = new $cls(); - $obj1->hydrate($row); - NewsletterRecipientsPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = GroupPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = GroupPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = GroupPeer::getOMClass(); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - GroupPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (NewsletterRecipients) to $obj2 (Group) - $obj2->addNewsletterRecipients($obj1); - - } // if joined row was not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - - return $results; - } - - - /** - * Returns the number of rows matching criteria, joining all related tables - * - * @param Criteria $criteria - * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead. - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return int Number of matching rows. - */ - public static function doCountJoinAll(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - // we're going to 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(NewsletterRecipientsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - NewsletterRecipientsPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count - - // Set the correct dbName - $criteria->setDbName(NewsletterRecipientsPeer::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(NewsletterRecipientsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID, NewsletterPeer::ID, $join_behavior); - - $criteria->addJoin(NewsletterRecipientsPeer::FOS_GROUP_ID, GroupPeer::ID, $join_behavior); - - $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 a collection of NewsletterRecipients objects pre-filled with all related objects. - * - * @param Criteria $criteria - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return array Array of NewsletterRecipients objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(NewsletterRecipientsPeer::DATABASE_NAME); - } - - NewsletterRecipientsPeer::addSelectColumns($criteria); - $startcol2 = NewsletterRecipientsPeer::NUM_HYDRATE_COLUMNS; - - NewsletterPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + NewsletterPeer::NUM_HYDRATE_COLUMNS; - - GroupPeer::addSelectColumns($criteria); - $startcol4 = $startcol3 + GroupPeer::NUM_HYDRATE_COLUMNS; - - $criteria->addJoin(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID, NewsletterPeer::ID, $join_behavior); - - $criteria->addJoin(NewsletterRecipientsPeer::FOS_GROUP_ID, GroupPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = NewsletterRecipientsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = NewsletterRecipientsPeer::getInstanceFromPool($key1))) { - // We no longer rehydrate the object, since this can cause data loss. - // See http://www.propelorm.org/ticket/509 - // $obj1->hydrate($row, 0, true); // rehydrate - } else { - $cls = NewsletterRecipientsPeer::getOMClass(); - - $obj1 = new $cls(); - $obj1->hydrate($row); - NewsletterRecipientsPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined Newsletter rows - - $key2 = NewsletterPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = NewsletterPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = NewsletterPeer::getOMClass(); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - NewsletterPeer::addInstanceToPool($obj2, $key2); - } // if obj2 loaded - - // Add the $obj1 (NewsletterRecipients) to the collection in $obj2 (Newsletter) - $obj2->addNewsletterRecipients($obj1); - } // if joined row not null - - // Add objects for joined Group rows - - $key3 = GroupPeer::getPrimaryKeyHashFromRow($row, $startcol3); - if ($key3 !== null) { - $obj3 = GroupPeer::getInstanceFromPool($key3); - if (!$obj3) { - - $cls = GroupPeer::getOMClass(); - - $obj3 = new $cls(); - $obj3->hydrate($row, $startcol3); - GroupPeer::addInstanceToPool($obj3, $key3); - } // if obj3 loaded - - // Add the $obj1 (NewsletterRecipients) to the collection in $obj3 (Group) - $obj3->addNewsletterRecipients($obj1); - } // if joined row not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - - return $results; - } - - - /** - * Returns the number of rows matching criteria, joining the related Newsletter table - * - * @param Criteria $criteria - * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead. - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return int Number of matching rows. - */ - public static function doCountJoinAllExceptNewsletter(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - // we're going to 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(NewsletterRecipientsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - NewsletterRecipientsPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY should not affect count - - // Set the correct dbName - $criteria->setDbName(NewsletterRecipientsPeer::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(NewsletterRecipientsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(NewsletterRecipientsPeer::FOS_GROUP_ID, GroupPeer::ID, $join_behavior); - - $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; - } - - - /** - * Returns the number of rows matching criteria, joining the related Group table - * - * @param Criteria $criteria - * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead. - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return int Number of matching rows. - */ - public static function doCountJoinAllExceptGroup(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - // we're going to 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(NewsletterRecipientsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - NewsletterRecipientsPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY should not affect count - - // Set the correct dbName - $criteria->setDbName(NewsletterRecipientsPeer::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(NewsletterRecipientsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID, NewsletterPeer::ID, $join_behavior); - - $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 a collection of NewsletterRecipients objects pre-filled with all related objects except Newsletter. - * - * @param Criteria $criteria - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return array Array of NewsletterRecipients objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAllExceptNewsletter(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(NewsletterRecipientsPeer::DATABASE_NAME); - } - - NewsletterRecipientsPeer::addSelectColumns($criteria); - $startcol2 = NewsletterRecipientsPeer::NUM_HYDRATE_COLUMNS; - - GroupPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + GroupPeer::NUM_HYDRATE_COLUMNS; - - $criteria->addJoin(NewsletterRecipientsPeer::FOS_GROUP_ID, GroupPeer::ID, $join_behavior); - - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = NewsletterRecipientsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = NewsletterRecipientsPeer::getInstanceFromPool($key1))) { - // We no longer rehydrate the object, since this can cause data loss. - // See http://www.propelorm.org/ticket/509 - // $obj1->hydrate($row, 0, true); // rehydrate - } else { - $cls = NewsletterRecipientsPeer::getOMClass(); - - $obj1 = new $cls(); - $obj1->hydrate($row); - NewsletterRecipientsPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined Group rows - - $key2 = GroupPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = GroupPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = GroupPeer::getOMClass(); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - GroupPeer::addInstanceToPool($obj2, $key2); - } // if $obj2 already loaded - - // Add the $obj1 (NewsletterRecipients) to the collection in $obj2 (Group) - $obj2->addNewsletterRecipients($obj1); - - } // if joined row is not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - - return $results; - } - - - /** - * Selects a collection of NewsletterRecipients objects pre-filled with all related objects except Group. - * - * @param Criteria $criteria - * @param PropelPDO $con - * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN - * @return array Array of NewsletterRecipients objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAllExceptGroup(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(NewsletterRecipientsPeer::DATABASE_NAME); - } - - NewsletterRecipientsPeer::addSelectColumns($criteria); - $startcol2 = NewsletterRecipientsPeer::NUM_HYDRATE_COLUMNS; - - NewsletterPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + NewsletterPeer::NUM_HYDRATE_COLUMNS; - - $criteria->addJoin(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID, NewsletterPeer::ID, $join_behavior); - - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = NewsletterRecipientsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = NewsletterRecipientsPeer::getInstanceFromPool($key1))) { - // We no longer rehydrate the object, since this can cause data loss. - // See http://www.propelorm.org/ticket/509 - // $obj1->hydrate($row, 0, true); // rehydrate - } else { - $cls = NewsletterRecipientsPeer::getOMClass(); - - $obj1 = new $cls(); - $obj1->hydrate($row); - NewsletterRecipientsPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined Newsletter rows - - $key2 = NewsletterPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = NewsletterPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = NewsletterPeer::getOMClass(); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - NewsletterPeer::addInstanceToPool($obj2, $key2); - } // if $obj2 already loaded - - // Add the $obj1 (NewsletterRecipients) to the collection in $obj2 (Newsletter) - $obj2->addNewsletterRecipients($obj1); - - } // if joined row is not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - - return $results; - } - - /** - * 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(NewsletterRecipientsPeer::DATABASE_NAME)->getTable(NewsletterRecipientsPeer::TABLE_NAME); - } - - /** - * Add a TableMap instance to the database for this peer class. - */ - public static function buildTableMap() - { - $dbMap = Propel::getDatabaseMap(BaseNewsletterRecipientsPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseNewsletterRecipientsPeer::TABLE_NAME)) { - $dbMap->addTableObject(new \Trinity\Bundle\NewsletterBundle\Model\map\NewsletterRecipientsTableMap()); - } - } - - /** - * The class that the Peer will make instances of. - * - * - * @return string ClassName - */ - public static function getOMClass($row = 0, $colnum = 0) - { - - $event = new DetectOMClassEvent(NewsletterRecipientsPeer::OM_CLASS); - EventDispatcherProxy::trigger('om.detect', $event); - if($event->isDetected()){ - return $event->getDetectedClass(); - } - - return NewsletterRecipientsPeer::OM_CLASS; - } - - /** - * Performs an INSERT on the database, given a NewsletterRecipients or Criteria object. - * - * @param mixed $values Criteria or NewsletterRecipients 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(NewsletterRecipientsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from NewsletterRecipients object - } - - - // Set the correct dbName - $criteria->setDbName(NewsletterRecipientsPeer::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 NewsletterRecipients or Criteria object. - * - * @param mixed $values Criteria or NewsletterRecipients 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(NewsletterRecipientsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(NewsletterRecipientsPeer::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID); - $value = $criteria->remove(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID); - if ($value) { - $selectCriteria->add(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(NewsletterRecipientsPeer::TABLE_NAME); - } - - $comparison = $criteria->getComparison(NewsletterRecipientsPeer::FOS_GROUP_ID); - $value = $criteria->remove(NewsletterRecipientsPeer::FOS_GROUP_ID); - if ($value) { - $selectCriteria->add(NewsletterRecipientsPeer::FOS_GROUP_ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(NewsletterRecipientsPeer::TABLE_NAME); - } - - } else { // $values is NewsletterRecipients object - $criteria = $values->buildCriteria(); // gets full criteria - $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s) - } - - // set the correct dbName - $criteria->setDbName(NewsletterRecipientsPeer::DATABASE_NAME); - - return BasePeer::doUpdate($selectCriteria, $criteria, $con); - } - - /** - * Deletes all rows from the nws_newsletter_recipients 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(NewsletterRecipientsPeer::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(NewsletterRecipientsPeer::TABLE_NAME, $con, NewsletterRecipientsPeer::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). - NewsletterRecipientsPeer::clearInstancePool(); - NewsletterRecipientsPeer::clearRelatedInstancePool(); - $con->commit(); - - return $affectedRows; - } catch (Exception $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs a DELETE on the database, given a NewsletterRecipients or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or NewsletterRecipients 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(NewsletterRecipientsPeer::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. - NewsletterRecipientsPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof NewsletterRecipients) { // it's a model object - // invalidate the cache for this single object - NewsletterRecipientsPeer::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(NewsletterRecipientsPeer::DATABASE_NAME); - // primary key is composite; we therefore, expect - // the primary key passed to be an array of pkey values - if (count($values) == count($values, COUNT_RECURSIVE)) { - // array is not multi-dimensional - $values = array($values); - } - foreach ($values as $value) { - $criterion = $criteria->getNewCriterion(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID, $value[0]); - $criterion->addAnd($criteria->getNewCriterion(NewsletterRecipientsPeer::FOS_GROUP_ID, $value[1])); - $criteria->addOr($criterion); - // we can invalidate the cache for this single PK - NewsletterRecipientsPeer::removeInstanceFromPool($value); - } - } - - // Set the correct dbName - $criteria->setDbName(NewsletterRecipientsPeer::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); - NewsletterRecipientsPeer::clearRelatedInstancePool(); - $con->commit(); - - return $affectedRows; - } catch (Exception $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given NewsletterRecipients 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 NewsletterRecipients $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(NewsletterRecipientsPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(NewsletterRecipientsPeer::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(NewsletterRecipientsPeer::DATABASE_NAME, NewsletterRecipientsPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve object using using composite pkey values. - * @param int $nws_newsletter_id - * @param int $fos_group_id - * @param PropelPDO $con - * @return NewsletterRecipients - */ - public static function retrieveByPK($nws_newsletter_id, $fos_group_id, PropelPDO $con = null) { - $_instancePoolKey = serialize(array((string) $nws_newsletter_id, (string) $fos_group_id)); - if (null !== ($obj = NewsletterRecipientsPeer::getInstanceFromPool($_instancePoolKey))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(NewsletterRecipientsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - $criteria = new Criteria(NewsletterRecipientsPeer::DATABASE_NAME); - $criteria->add(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID, $nws_newsletter_id); - $criteria->add(NewsletterRecipientsPeer::FOS_GROUP_ID, $fos_group_id); - $v = NewsletterRecipientsPeer::doSelect($criteria, $con); - - return !empty($v) ? $v[0] : null; - } -} // BaseNewsletterRecipientsPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseNewsletterRecipientsPeer::buildTableMap(); - -EventDispatcherProxy::trigger(array('construct','peer.construct'), new PeerEvent('Trinity\Bundle\NewsletterBundle\Model\om\BaseNewsletterRecipientsPeer')); diff --git a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletterRecipientsQuery.php b/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletterRecipientsQuery.php deleted file mode 100644 index d36551c..0000000 --- a/vendor/trinity/src/Trinity/Bundle/NewsletterBundle/Model/om/BaseNewsletterRecipientsQuery.php +++ /dev/null @@ -1,581 +0,0 @@ -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(array(12, 34), $con); - * - * - * @param array $key Primary key to use for the query - A Primary key composition: [$nws_newsletter_id, $fos_group_id] - * @param PropelPDO $con an optional connection object - * - * @return NewsletterRecipients|NewsletterRecipients[]|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ($key === null) { - return null; - } - if ((null !== ($obj = NewsletterRecipientsPeer::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) { - // the object is already in the instance pool - return $obj; - } - if ($con === null) { - $con = Propel::getConnection(NewsletterRecipientsPeer::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); - } - } - - /** - * 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 NewsletterRecipients A model object, or null if the key is not found - * @throws PropelException - */ - protected function findPkSimple($key, $con) - { - $sql = 'SELECT `nws_newsletter_id`, `fos_group_id` FROM `nws_newsletter_recipients` WHERE `nws_newsletter_id` = :p0 AND `fos_group_id` = :p1'; - try { - $stmt = $con->prepare($sql); - $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT); - $stmt->bindValue(':p1', $key[1], 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 = NewsletterRecipientsPeer::getOMClass(); - $obj = new $cls; - $obj->hydrate($row); - NewsletterRecipientsPeer::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1]))); - } - $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 NewsletterRecipients|NewsletterRecipients[]|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(array(12, 56), array(832, 123), array(123, 456)), $con); - * - * @param array $keys Primary keys to use for the query - * @param PropelPDO $con an optional connection object - * - * @return PropelObjectCollection|NewsletterRecipients[]|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 NewsletterRecipientsQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - $this->addUsingAlias(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID, $key[0], Criteria::EQUAL); - $this->addUsingAlias(NewsletterRecipientsPeer::FOS_GROUP_ID, $key[1], Criteria::EQUAL); - - return $this; - } - - /** - * Filter the query by a list of primary keys - * - * @param array $keys The list of primary key to use for the query - * - * @return NewsletterRecipientsQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - if (empty($keys)) { - return $this->add(null, '1<>1', Criteria::CUSTOM); - } - foreach ($keys as $key) { - $cton0 = $this->getNewCriterion(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID, $key[0], Criteria::EQUAL); - $cton1 = $this->getNewCriterion(NewsletterRecipientsPeer::FOS_GROUP_ID, $key[1], Criteria::EQUAL); - $cton0->addAnd($cton1); - $this->addOr($cton0); - } - - return $this; - } - - /** - * Filter the query on the nws_newsletter_id column - * - * Example usage: - * - * $query->filterByNwsNewsletterId(1234); // WHERE nws_newsletter_id = 1234 - * $query->filterByNwsNewsletterId(array(12, 34)); // WHERE nws_newsletter_id IN (12, 34) - * $query->filterByNwsNewsletterId(array('min' => 12)); // WHERE nws_newsletter_id >= 12 - * $query->filterByNwsNewsletterId(array('max' => 12)); // WHERE nws_newsletter_id <= 12 - * - * - * @see filterByNewsletter() - * - * @param mixed $nwsNewsletterId 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 NewsletterRecipientsQuery The current query, for fluid interface - */ - public function filterByNwsNewsletterId($nwsNewsletterId = null, $comparison = null) - { - if (is_array($nwsNewsletterId)) { - $useMinMax = false; - if (isset($nwsNewsletterId['min'])) { - $this->addUsingAlias(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID, $nwsNewsletterId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($nwsNewsletterId['max'])) { - $this->addUsingAlias(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID, $nwsNewsletterId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID, $nwsNewsletterId, $comparison); - } - - /** - * Filter the query on the fos_group_id column - * - * Example usage: - * - * $query->filterByFosGroupId(1234); // WHERE fos_group_id = 1234 - * $query->filterByFosGroupId(array(12, 34)); // WHERE fos_group_id IN (12, 34) - * $query->filterByFosGroupId(array('min' => 12)); // WHERE fos_group_id >= 12 - * $query->filterByFosGroupId(array('max' => 12)); // WHERE fos_group_id <= 12 - * - * - * @see filterByGroup() - * - * @param mixed $fosGroupId 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 NewsletterRecipientsQuery The current query, for fluid interface - */ - public function filterByFosGroupId($fosGroupId = null, $comparison = null) - { - if (is_array($fosGroupId)) { - $useMinMax = false; - if (isset($fosGroupId['min'])) { - $this->addUsingAlias(NewsletterRecipientsPeer::FOS_GROUP_ID, $fosGroupId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($fosGroupId['max'])) { - $this->addUsingAlias(NewsletterRecipientsPeer::FOS_GROUP_ID, $fosGroupId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(NewsletterRecipientsPeer::FOS_GROUP_ID, $fosGroupId, $comparison); - } - - /** - * Filter the query by a related Newsletter object - * - * @param Newsletter|PropelObjectCollection $newsletter The related object(s) to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return NewsletterRecipientsQuery The current query, for fluid interface - * @throws PropelException - if the provided filter is invalid. - */ - public function filterByNewsletter($newsletter, $comparison = null) - { - if ($newsletter instanceof Newsletter) { - return $this - ->addUsingAlias(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID, $newsletter->getId(), $comparison); - } elseif ($newsletter instanceof PropelObjectCollection) { - if (null === $comparison) { - $comparison = Criteria::IN; - } - - return $this - ->addUsingAlias(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID, $newsletter->toKeyValue('PrimaryKey', 'Id'), $comparison); - } else { - throw new PropelException('filterByNewsletter() only accepts arguments of type Newsletter or PropelCollection'); - } - } - - /** - * Adds a JOIN clause to the query using the Newsletter relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return NewsletterRecipientsQuery The current query, for fluid interface - */ - public function joinNewsletter($relationAlias = null, $joinType = Criteria::INNER_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('Newsletter'); - - // create a ModelJoin object for this join - $join = new ModelJoin(); - $join->setJoinType($joinType); - $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); - if ($previousJoin = $this->getPreviousJoin()) { - $join->setPreviousJoin($previousJoin); - } - - // add the ModelJoin to the current object - if ($relationAlias) { - $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); - $this->addJoinObject($join, $relationAlias); - } else { - $this->addJoinObject($join, 'Newsletter'); - } - - return $this; - } - - /** - * Use the Newsletter relation Newsletter object - * - * @see useQuery() - * - * @param string $relationAlias optional alias for the relation, - * to be used as main alias in the secondary query - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return \Trinity\Bundle\NewsletterBundle\Model\NewsletterQuery A secondary query class using the current class as primary query - */ - public function useNewsletterQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) - { - return $this - ->joinNewsletter($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'Newsletter', '\Trinity\Bundle\NewsletterBundle\Model\NewsletterQuery'); - } - - /** - * Filter the query by a related Group object - * - * @param Group|PropelObjectCollection $group The related object(s) to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return NewsletterRecipientsQuery The current query, for fluid interface - * @throws PropelException - if the provided filter is invalid. - */ - public function filterByGroup($group, $comparison = null) - { - if ($group instanceof Group) { - return $this - ->addUsingAlias(NewsletterRecipientsPeer::FOS_GROUP_ID, $group->getId(), $comparison); - } elseif ($group instanceof PropelObjectCollection) { - if (null === $comparison) { - $comparison = Criteria::IN; - } - - return $this - ->addUsingAlias(NewsletterRecipientsPeer::FOS_GROUP_ID, $group->toKeyValue('PrimaryKey', 'Id'), $comparison); - } else { - throw new PropelException('filterByGroup() only accepts arguments of type Group or PropelCollection'); - } - } - - /** - * Adds a JOIN clause to the query using the Group relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return NewsletterRecipientsQuery The current query, for fluid interface - */ - public function joinGroup($relationAlias = null, $joinType = Criteria::INNER_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('Group'); - - // create a ModelJoin object for this join - $join = new ModelJoin(); - $join->setJoinType($joinType); - $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); - if ($previousJoin = $this->getPreviousJoin()) { - $join->setPreviousJoin($previousJoin); - } - - // add the ModelJoin to the current object - if ($relationAlias) { - $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); - $this->addJoinObject($join, $relationAlias); - } else { - $this->addJoinObject($join, 'Group'); - } - - return $this; - } - - /** - * Use the Group relation Group object - * - * @see useQuery() - * - * @param string $relationAlias optional alias for the relation, - * to be used as main alias in the secondary query - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return \FOS\UserBundle\Propel\GroupQuery A secondary query class using the current class as primary query - */ - public function useGroupQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) - { - return $this - ->joinGroup($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'Group', '\FOS\UserBundle\Propel\GroupQuery'); - } - - /** - * Exclude object from result - * - * @param NewsletterRecipients $newsletterRecipients Object to remove from the list of results - * - * @return NewsletterRecipientsQuery The current query, for fluid interface - */ - public function prune($newsletterRecipients = null) - { - if ($newsletterRecipients) { - $this->addCond('pruneCond0', $this->getAliasedColName(NewsletterRecipientsPeer::NWS_NEWSLETTER_ID), $newsletterRecipients->getNwsNewsletterId(), Criteria::NOT_EQUAL); - $this->addCond('pruneCond1', $this->getAliasedColName(NewsletterRecipientsPeer::FOS_GROUP_ID), $newsletterRecipients->getFosGroupId(), Criteria::NOT_EQUAL); - $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR); - } - - return $this; - } - - /** - * Code to execute before every SELECT statement - * - * @param PropelPDO $con The connection object used by the query - */ - protected function basePreSelect(PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger('query.select.pre', new QueryEvent($this)); - - return $this->preSelect($con); - } - - /** - * Code to execute before every DELETE statement - * - * @param PropelPDO $con The connection object used by the query - */ - protected function basePreDelete(PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger(array('delete.pre','query.delete.pre'), new QueryEvent($this)); - - return $this->preDelete($con); - } - - /** - * Code to execute after every DELETE statement - * - * @param int $affectedRows the number of deleted rows - * @param PropelPDO $con The connection object used by the query - */ - protected function basePostDelete($affectedRows, PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger(array('delete.post','query.delete.post'), new QueryEvent($this)); - - return $this->postDelete($affectedRows, $con); - } - - /** - * Code to execute before every UPDATE statement - * - * @param array $values The associative array of columns and values for the update - * @param PropelPDO $con The connection object used by the query - * @param boolean $forceIndividualSaves If false (default), the resulting call is a BasePeer::doUpdate(), otherwise it is a series of save() calls on all the found objects - */ - protected function basePreUpdate(&$values, PropelPDO $con, $forceIndividualSaves = false) - { - // event behavior - EventDispatcherProxy::trigger(array('update.pre', 'query.update.pre'), new QueryEvent($this)); - - return $this->preUpdate($values, $con, $forceIndividualSaves); - } - - /** - * Code to execute after every UPDATE statement - * - * @param int $affectedRows the number of updated rows - * @param PropelPDO $con The connection object used by the query - */ - protected function basePostUpdate($affectedRows, PropelPDO $con) - { - // event behavior - EventDispatcherProxy::trigger(array('update.post', 'query.update.post'), new QueryEvent($this)); - - return $this->postUpdate($affectedRows, $con); - } - - // extend behavior - public function setFormatter($formatter) - { - if (is_string($formatter) && $formatter === \ModelCriteria::FORMAT_ON_DEMAND) { - $formatter = '\Glorpen\Propel\PropelBundle\Formatter\PropelOnDemandFormatter'; - } - - return parent::setFormatter($formatter); - } -} diff --git a/vendor/trinity/src/Trinity/Bundle/NotificationBundle/Resources/config/propel/schema.xml b/vendor/trinity/src/Trinity/Bundle/NotificationBundle/Resources/config/propel/schema.xml index 1618ff0..e7e111a 100644 --- a/vendor/trinity/src/Trinity/Bundle/NotificationBundle/Resources/config/propel/schema.xml +++ b/vendor/trinity/src/Trinity/Bundle/NotificationBundle/Resources/config/propel/schema.xml @@ -7,7 +7,7 @@ - + @@ -26,4 +26,4 @@
-
\ No newline at end of file + diff --git a/vendor/trinity/src/Trinity/Bundle/UserBundle/Flash/Flash.php b/vendor/trinity/src/Trinity/Bundle/UserBundle/Flash/Flash.php index 3a3d315..8fc5f9c 100644 --- a/vendor/trinity/src/Trinity/Bundle/UserBundle/Flash/Flash.php +++ b/vendor/trinity/src/Trinity/Bundle/UserBundle/Flash/Flash.php @@ -4,17 +4,48 @@ namespace Trinity\Bundle\UserBundle\Flash; abstract class Flash { - protected $message = null; + protected $message = null; - public function __construct($message) - { - $this->message = $message; - } + protected $options = array(); - public function getMessage() - { - return $this->message; - } + public function __construct($message, array $options = array()) + { + $this->message = $message; + $this->options = $options; + } - abstract public function getTemplate(); + public function setOptions(array $options) + { + $this->options = $options; + + return $this; + } + + public function setOption($name, $value) + { + $this->options[$name] = $value; + + return $this; + } + + public function getOptions() + { + return $this->options; + } + + public function getOption($name, $defaultValue = null) + { + if (array_key_exists($name, $this->options)) { + return $this->options[$name]; + } + + return null; + } + + public function getMessage() + { + return $this->message; + } + + abstract public function getTemplate(); } diff --git a/vendor/trinity/src/Trinity/Bundle/VarsEditorBundle/Service/Config.php b/vendor/trinity/src/Trinity/Bundle/VarsEditorBundle/Service/Config.php index 88e432b..a6dbc66 100644 --- a/vendor/trinity/src/Trinity/Bundle/VarsEditorBundle/Service/Config.php +++ b/vendor/trinity/src/Trinity/Bundle/VarsEditorBundle/Service/Config.php @@ -47,29 +47,21 @@ class Config foreach ($config['fieldsets'] as $fieldset) { if (!is_null($locale) && isset($fieldset['tabs'])) { - if (!isset($fieldset['tabs'][$locale])) { - return $default; - } - - foreach ($fieldset['tabs'][$locale]['vars'] as $var) { - if (!isset($var['key'], $var['value'])) { - return $default; - } - - if ($var['key'] === $key) { - return $var['value']; + if (isset($fieldset['tabs'][$locale])) { + foreach ($fieldset['tabs'][$locale]['vars'] as $var) { + if (isset($var['key'], $var['value'])) { + if ($var['key'] === $key) { + return $var['value']; + } + } } } - } elseif (empty($fieldset['vars'])) { - return $default; - } else { + } elseif (!empty($fieldset['vars'])) { foreach ($fieldset['vars'] as $var) { - if (!isset($var['key'], $var['value'])) { - return $default; - } - - if ($var['key'] === $key) { - return $var['value']; + if (isset($var['key'], $var['value'])) { + if ($var['key'] === $key) { + return $var['value']; + } } } }