Merge branch 'master' of github.com:thelia/thelia

This commit is contained in:
Manuel Raynaud
2013-10-22 09:12:23 +02:00
100 changed files with 5354 additions and 6928 deletions

View File

@@ -0,0 +1,105 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
namespace Thelia\Action;
use Propel\Runtime\ActiveQuery\Criteria;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\Profile\ProfileEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Model\Profile as ProfileModel;
use Thelia\Model\ProfileQuery;
class Profile extends BaseAction implements EventSubscriberInterface
{
/**
* @param ProfileEvent $event
*/
public function create(ProfileEvent $event)
{
$profile = new ProfileModel();
$profile
->setDispatcher($this->getDispatcher())
->setCode($event->getCode())
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->setChapo($event->getChapo())
->setDescription($event->getDescription())
->setPostscriptum($event->getPostscriptum())
;
$profile->save();
$event->setProfile($profile);
}
/**
* @param ProfileEvent $event
*/
public function update(ProfileEvent $event)
{
if (null !== $profile = ProfileQuery::create()->findPk($event->getId())) {
$profile
->setDispatcher($this->getDispatcher())
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->setChapo($event->getChapo())
->setDescription($event->getDescription())
->setPostscriptum($event->getPostscriptum())
;
$profile->save();
$event->setProfile($profile);
}
}
/**
* @param ProfileEvent $event
*/
public function delete(ProfileEvent $event)
{
if (null !== $profile = ProfileQuery::create()->findPk($event->getId())) {
$profile
->delete()
;
$event->setProfile($profile);
}
}
/**
* {@inheritDoc}
*/
public static function getSubscribedEvents()
{
return array(
TheliaEvents::PROFILE_CREATE => array("create", 128),
TheliaEvents::PROFILE_UPDATE => array("update", 128),
TheliaEvents::PROFILE_DELETE => array("delete", 128),
);
}
}

View File

@@ -135,6 +135,8 @@ class CreateAdminUser extends ContainerAwareCommand
$output->writeln("Passwords are different, please try again.");
} while (true);
$admin->setProfile(null);
return $admin;
}

View File

@@ -0,0 +1,92 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
namespace Thelia\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Thelia\Command\ContainerAwareCommand;
use Thelia\Model\Admin;
use Thelia\Model\Map\ResourceTableMap;
class GenerateResources extends ContainerAwareCommand
{
/**
* Configure the command
*/
protected function configure()
{
$this
->setName("thelia:generate-resources")
->setDescription("Outputs admin resources")
->setHelp("The <info>thelia:generate-resources</info> outputs admin resources.")
->addOption(
'output',
null,
InputOption::VALUE_OPTIONAL,
'Output format amid (string, sql)',
null
)
;
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$class = new \ReflectionClass('Thelia\Core\Event\AdminResources');
$constants = $class->getConstants();
if(count($constants) == 0) {
$output->writeln('No resources found');
exit;
}
switch($input->getOption("output")) {
case 'sql':
$output->writeln(
'INSERT INTO ' . ResourceTableMap::TABLE_NAME . ' (`id`, `code`, `created_at`, `updated_at`) VALUES '
);
foreach($constants as $constant => $value) {
if($constant == 'SUPERADMINISTRATOR') {
continue;
}
$output->writeln(
"(NULL, '$value', NOW(), NOW())" . ($constant === key( array_slice( $constants, -1, 1, TRUE ) ) ? '' : ',')
);
}
break;
default :
foreach($constants as $constant => $value) {
if($constant == 'SUPERADMINISTRATOR') {
continue;
}
$output->writeln('[' . $constant . "] => " . $value);
}
break;
}
}
}

View File

@@ -151,6 +151,11 @@
<tag name="kernel.event_subscriber"/>
</service>
<service id="thelia.action.profile" class="Thelia\Action\Profile">
<argument type="service" id="service_container"/>
<tag name="kernel.event_subscriber"/>
</service>
</services>
</config>

View File

@@ -7,6 +7,7 @@
<loops>
<loop class="Thelia\Core\Template\Loop\Accessory" name="accessory"/>
<loop class="Thelia\Core\Template\Loop\Address" name="address"/>
<loop class="Thelia\Core\Template\Loop\Admin" name="admin"/>
<loop class="Thelia\Core\Template\Loop\Area" name="area"/>
<loop class="Thelia\Core\Template\Loop\AssociatedContent" name="associated_content"/>
<loop class="Thelia\Core\Template\Loop\Attribute" name="attribute"/>
@@ -33,6 +34,7 @@
<loop class="Thelia\Core\Template\Loop\Payment" name="payment"/>
<loop class="Thelia\Core\Template\Loop\Product" name="product"/>
<loop class="Thelia\Core\Template\Loop\ProductSaleElements" name="product_sale_elements"/>
<loop class="Thelia\Core\Template\Loop\Profile" name="profile"/>
<loop class="Thelia\Core\Template\Loop\Feed" name="feed"/>
<loop class="Thelia\Core\Template\Loop\Title" name="title"/>
<loop class="Thelia\Core\Template\Loop\Lang" name="lang"/>
@@ -123,13 +125,14 @@
<form name="thelia.admin.tax.taxlistupdate" class="Thelia\Form\TaxTaxListUpdateForm"/>
<form name="thelia.admin.tax.add" class="Thelia\Form\TaxCreationForm"/>
<form name="thelia.admin.profile.add" class="Thelia\Form\ProfileCreationForm"/>
<form name="thelia.admin.profile.modification" class="Thelia\Form\ProfileModificationForm"/>
<form name="thelia.admin.template.creation" class="Thelia\Form\TemplateCreationForm"/>
<form name="thelia.admin.template.modification" class="Thelia\Form\TemplateModificationForm"/>
<form name="thelia.admin.country.creation" class="Thelia\Form\CountryCreationForm"/>
<form name="thelia.admin.country.modification" class="Thelia\Form\CountryModificationForm"/>
<form name="thelia.admin.profile.modification" class="Thelia\Form\ProfileModificationForm"/>
<form name="thelia.admin.language.creation" class="Thelia\Form\LanguageCreationForm"/>
@@ -157,6 +160,7 @@
<command class="Thelia\Command\ModuleActivateCommand"/>
<command class="Thelia\Command\CreateAdminUser"/>
<command class="Thelia\Command\ReloadDatabaseCommand"/>
<command class="Thelia\Command\GenerateResources"/>
</commands>
<services>

View File

@@ -757,6 +757,32 @@
<!-- end countries routes management -->
<!-- profiles management -->
<route id="admin.configuration.profiles.list" path="/admin/configuration/profiles">
<default key="_controller">Thelia\Controller\Admin\ProfileController::defaultAction</default>
<requirement key="address_id">\d+</requirement>
</route>
<route id="admin.configuration.profiles.update" path="/admin/configuration/profiles/update/{profile_id}">
<default key="_controller">Thelia\Controller\Admin\ProfileController::updateAction</default>
<requirement key="tax_id">\d+</requirement>
</route>
<route id="admin.configuration.profiles.add" path="/admin/configuration/profiles/add">
<default key="_controller">Thelia\Controller\Admin\ProfileController::createAction</default>
</route>
<route id="admin.configuration.profiles.save" path="/admin/configuration/profiles/save">
<default key="_controller">Thelia\Controller\Admin\ProfileController::processUpdateAction</default>
</route>
<route id="admin.configuration.profiles.delete" path="/admin/configuration/profiles/delete">
<default key="_controller">Thelia\Controller\Admin\ProfileController::deleteAction</default>
</route>
<!-- end profiles management -->
<!-- feature and features value management -->
<route id="admin.configuration.features.default" path="/admin/configuration/features">

View File

@@ -24,6 +24,7 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\Address\AddressCreateOrUpdateEvent;
use Thelia\Core\Event\Address\AddressEvent;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Form\AddressCreateForm;
use Thelia\Form\AddressUpdateForm;
@@ -44,10 +45,10 @@ class AddressController extends AbstractCrudController
null,
null,
'admin.customer.update.view',
'admin.address.create',
'admin.address.update',
'admin.address.delete',
AdminResources::ADDRESS_VIEW,
AdminResources::ADDRESS_CREATE,
AdminResources::ADDRESS_UPDATE,
AdminResources::ADDRESS_DELETE,
TheliaEvents::ADDRESS_CREATE,
TheliaEvents::ADDRESS_UPDATE,
@@ -60,7 +61,7 @@ class AddressController extends AbstractCrudController
public function useAddressAction()
{
if (null !== $response = $this->checkAuth("admin.customer.update")) return $response;
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
$address_id = $this->getRequest()->request->get('address_id');

View File

@@ -23,6 +23,7 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Area\AreaAddCountryEvent;
use Thelia\Core\Event\Area\AreaCreateEvent;
use Thelia\Core\Event\Area\AreaDeleteEvent;
@@ -52,10 +53,10 @@ class AreaController extends AbstractCrudController
null,
null,
'admin.area.default',
'admin.area.create',
'admin.area.update',
'admin.area.delete',
AdminResources::AREA_VIEW,
AdminResources::AREA_CREATE,
AdminResources::AREA_UPDATE,
AdminResources::AREA_DELETE,
TheliaEvents::AREA_CREATE,
TheliaEvents::AREA_UPDATE,

View File

@@ -23,6 +23,7 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Attribute\AttributeAvDeleteEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Attribute\AttributeAvUpdateEvent;
@@ -46,10 +47,10 @@ class AttributeAvController extends AbstractCrudController
'manual',
'order',
'admin.configuration.attributes-av.view',
'admin.configuration.attributes-av.create',
'admin.configuration.attributes-av.update',
'admin.configuration.attributes-av.delete',
AdminResources::ATTRIBUTE_VIEW,
AdminResources::ATTRIBUTE_CREATE,
AdminResources::ATTRIBUTE_UPDATE,
AdminResources::ATTRIBUTE_DELETE,
TheliaEvents::ATTRIBUTE_AV_CREATE,
TheliaEvents::ATTRIBUTE_AV_UPDATE,

View File

@@ -23,6 +23,7 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Attribute\AttributeDeleteEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Attribute\AttributeUpdateEvent;
@@ -50,10 +51,10 @@ class AttributeController extends AbstractCrudController
'manual',
'order',
'admin.configuration.attributes.view',
'admin.configuration.attributes.create',
'admin.configuration.attributes.update',
'admin.configuration.attributes.delete',
AdminResources::ATTRIBUTE_VIEW,
AdminResources::ATTRIBUTE_CREATE,
AdminResources::ATTRIBUTE_UPDATE,
AdminResources::ATTRIBUTE_DELETE,
TheliaEvents::ATTRIBUTE_CREATE,
TheliaEvents::ATTRIBUTE_UPDATE,
@@ -253,7 +254,7 @@ class AttributeController extends AbstractCrudController
protected function addRemoveFromAllTemplates($eventType)
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.configuration.attributes.update")) return $response;
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
try {
if (null !== $object = $this->getExistingObject()) {

View File

@@ -24,6 +24,7 @@
namespace Thelia\Controller\Admin;
use Symfony\Component\HttpFoundation\Response;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Category\CategoryDeleteEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Category\CategoryUpdateEvent;
@@ -54,10 +55,10 @@ class CategoryController extends AbstractCrudController
'manual',
'category_order',
'admin.categories.default',
'admin.categories.create',
'admin.categories.update',
'admin.categories.delete',
AdminResources::CATEGORY_VIEW,
AdminResources::CATEGORY_CREATE,
AdminResources::CATEGORY_UPDATE,
AdminResources::CATEGORY_DELETE,
TheliaEvents::CATEGORY_CREATE,
TheliaEvents::CATEGORY_UPDATE,
@@ -216,7 +217,7 @@ class CategoryController extends AbstractCrudController
public function setToggleVisibilityAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.categories.update")) return $response;
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
$event = new CategoryToggleVisibilityEvent($this->getExistingObject());
@@ -296,7 +297,7 @@ class CategoryController extends AbstractCrudController
public function addRelatedContentAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.categories.update")) return $response;
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
$content_id = intval($this->getRequest()->get('content_id'));
@@ -326,7 +327,7 @@ class CategoryController extends AbstractCrudController
public function addRelatedPictureAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.categories.update")) {
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) {
return $response;
}
@@ -354,7 +355,7 @@ class CategoryController extends AbstractCrudController
public function deleteRelatedContentAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.categories.update")) return $response;
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
$content_id = intval($this->getRequest()->get('content_id'));

View File

@@ -23,6 +23,7 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Config\ConfigDeleteEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Config\ConfigUpdateEvent;
@@ -45,10 +46,10 @@ class ConfigController extends AbstractCrudController
'name',
'order',
'admin.configuration.variables.view',
'admin.configuration.variables.create',
'admin.configuration.variables.update',
'admin.configuration.variables.delete',
AdminResources::CONFIG_VIEW,
AdminResources::CONFIG_CREATE,
AdminResources::CONFIG_UPDATE,
AdminResources::CONFIG_DELETE,
TheliaEvents::CONFIG_CREATE,
TheliaEvents::CONFIG_UPDATE,
@@ -187,7 +188,7 @@ class ConfigController extends AbstractCrudController
public function changeValuesAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.configuration.variables.update")) return $response;
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
$variables = $this->getRequest()->get('variable', array());

View File

@@ -22,6 +22,7 @@
/*************************************************************************************/
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Content\ContentAddFolderEvent;
use Thelia\Core\Event\Content\ContentCreateEvent;
use Thelia\Core\Event\Content\ContentDeleteEvent;
@@ -49,10 +50,10 @@ class ContentController extends AbstractCrudController
'manual',
'content_order',
'admin.content.default',
'admin.content.create',
'admin.content.update',
'admin.content.delete',
AdminResources::CONTENT_VIEW,
AdminResources::CONTENT_CREATE,
AdminResources::CONTENT_UPDATE,
AdminResources::CONTENT_DELETE,
TheliaEvents::CONTENT_CREATE,
TheliaEvents::CONTENT_UPDATE,
@@ -70,7 +71,7 @@ class ContentController extends AbstractCrudController
public function addAdditionalFolderAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth('admin.content.update')) return $response;
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
$folder_id = intval($this->getRequest()->request->get('additional_folder_id'));
@@ -98,7 +99,7 @@ class ContentController extends AbstractCrudController
public function removeAdditionalFolderAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth('admin.content.update')) return $response;
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
$folder_id = intval($this->getRequest()->request->get('additional_folder_id'));

View File

@@ -22,6 +22,7 @@
/*************************************************************************************/
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Country\CountryCreateEvent;
use Thelia\Core\Event\Country\CountryDeleteEvent;
use Thelia\Core\Event\Country\CountryToggleDefaultEvent;
@@ -46,10 +47,10 @@ class CountryController extends AbstractCrudController
'manual',
'country_order',
'admin.country.default',
'admin.country.create',
'admin.country.update',
'admin.country.delete',
AdminResources::COUNTRY_VIEW,
AdminResources::COUNTRY_CREATE,
AdminResources::COUNTRY_UPDATE,
AdminResources::COUNTRY_DELETE,
TheliaEvents::COUNTRY_CREATE,
TheliaEvents::COUNTRY_UPDATE,

View File

@@ -27,6 +27,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Router;
use Thelia\Condition\ConditionFactory;
use Thelia\Condition\ConditionManagerInterface;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Condition\ConditionCreateOrUpdateEvent;
use Thelia\Core\Event\Coupon\CouponConsumeEvent;
use Thelia\Core\Event\Coupon\CouponCreateOrUpdateEvent;
@@ -62,7 +63,7 @@ class CouponController extends BaseAdminController
*/
public function browseAction()
{
$this->checkAuth('ADMIN', 'admin.coupon.view');
$this->checkAuth('ADMIN', AdminResources::COUPON_VIEW);
$args['urlReadCoupon'] = $this->getRoute(
'admin.coupon.read',
@@ -94,7 +95,7 @@ class CouponController extends BaseAdminController
*/
public function readAction($couponId)
{
$this->checkAuth('ADMIN', 'admin.coupon.read');
$this->checkAuth('ADMIN', AdminResources::COUPON_VIEW);
// Database request repeated in the loop but cached
$search = CouponQuery::create();
@@ -122,7 +123,7 @@ class CouponController extends BaseAdminController
public function createAction()
{
// Check current user authorization
$response = $this->checkAuth('admin.coupon.create');
$response = $this->checkAuth(AdminResources::COUPON_CREATE);
if ($response !== null) {
return $response;
}
@@ -170,7 +171,7 @@ class CouponController extends BaseAdminController
public function updateAction($couponId)
{
// Check current user authorization
$response = $this->checkAuth('admin.coupon.update');
$response = $this->checkAuth(AdminResources::COUPON_UPDATE);
if ($response !== null) {
return $response;
}
@@ -277,7 +278,7 @@ var_dump($coupon->getIsRemovingPostage());;
*/
public function getConditionInputAction($conditionId)
{
$this->checkAuth('ADMIN', 'admin.coupon.read');
$this->checkAuth('ADMIN', AdminResources::COUPON_VIEW);
$this->checkXmlHttpRequest();
@@ -307,7 +308,7 @@ var_dump($coupon->getIsRemovingPostage());;
*/
public function updateConditionsAction($couponId)
{
$this->checkAuth('ADMIN', 'admin.coupon.read');
$this->checkAuth('ADMIN', AdminResources::COUPON_VIEW);
$this->checkXmlHttpRequest();

View File

@@ -23,6 +23,7 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Currency\CurrencyDeleteEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Currency\CurrencyUpdateEvent;
@@ -46,10 +47,10 @@ class CurrencyController extends AbstractCrudController
'manual',
'order',
'admin.configuration.currencies.view',
'admin.configuration.currencies.create',
'admin.configuration.currencies.update',
'admin.configuration.currencies.delete',
AdminResources::CURRENCY_VIEW,
AdminResources::CURRENCY_CREATE,
AdminResources::CURRENCY_UPDATE,
AdminResources::CURRENCY_DELETE,
TheliaEvents::CURRENCY_CREATE,
TheliaEvents::CURRENCY_UPDATE,
@@ -186,7 +187,7 @@ class CurrencyController extends AbstractCrudController
public function updateRatesAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.configuration.currencies.update")) return $response;
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
try {
$this->dispatch(TheliaEvents::CURRENCY_UPDATE_RATES);
@@ -204,7 +205,7 @@ class CurrencyController extends AbstractCrudController
public function setDefaultAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.configuration.currencies.update")) return $response;
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
$changeEvent = new CurrencyUpdateEvent($this->getRequest()->get('currency_id', 0));

View File

@@ -24,7 +24,8 @@
namespace Thelia\Controller\Admin;
use Propel\Runtime\Exception\PropelException;
use Symfony\Component\Form\Form;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Customer\CustomerAddressEvent;
use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent;
use Thelia\Core\Event\Customer\CustomerEvent;
use Thelia\Core\Event\TheliaEvents;
@@ -42,13 +43,13 @@ class CustomerController extends BaseAdminController
{
public function indexAction()
{
if (null !== $response = $this->checkAuth("admin.customer.view")) return $response;
if (null !== $response = $this->checkAuth(AdminResources::CUSTOMER_VIEW)) return $response;
return $this->render("customers", array("display_customer" => 20));
}
public function viewAction($customer_id)
{
if (null !== $response = $this->checkAuth("admin.customer.view")) return $response;
if (null !== $response = $this->checkAuth(AdminResources::CUSTOMER_VIEW)) return $response;
return $this->render("customer-edit", array(
"customer_id" => $customer_id
));
@@ -62,7 +63,7 @@ class CustomerController extends BaseAdminController
*/
public function updateAction($customer_id)
{
if (null !== $response = $this->checkAuth("admin.customer.update")) return $response;
if (null !== $response = $this->checkAuth(AdminResources::CUSTOMER_UPDATE)) return $response;
$message = false;
@@ -118,7 +119,7 @@ class CustomerController extends BaseAdminController
public function deleteAction()
{
if (null !== $response = $this->checkAuth("admin.customer.delete")) return $response;
if (null !== $response = $this->checkAuth(AdminResources::CUSTOMER_DELETE)) return $response;
$message = null;

View File

@@ -23,6 +23,7 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Feature\FeatureAvDeleteEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Feature\FeatureAvUpdateEvent;
@@ -46,10 +47,10 @@ class FeatureAvController extends AbstractCrudController
'manual',
'order',
'admin.configuration.features-av.view',
'admin.configuration.features-av.create',
'admin.configuration.features-av.update',
'admin.configuration.features-av.delete',
AdminResources::FEATURE_VIEW,
AdminResources::FEATURE_CREATE,
AdminResources::FEATURE_UPDATE,
AdminResources::FEATURE_DELETE,
TheliaEvents::FEATURE_AV_CREATE,
TheliaEvents::FEATURE_AV_UPDATE,

View File

@@ -23,6 +23,7 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Feature\FeatureDeleteEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Feature\FeatureUpdateEvent;
@@ -50,10 +51,10 @@ class FeatureController extends AbstractCrudController
'manual',
'order',
'admin.configuration.features.view',
'admin.configuration.features.create',
'admin.configuration.features.update',
'admin.configuration.features.delete',
AdminResources::FEATURE_VIEW,
AdminResources::FEATURE_CREATE,
AdminResources::FEATURE_UPDATE,
AdminResources::FEATURE_DELETE,
TheliaEvents::FEATURE_CREATE,
TheliaEvents::FEATURE_UPDATE,
@@ -253,7 +254,7 @@ class FeatureController extends AbstractCrudController
protected function addRemoveFromAllTemplates($eventType)
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.configuration.features.update")) return $response;
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
try {
if (null !== $object = $this->getExistingObject()) {

View File

@@ -26,6 +26,7 @@ namespace Thelia\Controller\Admin;
use Propel\Runtime\Exception\PropelException;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\Response;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Document\DocumentCreateOrUpdateEvent;
use Thelia\Core\Event\Document\DocumentDeleteEvent;
use Thelia\Core\Event\Image\ImageCreateOrUpdateEvent;
@@ -69,7 +70,7 @@ class FileController extends BaseAdminController
*/
public function saveImageAjaxAction($parentId, $parentType)
{
$this->checkAuth('ADMIN', 'admin.image.save');
$this->checkAuth('ADMIN', AdminResources::retrieve($parentType, 'update'));
$this->checkXmlHttpRequest();
if ($this->isParentTypeValid($parentType)) {
@@ -145,7 +146,7 @@ class FileController extends BaseAdminController
*/
public function saveDocumentAjaxAction($parentId, $parentType)
{
$this->checkAuth('ADMIN', 'admin.document.save');
$this->checkAuth('ADMIN', AdminResources::retrieve($parentType, 'update'));
$this->checkXmlHttpRequest();
if ($this->isParentTypeValid($parentType)) {
@@ -209,7 +210,7 @@ class FileController extends BaseAdminController
*/
public function getImageListAjaxAction($parentId, $parentType)
{
$this->checkAuth('ADMIN', 'admin.image.save');
$this->checkAuth('ADMIN', AdminResources::retrieve($parentType, 'update'));
$this->checkXmlHttpRequest();
$args = array('imageType' => $parentType, 'parentId' => $parentId);
@@ -226,7 +227,7 @@ class FileController extends BaseAdminController
*/
public function getDocumentListAjaxAction($parentId, $parentType)
{
$this->checkAuth('ADMIN', 'admin.document.save');
$this->checkAuth('ADMIN', AdminResources::retrieve($parentType, 'update'));
$this->checkXmlHttpRequest();
$args = array('documentType' => $parentType, 'parentId' => $parentId);
@@ -243,7 +244,7 @@ class FileController extends BaseAdminController
*/
public function getImageFormAjaxAction($parentId, $parentType)
{
$this->checkAuth('ADMIN', 'admin.image.save');
$this->checkAuth('ADMIN', AdminResources::retrieve($parentType, 'update'));
$this->checkXmlHttpRequest();
$args = array('imageType' => $parentType, 'parentId' => $parentId);
@@ -260,7 +261,7 @@ class FileController extends BaseAdminController
*/
public function getDocumentFormAjaxAction($parentId, $parentType)
{
$this->checkAuth('ADMIN', 'admin.document.save');
$this->checkAuth('ADMIN', AdminResources::retrieve($parentType, 'update'));
$this->checkXmlHttpRequest();
$args = array('documentType' => $parentType, 'parentId' => $parentId);
@@ -277,7 +278,7 @@ class FileController extends BaseAdminController
*/
public function viewImageAction($imageId, $parentType)
{
if (null !== $response = $this->checkAuth('admin.image.view')) {
if (null !== $response = $this->checkAuth('ADMIN', AdminResources::retrieve($parentType, 'update'))) {
return $response;
}
try {
@@ -306,7 +307,7 @@ class FileController extends BaseAdminController
*/
public function viewDocumentAction($documentId, $parentType)
{
if (null !== $response = $this->checkAuth('admin.document.view')) {
if (null !== $response = $this->checkAuth('ADMIN', AdminResources::retrieve($parentType, 'update'))) {
return $response;
}
try {
@@ -335,7 +336,7 @@ class FileController extends BaseAdminController
*/
public function updateImageAction($imageId, $parentType)
{
if (null !== $response = $this->checkAuth('admin.image.update')) {
if (null !== $response = $this->checkAuth('ADMIN', AdminResources::retrieve($parentType, 'update'))) {
return $response;
}
@@ -412,7 +413,7 @@ class FileController extends BaseAdminController
*/
public function updateDocumentAction($documentId, $parentType)
{
if (null !== $response = $this->checkAuth('admin.document.update')) {
if (null !== $response = $this->checkAuth('ADMIN', AdminResources::retrieve($parentType, 'update'))) {
return $response;
}
@@ -489,7 +490,7 @@ class FileController extends BaseAdminController
*/
public function deleteImageAction($imageId, $parentType)
{
$this->checkAuth('ADMIN', 'admin.image.delete');
$this->checkAuth('ADMIN', AdminResources::retrieve($parentType, 'update'));
$this->checkXmlHttpRequest();
$fileManager = new FileManager($this->container);
@@ -532,7 +533,7 @@ class FileController extends BaseAdminController
*/
public function deleteDocumentAction($documentId, $parentType)
{
$this->checkAuth('ADMIN', 'admin.document.delete');
$this->checkAuth('ADMIN', AdminResources::retrieve($parentType, 'update'));
$this->checkXmlHttpRequest();
$fileManager = new FileManager($this->container);

View File

@@ -22,6 +22,7 @@
/*************************************************************************************/
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Folder\FolderCreateEvent;
use Thelia\Core\Event\Folder\FolderDeleteEvent;
use Thelia\Core\Event\Folder\FolderToggleVisibilityEvent;
@@ -47,10 +48,10 @@ class FolderController extends AbstractCrudController
'manual',
'folder_order',
'admin.folder.default',
'admin.folder.create',
'admin.folder.update',
'admin.folder.delete',
AdminResources::FOLDER_VIEW,
AdminResources::FOLDER_CREATE,
AdminResources::FOLDER_UPDATE,
AdminResources::FOLDER_DELETE,
TheliaEvents::FOLDER_CREATE,
TheliaEvents::FOLDER_UPDATE,

View File

@@ -23,6 +23,8 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\AdminResources;
/**
* Class LanguageController
* @package Thelia\Controller\Admin
@@ -32,7 +34,7 @@ class LanguageController extends BaseAdminController
{
public function defaultAction()
{
if (null !== $response = $this->checkAuth("admin.configuration.languages.view")) return $response;
if (null !== $response = $this->checkAuth(AdminResources::LANGUAGE_VIEW)) return $response;
return $this->render("languages");
}

View File

@@ -23,6 +23,8 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\AdminResources;
/**
* Class MailingSystemController
* @package Thelia\Controller\Admin
@@ -32,7 +34,7 @@ class MailingSystemController extends BaseAdminController
{
public function defaultAction()
{
if (null !== $response = $this->checkAuth("admin.configuration.mailing-system.view")) return $response;
if (null !== $response = $this->checkAuth(AdminResources::MAILING_SYSTEM_VIEW)) return $response;
return $this->render("mailing-system");
}

View File

@@ -23,6 +23,7 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Message\MessageDeleteEvent;
use Thelia\Core\Event\TheliaEvents;use Thelia\Core\Event\Message\MessageUpdateEvent;
use Thelia\Core\Event\Message\MessageCreateEvent;
@@ -44,10 +45,10 @@ class MessageController extends AbstractCrudController
null, // no sort order change
null, // no sort order change
'admin.configuration.messages.view',
'admin.configuration.messages.create',
'admin.configuration.messages.update',
'admin.configuration.messages.delete',
AdminResources::MESSAGE_VIEW,
AdminResources::MESSAGE_CREATE,
AdminResources::MESSAGE_UPDATE,
AdminResources::MESSAGE_DELETE,
TheliaEvents::MESSAGE_CREATE,
TheliaEvents::MESSAGE_UPDATE,

View File

@@ -23,6 +23,8 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Module\ModuleDeleteEvent;
use Thelia\Core\Event\Module\ModuleToggleActivationEvent;
use Thelia\Core\Event\TheliaEvents;
@@ -37,8 +39,8 @@ class ModuleController extends BaseAdminController
{
public function indexAction()
{
if (null !== $response = $this->checkAuth("admin.module.view")) return $response;
if (null !== $response = $this->checkAuth(AdminResources::MODULE_VIEW)) return $response;
$modulemanagement = new ModuleManagement();
$modulemanagement->updateModules();

View File

@@ -24,6 +24,7 @@
namespace Thelia\Controller\Admin;
use Symfony\Component\HttpFoundation\Response;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Order\OrderAddressEvent;
use Thelia\Core\Event\Order\OrderEvent;
use Thelia\Core\Event\PdfEvent;
@@ -44,7 +45,7 @@ class OrderController extends BaseAdminController
{
public function indexAction()
{
if (null !== $response = $this->checkAuth("admin.orders.view")) return $response;
if (null !== $response = $this->checkAuth(AdminResources::ORDER_VIEW)) return $response;
return $this->render("orders", array("display_order" => 20));
}
@@ -57,7 +58,7 @@ class OrderController extends BaseAdminController
public function updateStatus($order_id = null)
{
if (null !== $response = $this->checkAuth("admin.order.update")) return $response;
if (null !== $response = $this->checkAuth(AdminResources::ORDER_UPDATE)) return $response;
$message = null;
@@ -108,7 +109,7 @@ class OrderController extends BaseAdminController
public function updateDeliveryRef($order_id)
{
if (null !== $response = $this->checkAuth("admin.order.update")) return $response;
if (null !== $response = $this->checkAuth(AdminResources::ORDER_UPDATE)) return $response;
$message = null;
@@ -143,7 +144,7 @@ class OrderController extends BaseAdminController
public function updateAddress($order_id)
{
if (null !== $response = $this->checkAuth("admin.order.update")) return $response;
if (null !== $response = $this->checkAuth(AdminResources::ORDER_UPDATE)) return $response;
$message = null;
@@ -209,7 +210,7 @@ class OrderController extends BaseAdminController
protected function generatePdf($order_id, $fileName)
{
if (null !== $response = $this->checkAuth("admin.order.update")) return $response;
if (null !== $response = $this->checkAuth(AdminResources::ORDER_UPDATE)) return $response;
$html = $this->renderRaw(
$fileName,

View File

@@ -23,6 +23,7 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Product\ProductAddCategoryEvent;
use Thelia\Core\Event\Product\ProductDeleteCategoryEvent;
use Thelia\Core\Event\Product\ProductDeleteEvent;
@@ -61,10 +62,10 @@ class ProductController extends AbstractCrudController
'manual',
'product_order',
'admin.products.default',
'admin.products.create',
'admin.products.update',
'admin.products.delete',
AdminResources::PRODUCT_VIEW,
AdminResources::PRODUCT_CREATE,
AdminResources::PRODUCT_UPDATE,
AdminResources::PRODUCT_DELETE,
TheliaEvents::PRODUCT_CREATE,
TheliaEvents::PRODUCT_UPDATE,
@@ -280,7 +281,7 @@ class ProductController extends AbstractCrudController
public function setToggleVisibilityAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.products.update")) return $response;
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
$event = new ProductToggleVisibilityEvent($this->getExistingObject());
@@ -356,7 +357,7 @@ class ProductController extends AbstractCrudController
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.products.update")) return $response;
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
$content_id = intval($this->getRequest()->get('content_id'));
@@ -382,7 +383,7 @@ class ProductController extends AbstractCrudController
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.products.update")) return $response;
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
$content_id = intval($this->getRequest()->get('content_id'));
@@ -434,7 +435,7 @@ class ProductController extends AbstractCrudController
public function addAccessoryAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.products.update")) return $response;
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
$accessory_id = intval($this->getRequest()->get('accessory_id'));
@@ -459,7 +460,7 @@ class ProductController extends AbstractCrudController
public function deleteAccessoryAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.products.update")) return $response;
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
$accessory_id = intval($this->getRequest()->get('accessory_id'));
@@ -515,7 +516,7 @@ class ProductController extends AbstractCrudController
public function setProductTemplateAction($productId)
{
// Check current user authorization
if (null !== $response = $this->checkAuth('admin.products.update')) return $response;
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
$product = ProductQuery::create()->findPk($productId);
@@ -612,7 +613,7 @@ class ProductController extends AbstractCrudController
public function addAdditionalCategoryAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.products.update")) return $response;
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
$category_id = intval($this->getRequest()->request->get('additional_category_id'));
@@ -637,7 +638,7 @@ class ProductController extends AbstractCrudController
public function deleteAdditionalCategoryAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.products.update")) return $response;
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
$category_id = intval($this->getRequest()->get('additional_category_id'));
@@ -734,7 +735,7 @@ class ProductController extends AbstractCrudController
public function addCombinationAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.products.update")) return $response;
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
$event = new ProductCreateCombinationEvent(
$this->getExistingObject(),
@@ -759,7 +760,7 @@ class ProductController extends AbstractCrudController
public function deleteCombinationAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.products.update")) return $response;
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
$event = new ProductDeleteCombinationEvent(
$this->getExistingObject(),

View File

@@ -0,0 +1,229 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Profile\ProfileEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Form\ProfileCreationForm;
use Thelia\Form\ProfileModificationForm;
use Thelia\Form\ProfileProfileListUpdateForm;
use Thelia\Model\ProfileQuery;
class ProfileController extends AbstractCrudController
{
public function __construct()
{
parent::__construct(
'profile',
'manual',
'order',
AdminResources::PRODUCT_VIEW,
AdminResources::PRODUCT_CREATE,
AdminResources::PRODUCT_UPDATE,
AdminResources::PRODUCT_DELETE,
TheliaEvents::PROFILE_CREATE,
TheliaEvents::PROFILE_UPDATE,
TheliaEvents::PROFILE_DELETE
);
}
protected function getCreationForm()
{
return new ProfileCreationForm($this->getRequest());
}
protected function getUpdateForm()
{
return new ProfileModificationForm($this->getRequest());
}
protected function getCreationEvent($formData)
{
$event = new ProfileEvent();
$event->setLocale($formData['locale']);
$event->setCode($formData['code']);
$event->setTitle($formData['title']);
$event->setChapo($formData['chapo']);
$event->setDescription($formData['description']);
$event->setPostscriptum($formData['postscriptum']);
return $event;
}
protected function getUpdateEvent($formData)
{
$event = new ProfileEvent();
$event->setLocale($formData['locale']);
$event->setId($formData['id']);
$event->setTitle($formData['title']);
$event->setChapo($formData['chapo']);
$event->setDescription($formData['description']);
$event->setPostscriptum($formData['postscriptum']);
return $event;
}
protected function getDeleteEvent()
{
$event = new ProfileEvent();
$event->setId(
$this->getRequest()->get('profile_id', 0)
);
return $event;
}
protected function eventContainsObject($event)
{
return $event->hasProfile();
}
protected function hydrateObjectForm($object)
{
$data = array(
'id' => $object->getId(),
'locale' => $object->getLocale(),
'title' => $object->getTitle(),
'description' => $object->getDescription(),
'code' => $object->getCode(),
);
// Setup the object form
return new ProfileModificationForm($this->getRequest(), "form", $data);
}
protected function getObjectFromEvent($event)
{
return $event->hasProfile() ? $event->getProfile() : null;
}
protected function getExistingObject()
{
return ProfileQuery::create()
->joinWithI18n($this->getCurrentEditionLocale())
->findOneById($this->getRequest()->get('profile_id'));
}
protected function getObjectLabel($object)
{
return $object->getTitle();
}
protected function getObjectId($object)
{
return $object->getId();
}
protected function getViewArguments()
{
return array();
}
protected function getRouteArguments($profile_id = null)
{
return array(
'profile_id' => $profile_id === null ? $this->getRequest()->get('profile_id') : $profile_id,
);
}
protected function renderListTemplate($currentOrder)
{
// We always return to the feature edition form
return $this->render(
'profiles',
array()
);
}
protected function renderEditionTemplate()
{
// We always return to the feature edition form
return $this->render('profile-edit', array_merge($this->getViewArguments(), $this->getRouteArguments()));
}
protected function redirectToEditionTemplate($request = null, $country = null)
{
// We always return to the feature edition form
$this->redirectToRoute(
"admin.configuration.profiles.update",
$this->getViewArguments($country),
$this->getRouteArguments()
);
}
/**
* Put in this method post object creation processing if required.
*
* @param ProfileEvent $createEvent the create event
* @return Response a response, or null to continue normal processing
*/
protected function performAdditionalCreateAction($createEvent)
{
$this->redirectToRoute(
"admin.configuration.profiles.update",
$this->getViewArguments(),
$this->getRouteArguments($createEvent->getProfile()->getId())
);
}
protected function redirectToListTemplate()
{
$this->redirectToRoute(
"admin.configuration.profiles.list"
);
}
protected function checkRequirements($formData)
{
$type = $formData['type'];
}
protected function getRequirements($type, $formData)
{
$requirements = array();
foreach($formData as $data => $value) {
if(!strstr($data, ':')) {
continue;
}
$couple = explode(':', $data);
if(count($couple) != 2 || $couple[0] != $type) {
continue;
}
$requirements[$couple[1]] = $value;
}
return $requirements;
}
}

View File

@@ -22,6 +22,7 @@
/*************************************************************************************/
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\ShippingZone\ShippingZoneAddAreaEvent;
use Thelia\Core\Event\ShippingZone\ShippingZoneRemoveAreaEvent;
use Thelia\Core\Event\TheliaEvents;
@@ -40,13 +41,13 @@ class ShippingZoneController extends BaseAdminController
public function indexAction()
{
if (null !== $response = $this->checkAuth("admin.shipping-zones.view")) return $response;
if (null !== $response = $this->checkAuth(AdminResources::SHIPPING_ZONE_VIEW)) return $response;
return $this->render("shipping-zones", array("display_shipping_zone" => 20));
}
public function updateAction($shipping_zones_id)
{
if (null !== $response = $this->checkAuth("admin.shipping-zones.view")) return $response;
if (null !== $response = $this->checkAuth(AdminResources::SHIPPING_ZONE_VIEW)) return $response;
return $this->render("shipping-zones-edit", array(
"shipping_zones_id" => $shipping_zones_id
));
@@ -57,7 +58,7 @@ class ShippingZoneController extends BaseAdminController
*/
public function addArea()
{
if (null !== $response = $this->checkAuth("admin.shipping-zones.update")) return $response;
if (null !== $response = $this->checkAuth(AdminResources::SHIPPING_ZONE_UPDATE)) return $response;
$shippingAreaForm = new ShippingZoneAddArea($this->getRequest());
$error_msg = null;
@@ -92,7 +93,7 @@ class ShippingZoneController extends BaseAdminController
public function removeArea()
{
if (null !== $response = $this->checkAuth("admin.shipping-zones.update")) return $response;
if (null !== $response = $this->checkAuth(AdminResources::SHIPPING_ZONE_UPDATE)) return $response;
$shippingAreaForm = new ShippingZoneRemoveArea($this->getRequest());
$error_msg = null;

View File

@@ -23,6 +23,7 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Tax\TaxEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Form\TaxCreationForm;
@@ -39,10 +40,10 @@ class TaxController extends AbstractCrudController
'manual',
'order',
'admin.configuration.tax.view',
'admin.configuration.tax.create',
'admin.configuration.tax.update',
'admin.configuration.tax.delete',
AdminResources::TAX_VIEW,
AdminResources::TAX_CREATE,
AdminResources::TAX_UPDATE,
AdminResources::TAX_DELETE,
TheliaEvents::TAX_CREATE,
TheliaEvents::TAX_UPDATE,

View File

@@ -23,6 +23,7 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Tax\TaxRuleEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Form\TaxRuleCreationForm;
@@ -40,10 +41,10 @@ class TaxRuleController extends AbstractCrudController
'manual',
'order',
'admin.configuration.taxrule.view',
'admin.configuration.taxrule.create',
'admin.configuration.taxrule.update',
'admin.configuration.taxrule.delete',
AdminResources::TAX_VIEW,
AdminResources::TAX_CREATE,
AdminResources::TAX_UPDATE,
AdminResources::TAX_DELETE,
TheliaEvents::TAX_RULE_CREATE,
TheliaEvents::TAX_RULE_UPDATE,
@@ -256,7 +257,7 @@ class TaxRuleController extends AbstractCrudController
public function processUpdateTaxesAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth('admin.configuration.taxrule.update')) return $response;
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
$error_msg = false;

View File

@@ -23,6 +23,7 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Template\TemplateDeleteEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Template\TemplateUpdateEvent;
@@ -51,10 +52,10 @@ class TemplateController extends AbstractCrudController
null,
null,
'admin.configuration.templates.view',
'admin.configuration.templates.create',
'admin.configuration.templates.update',
'admin.configuration.templates.delete',
AdminResources::TEMPLATE_VIEW,
AdminResources::TEMPLATE_CREATE,
AdminResources::TEMPLATE_UPDATE,
AdminResources::TEMPLATE_DELETE,
TheliaEvents::TEMPLATE_CREATE,
TheliaEvents::TEMPLATE_UPDATE,
@@ -212,7 +213,7 @@ class TemplateController extends AbstractCrudController
public function addAttributeAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.configuration.template.attribute.add")) return $response;
if (null !== $response = $this->checkAuth(AdminResources::TEMPLATE_UPDATE)) return $response;
$attribute_id = intval($this->getRequest()->get('attribute_id'));
@@ -236,7 +237,7 @@ class TemplateController extends AbstractCrudController
public function deleteAttributeAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.configuration.template.attribute.delete")) return $response;
if (null !== $response = $this->checkAuth(AdminResources::TEMPLATE_UPDATE)) return $response;
$event = new TemplateDeleteAttributeEvent(
$this->getExistingObject(),
@@ -271,7 +272,7 @@ class TemplateController extends AbstractCrudController
public function addFeatureAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.configuration.template.feature.add")) return $response;
if (null !== $response = $this->checkAuth(AdminResources::TEMPLATE_UPDATE)) return $response;
$feature_id = intval($this->getRequest()->get('feature_id'));
@@ -295,7 +296,7 @@ class TemplateController extends AbstractCrudController
public function deleteFeatureAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.configuration.template.feature.delete")) return $response;
if (null !== $response = $this->checkAuth(AdminResources::TEMPLATE_UPDATE)) return $response;
$event = new TemplateDeleteFeatureEvent(
$this->getExistingObject(),

View File

@@ -0,0 +1,131 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
namespace Thelia\Core\Event\Profile;
use Thelia\Core\Event\ActionEvent;
use Thelia\Model\Profile;
class ProfileEvent extends ActionEvent
{
protected $profile = null;
protected $id = null;
protected $locale = null;
protected $code = null;
protected $title = null;
protected $chapo = null;
protected $description = null;
protected $postscriptum = null;
public function __construct(Profile $profile = null)
{
$this->profile = $profile;
}
public function hasProfile()
{
return ! is_null($this->profile);
}
public function getProfile()
{
return $this->profile;
}
public function setProfile(Profile $profile)
{
$this->profile = $profile;
return $this;
}
public function setId($id)
{
$this->id = $id;
}
public function getId()
{
return $this->id;
}
public function setCode($code)
{
$this->code = $code;
}
public function getCode()
{
return $this->code;
}
public function setChapo($chapo)
{
$this->chapo = $chapo;
}
public function getChapo()
{
return $this->chapo;
}
public function setDescription($description)
{
$this->description = $description;
}
public function getDescription()
{
return $this->description;
}
public function setLocale($locale)
{
$this->locale = $locale;
}
public function getLocale()
{
return $this->locale;
}
public function setPostscriptum($postscriptum)
{
$this->postscriptum = $postscriptum;
}
public function getPostscriptum()
{
return $this->postscriptum;
}
public function setTitle($title)
{
$this->title = $title;
}
public function getTitle()
{
return $this->title;
}
}

View File

@@ -546,6 +546,13 @@ final class TheliaEvents
const TAX_UPDATE = "action.updateTax";
const TAX_DELETE = "action.deleteTax";
// -- Profile management ---------------------------------------------
const PROFILE_CREATE = "action.createProfile";
const PROFILE_UPDATE = "action.updateProfile";
const PROFILE_DELETE = "action.deleteProfile";
// -- Tax Rules management ---------------------------------------------
const TAX_RULE_CREATE = "action.createTaxRule";

View File

@@ -21,19 +21,19 @@
/* */
/*************************************************************************************/
namespace Thelia\Controller\Admin;
namespace Thelia\Core\Security\Exception;
/**
* Class AdminProfileController
* @package Thelia\Controller\Admin
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class AdminProfileController extends BaseAdminController
class ResourceException extends \RuntimeException
{
public function defaultAction()
const UNKNOWN_EXCEPTION = 0;
const RESOURCE_NOT_FOUND = 404;
public function __construct($message, $code = null, $previous = null)
{
if (null !== $response = $this->checkAuth("admin.admin-profile.view")) return $response;
return $this->render("admin-profiles", array("display_admin_profile" => 20));
if ($code === null) {
$code = self::UNKNOWN_EXCEPTION;
}
parent::__construct($message, $code, $previous);
}
}
}

View File

@@ -0,0 +1,169 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
namespace Thelia\Core\Event;
use Thelia\Core\Security\Exception\ResourceException;
/**
*
* This class contains all Thelia admin resources
*
* @author Etienne roudeix <eroudeix@openstudio.fr>
*/
final class AdminResources
{
static private $selfReflection = null;
static public function retrieve($name, $action)
{
$contantName = strtoupper($name . '_' . $action);
if(null === self::$selfReflection) {
self::$selfReflection = new \ReflectionClass(__CLASS__);
}
if(self::$selfReflection->hasConstant($contantName)) {
return self::$selfReflection->getConstant($contantName);
} else {
throw new ResourceException(sprintf('Resource `%s` not found', $contantName), ResourceException::RESOURCE_NOT_FOUND);
}
}
const SUPERADMINISTRATOR = "SUPERADMINISTRATOR";
const ADDRESS_VIEW = "admin.address.view";
const ADDRESS_CREATE = "admin.address.create";
const ADDRESS_UPDATE = "admin.address.update";
const ADDRESS_DELETE = "admin.address.delete";
const ADMIN_VIEW = "admin.configuration.admin.view";
const ADMIN_CREATE = "admin.configuration.admin.create";
const ADMIN_UPDATE = "admin.configuration.admin.update";
const ADMIN_DELETE = "admin.configuration.admin.delete";
const AREA_VIEW = "admin.configuration.area.view";
const AREA_CREATE = "admin.configuration.area.create";
const AREA_UPDATE = "admin.configuration.area.update";
const AREA_DELETE = "admin.configuration.area.delete";
const ATTRIBUTE_VIEW = "admin.configuration.attribute.view";
const ATTRIBUTE_CREATE = "admin.configuration.attribute.create";
const ATTRIBUTE_UPDATE = "admin.configuration.attribute.update";
const ATTRIBUTE_DELETE = "admin.configuration.attribute.delete";
const CATEGORY_VIEW = "admin.category.view";
const CATEGORY_CREATE = "admin.category.create";
const CATEGORY_UPDATE = "admin.category.update";
const CATEGORY_DELETE = "admin.category.delete";
const CONFIG_VIEW = "admin.configuration.view";
const CONFIG_CREATE = "admin.configuration.create";
const CONFIG_UPDATE = "admin.configuration.update";
const CONFIG_DELETE = "admin.configuration.delete";
const CONTENT_VIEW = "admin.content.view";
const CONTENT_CREATE = "admin.content.create";
const CONTENT_UPDATE = "admin.content.update";
const CONTENT_DELETE = "admin.content.delete";
const COUNTRY_VIEW = "admin.configuration.country.view";
const COUNTRY_CREATE = "admin.configuration.country.create";
const COUNTRY_UPDATE = "admin.configuration.country.update";
const COUNTRY_DELETE = "admin.configuration.country.delete";
const COUPON_VIEW = "admin.coupon.view";
const COUPON_CREATE = "admin.coupon.create";
const COUPON_UPDATE = "admin.coupon.update";
const COUPON_DELETE = "admin.coupon.delete";
const CURRENCY_VIEW = "admin.configuration.currency.view";
const CURRENCY_CREATE = "admin.configuration.currency.create";
const CURRENCY_UPDATE = "admin.configuration.currency.update";
const CURRENCY_DELETE = "admin.configuration.currency.delete";
const CUSTOMER_VIEW = "admin.customer.view";
const CUSTOMER_CREATE = "admin.customer.create";
const CUSTOMER_UPDATE = "admin.customer.update";
const CUSTOMER_DELETE = "admin.customer.delete";
const FEATURE_VIEW = "admin.configuration.feature.view";
const FEATURE_CREATE = "admin.configuration.feature.create";
const FEATURE_UPDATE = "admin.configuration.feature.update";
const FEATURE_DELETE = "admin.configuration.feature.delete";
const FOLDER_VIEW = "admin.folder.view";
const FOLDER_CREATE = "admin.folder.create";
const FOLDER_UPDATE = "admin.folder.update";
const FOLDER_DELETE = "admin.folder.delete";
const LANGUAGE_VIEW = "admin.configuration.language.view";
const LANGUAGE_CREATE = "admin.configuration.language.create";
const LANGUAGE_UPDATE = "admin.configuration.language.update";
const LANGUAGE_DELETE = "admin.configuration.language.delete";
const MAILING_SYSTEM_VIEW = "admin.configuration.mailing-system.view";
const MAILING_SYSTEM_CREATE = "admin.configuration.mailing-system.create";
const MAILING_SYSTEM_UPDATE = "admin.configuration.mailing-system.update";
const MAILING_SYSTEM_DELETE = "admin.configuration.mailing-system.delete";
const MESSAGE_VIEW = "admin.configuration.message.view";
const MESSAGE_CREATE = "admin.configuration.message.create";
const MESSAGE_UPDATE = "admin.configuration.message.update";
const MESSAGE_DELETE = "admin.configuration.message.delete";
const MODULE_VIEW = "admin.configuration.module.view";
const MODULE_CREATE = "admin.configuration.module.create";
const MODULE_UPDATE = "admin.configuration.module.update";
const MODULE_DELETE = "admin.configuration.module.delete";
const ORDER_VIEW = "admin.order.view";
const ORDER_CREATE = "admin.order.create";
const ORDER_UPDATE = "admin.order.update";
const ORDER_DELETE = "admin.order.delete";
const PRODUCT_VIEW = "admin.product.view";
const PRODUCT_CREATE = "admin.product.create";
const PRODUCT_UPDATE = "admin.product.update";
const PRODUCT_DELETE = "admin.product.delete";
const PROFILE_VIEW = "admin.configuration.profile.view";
const PROFILE_CREATE = "admin.configuration.profile.create";
const PROFILE_UPDATE = "admin.configuration.profile.update";
const PROFILE_DELETE = "admin.configuration.profile.delete";
const SHIPPING_ZONE_VIEW = "admin.configuration.shipping-zone.view";
const SHIPPING_ZONE_CREATE = "admin.configuration.shipping-zone.create";
const SHIPPING_ZONE_UPDATE = "admin.configuration.shipping-zone.update";
const SHIPPING_ZONE_DELETE = "admin.configuration.shipping-zone.delete";
const TAX_VIEW = "admin.configuration.tax.view";
const TAX_CREATE = "admin.configuration.tax.create";
const TAX_UPDATE = "admin.configuration.tax.update";
const TAX_DELETE = "admin.configuration.tax.delete";
const TEMPLATE_VIEW = "admin.configuration.template.view";
const TEMPLATE_CREATE = "admin.configuration.template.create";
const TEMPLATE_UPDATE = "admin.configuration.template.update";
const TEMPLATE_DELETE = "admin.configuration.template.delete";
}

View File

@@ -23,8 +23,12 @@
namespace Thelia\Core\Security;
use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Security\User\UserInterface;
use Thelia\Core\HttpFoundation\Request;
use Thelia\Model\ProfileQuery;
use Thelia\Model\ProfileResourceQuery;
/**
* A simple security manager, in charge of checking user
@@ -124,6 +128,10 @@ class SecurityContext
*/
final public function isGranted(array $roles, array $permissions)
{
if (empty($permissions)) {
return true;
}
// Find a user which matches the required roles.
$user = $this->getCustomerUser();
@@ -135,38 +143,31 @@ class SecurityContext
}
}
if ($user != null) {
if (empty($permissions)) {
return true;
}
// Get permissions from profile
// $userPermissions = $user->getPermissions(); FIXME
// TODO: Finalize permissions system !;
$userPermissions = array('*'); // FIXME !
$permissionsFound = true;
// User have all permissions ?
if (in_array('*', $userPermissions))
return true;
// Check that user's permissions matches required permissions
foreach ($permissions as $permission) {
if (! in_array($permission, $userPermissions)) {
$permissionsFound = false;
break;
}
}
return $permissionsFound;
if (null === $user) {
return false;
}
return false;
if( !method_exists($user, 'getProfileId') ) {
return false;
}
$userPermissions = $user->getPermissions();
if($userPermissions === AdminResources::SUPERADMINISTRATOR) {
return true;
}
foreach($permissions as $permission) {
if($permission === '') {
continue;
}
if(! in_array($permission, $userPermissions)) {
return false;
}
}
return true;
}
/**

View File

@@ -0,0 +1,104 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
namespace Thelia\Core\Template\Loop;
use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Core\Template\Element\BaseI18nLoop;
use Thelia\Core\Template\Element\LoopResult;
use Thelia\Core\Template\Element\LoopResultRow;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\AdminQuery;
use Thelia\Type;
use Thelia\Type\BooleanOrBothType;
/**
*
* Admin loop
*
*
* Class Admin
* @package Thelia\Core\Template\Loop
* @author Etienne Roudeix <eroudeix@openstudio.fr>
*/
class Admin extends BaseI18nLoop
{
public $timestampable = true;
/**
* @return ArgumentCollection
*/
protected function getArgDefinitions()
{
return new ArgumentCollection(
Argument::createIntListTypeArgument('id'),
Argument::createIntListTypeArgument('profile')
);
}
/**
* @param $pagination
*
* @return \Thelia\Core\Template\Element\LoopResult
*/
public function exec(&$pagination)
{
$search = AdminQuery::create();
$id = $this->getId();
if (null !== $id) {
$search->filterById($id, Criteria::IN);
}
$profile = $this->getProfile();
if (null !== $profile) {
$search->filterByProfileId($profile, Criteria::IN);
}
$search->orderByFirstname(Criteria::ASC);
/* perform search */
$features = $this->search($search, $pagination);
$loopResult = new LoopResult($features);
foreach ($features as $feature) {
$loopResultRow = new LoopResultRow($loopResult, $feature, $this->versionable, $this->timestampable, $this->countable);
$loopResultRow->set("ID", $feature->getId())
->set("PROFILE",$feature->getProfileId())
->set("FIRSTNAME",$feature->getFirstname())
->set("LASTNAME",$feature->getLastname())
->set("LOGIN",$feature->getLogin())
;
$loopResult->addRow($loopResultRow);
}
return $loopResult;
}
}

View File

@@ -0,0 +1,103 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
namespace Thelia\Core\Template\Loop;
use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Core\Template\Element\BaseI18nLoop;
use Thelia\Core\Template\Element\LoopResult;
use Thelia\Core\Template\Element\LoopResultRow;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\ProfileQuery;
use Thelia\Type;
use Thelia\Type\BooleanOrBothType;
/**
*
* Profile loop
*
*
* Class Profile
* @package Thelia\Core\Template\Loop
* @author Etienne Roudeix <eroudeix@openstudio.fr>
*/
class Profile extends BaseI18nLoop
{
public $timestampable = true;
/**
* @return ArgumentCollection
*/
protected function getArgDefinitions()
{
return new ArgumentCollection(
Argument::createIntListTypeArgument('id')
);
}
/**
* @param $pagination
*
* @return \Thelia\Core\Template\Element\LoopResult
*/
public function exec(&$pagination)
{
$search = ProfileQuery::create();
/* manage translations */
$locale = $this->configureI18nProcessing($search);
$id = $this->getId();
if (null !== $id) {
$search->filterById($id, Criteria::IN);
}
$search->orderById(Criteria::ASC);
/* perform search */
$features = $this->search($search, $pagination);
$loopResult = new LoopResult($features);
foreach ($features as $feature) {
$loopResultRow = new LoopResultRow($loopResult, $feature, $this->versionable, $this->timestampable, $this->countable);
$loopResultRow->set("ID", $feature->getId())
->set("IS_TRANSLATED",$feature->getVirtualColumn('IS_TRANSLATED'))
->set("LOCALE",$locale)
->set("CODE",$feature->getCode())
->set("TITLE",$feature->getVirtualColumn('i18n_TITLE'))
->set("CHAPO", $feature->getVirtualColumn('i18n_CHAPO'))
->set("DESCRIPTION", $feature->getVirtualColumn('i18n_DESCRIPTION'))
->set("POSTSCRIPTUM", $feature->getVirtualColumn('i18n_POSTSCRIPTUM'))
;
$loopResult->addRow($loopResultRow);
}
return $loopResult;
}
}

View File

@@ -0,0 +1,80 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
namespace Thelia\Form;
use Symfony\Component\Validator\Constraints;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Core\Translation\Translator;
use Thelia\Model\ProfileQuery;
/**
* Class ProfileCreationForm
* @package Thelia\Form
* @author Etienne Roudeix <eroudeix@openstudio.fr>
*/
class ProfileCreationForm extends BaseForm
{
use StandardDescriptionFieldsTrait;
protected function buildForm($change_mode = false)
{
$this->formBuilder
->add("locale", "text", array(
"constraints" => array(new NotBlank())
))
->add("code", "text", array(
"constraints" => array(
new NotBlank(),
new Constraints\Callback(
array(
"methods" => array(
array($this, "verifyCode"),
),
)
),
),
"label" => Translator::getInstance()->trans("Profile Code"),
"label_attr" => array("for" => "profile_code_fiels"),
))
;
$this->addStandardDescFields(array('locale'));
}
public function getName()
{
return "thelia_profile_creation";
}
public function verifyCode($value, ExecutionContextInterface $context)
{
/* check unicity */
$profile = ProfileQuery::create()
->findOneByCode($value);
if (null !== $profile) {
$context->addViolation("Profile `code` already exists");
}
}
}

View File

@@ -1,7 +1,7 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
@@ -17,102 +17,57 @@
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
namespace Thelia\Form;
use Symfony\Component\Validator\Constraints;
use Thelia\Core\Translation\Translator;
use Thelia\Model\ConfigQuery;
use Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Model\ProfileQuery;
/**
* Class ProfileModification
* Class ProfileModificationForm
* @package Thelia\Form
* @author Manuel Raynaud <mraynaud@openstudio.fr>
* @author Etienne Roudeix <eroudeix@openstudio.fr>
*/
class ProfileModificationForm extends BaseForm
class ProfileModificationForm extends ProfileCreationForm
{
protected function buildForm()
{
parent::buildForm(true);
$this->formBuilder
->add("firstname", "text", array(
"constraints" => array(
new Constraints\NotBlank()
),
"label" => Translator::getInstance()->trans("First Name"),
"label_attr" => array(
"for" => "firstname"
)
))
->add("lastname", "text", array(
"constraints" => array(
new Constraints\NotBlank()
),
"label" => Translator::getInstance()->trans("Last Name"),
"label_attr" => array(
"for" => "lastname"
)
))
->add("default_language", "text", array(
"constraints" => array(
new Constraints\NotBlank()
),
"label" => Translator::getInstance()->trans("Default language"),
"label_attr" => array(
"for" => "default_language"
)
))
->add("editing_language_default", "text", array(
"constraints" => array(
new Constraints\NotBlank()
),
"label" => Translator::getInstance()->trans("Editing language default"),
"label_attr" => array(
"for" => "editing_language_default"
)
))
->add("old_password", "password", array(
->add("id", "hidden", array(
"required" => true,
"constraints" => array(
new Constraints\NotBlank(),
new Constraints\Length(array("min" => ConfigQuery::read("password.length", 4)))
),
"label" => Translator::getInstance()->trans("Old password"),
"label_attr" => array(
"for" => "old_password"
)
))
->add("password", "password", array(
"constraints" => array(
new Constraints\NotBlank(),
new Constraints\Length(array("min" => ConfigQuery::read("password.length", 4)))
),
"label" => Translator::getInstance()->trans("Password"),
"label_attr" => array(
"for" => "password"
)
))
->add("password_confirm", "password", array(
"constraints" => array(
new Constraints\NotBlank(),
new Constraints\Length(array("min" => ConfigQuery::read("password.length", 4))),
new Constraints\Callback(array("methods" => array(
array($this, "verifyPasswordField")
)))
),
"label" => "Password confirmation",
"label_attr" => array(
"for" => "password_confirmation"
new Constraints\Callback(
array(
"methods" => array(
array($this, "verifyProfileId"),
),
)
),
)
))
;
$this->formBuilder->remove("code");
}
public function getName()
{
return "thelia_profile_modification";
}
public function verifyProfileId($value, ExecutionContextInterface $context)
{
$profile = ProfileQuery::create()
->findPk($value);
if (null === $profile) {
$context->addViolation("Profile ID not found");
}
}
}

View File

@@ -24,12 +24,16 @@ namespace Thelia\Form;
use Symfony\Component\Validator\Constraints;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Core\Form\Type\TheliaType;
use Thelia\Core\Translation\Translator;
use Thelia\TaxEngine\TaxEngine;
use Thelia\TaxEngine\TaxType;
/**
* Class TaxCreationForm
* @package Thelia\Form
* @author Etienne Roudeix <eroudeix@openstudio.fr>
*/
class TaxCreationForm extends BaseForm
{
use StandardDescriptionFieldsTrait;

View File

@@ -26,6 +26,11 @@ use Symfony\Component\Validator\Constraints;
use Symfony\Component\Validator\ExecutionContextInterface;
use Thelia\Model\TaxQuery;
/**
* Class TaxModificationForm
* @package Thelia\Form
* @author Etienne Roudeix <eroudeix@openstudio.fr>
*/
class TaxModificationForm extends TaxCreationForm
{
protected function buildForm()

View File

@@ -2,6 +2,8 @@
namespace Thelia\Model;
use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Security\User\UserInterface;
use Thelia\Core\Security\Role\Role;
@@ -21,6 +23,28 @@ use Propel\Runtime\Connection\ConnectionInterface;
*/
class Admin extends BaseAdmin implements UserInterface
{
public function getPermissions()
{
$profileId = $this->getProfileId();
if( null === $profileId ) {
return AdminResources::SUPERADMINISTRATOR;
}
$userPermissionsQuery = ProfileResourceQuery::create()
->joinResource("resource", Criteria::LEFT_JOIN)
->withColumn('resource.code', 'code')
->filterByProfileId($profileId)
->find();
$userPermissions = array();
foreach($userPermissionsQuery as $userPermission) {
$userPermissions[] = $userPermission->getVirtualColumn('code');
}
return $userPermissions;
}
/**
* {@inheritDoc}
*/

View File

@@ -1,9 +0,0 @@
<?php
namespace Thelia\Model;
use Thelia\Model\Base\AdminGroup as BaseAdminGroup;
class AdminGroup extends BaseAdminGroup {
}

View File

@@ -1,20 +0,0 @@
<?php
namespace Thelia\Model;
use Thelia\Model\Base\AdminGroupQuery as BaseAdminGroupQuery;
/**
* Skeleton subclass for performing query and update operations on the 'admin_group' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
*/
class AdminGroupQuery extends BaseAdminGroupQuery {
} // AdminGroupQuery

View File

@@ -10,7 +10,6 @@ use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Propel\Runtime\ActiveRecord\ActiveRecordInterface;
use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\BadMethodCallException;
use Propel\Runtime\Exception\PropelException;
@@ -18,11 +17,9 @@ use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Parser\AbstractParser;
use Propel\Runtime\Util\PropelDateTime;
use Thelia\Model\Admin as ChildAdmin;
use Thelia\Model\AdminGroup as ChildAdminGroup;
use Thelia\Model\AdminGroupQuery as ChildAdminGroupQuery;
use Thelia\Model\AdminQuery as ChildAdminQuery;
use Thelia\Model\Group as ChildGroup;
use Thelia\Model\GroupQuery as ChildGroupQuery;
use Thelia\Model\Profile as ChildProfile;
use Thelia\Model\ProfileQuery as ChildProfileQuery;
use Thelia\Model\Map\AdminTableMap;
abstract class Admin implements ActiveRecordInterface
@@ -65,6 +62,12 @@ abstract class Admin implements ActiveRecordInterface
*/
protected $id;
/**
* The value for the profile_id field.
* @var int
*/
protected $profile_id;
/**
* The value for the firstname field.
* @var string
@@ -126,15 +129,9 @@ abstract class Admin implements ActiveRecordInterface
protected $updated_at;
/**
* @var ObjectCollection|ChildAdminGroup[] Collection to store aggregation of ChildAdminGroup objects.
* @var Profile
*/
protected $collAdminGroups;
protected $collAdminGroupsPartial;
/**
* @var ChildGroup[] Collection to store aggregation of ChildGroup objects.
*/
protected $collGroups;
protected $aProfile;
/**
* Flag to prevent endless save loop, if this object is referenced
@@ -144,18 +141,6 @@ abstract class Admin implements ActiveRecordInterface
*/
protected $alreadyInSave = false;
/**
* An array of objects scheduled for deletion.
* @var ObjectCollection
*/
protected $groupsScheduledForDeletion = null;
/**
* An array of objects scheduled for deletion.
* @var ObjectCollection
*/
protected $adminGroupsScheduledForDeletion = null;
/**
* Initializes internal state of Thelia\Model\Base\Admin object.
*/
@@ -425,6 +410,17 @@ abstract class Admin implements ActiveRecordInterface
return $this->id;
}
/**
* Get the [profile_id] column value.
*
* @return int
*/
public function getProfileId()
{
return $this->profile_id;
}
/**
* Get the [firstname] column value.
*
@@ -574,6 +570,31 @@ abstract class Admin implements ActiveRecordInterface
return $this;
} // setId()
/**
* Set the value of [profile_id] column.
*
* @param int $v new value
* @return \Thelia\Model\Admin The current object (for fluent API support)
*/
public function setProfileId($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->profile_id !== $v) {
$this->profile_id = $v;
$this->modifiedColumns[] = AdminTableMap::PROFILE_ID;
}
if ($this->aProfile !== null && $this->aProfile->getId() !== $v) {
$this->aProfile = null;
}
return $this;
} // setProfileId()
/**
* Set the value of [firstname] column.
*
@@ -824,37 +845,40 @@ abstract class Admin implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : AdminTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$this->id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : AdminTableMap::translateFieldName('Firstname', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : AdminTableMap::translateFieldName('ProfileId', TableMap::TYPE_PHPNAME, $indexType)];
$this->profile_id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : AdminTableMap::translateFieldName('Firstname', TableMap::TYPE_PHPNAME, $indexType)];
$this->firstname = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : AdminTableMap::translateFieldName('Lastname', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : AdminTableMap::translateFieldName('Lastname', TableMap::TYPE_PHPNAME, $indexType)];
$this->lastname = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : AdminTableMap::translateFieldName('Login', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : AdminTableMap::translateFieldName('Login', TableMap::TYPE_PHPNAME, $indexType)];
$this->login = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : AdminTableMap::translateFieldName('Password', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : AdminTableMap::translateFieldName('Password', TableMap::TYPE_PHPNAME, $indexType)];
$this->password = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : AdminTableMap::translateFieldName('Algo', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : AdminTableMap::translateFieldName('Algo', TableMap::TYPE_PHPNAME, $indexType)];
$this->algo = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : AdminTableMap::translateFieldName('Salt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : AdminTableMap::translateFieldName('Salt', TableMap::TYPE_PHPNAME, $indexType)];
$this->salt = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : AdminTableMap::translateFieldName('RememberMeToken', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : AdminTableMap::translateFieldName('RememberMeToken', TableMap::TYPE_PHPNAME, $indexType)];
$this->remember_me_token = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : AdminTableMap::translateFieldName('RememberMeSerial', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : AdminTableMap::translateFieldName('RememberMeSerial', TableMap::TYPE_PHPNAME, $indexType)];
$this->remember_me_serial = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : AdminTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : AdminTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
$this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : AdminTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 11 + $startcol : AdminTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -867,7 +891,7 @@ abstract class Admin implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 11; // 11 = AdminTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 12; // 12 = AdminTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\Admin object", 0, $e);
@@ -889,6 +913,9 @@ abstract class Admin implements ActiveRecordInterface
*/
public function ensureConsistency()
{
if ($this->aProfile !== null && $this->profile_id !== $this->aProfile->getId()) {
$this->aProfile = null;
}
} // ensureConsistency
/**
@@ -928,9 +955,7 @@ abstract class Admin implements ActiveRecordInterface
if ($deep) { // also de-associate any related objects?
$this->collAdminGroups = null;
$this->collGroups = null;
$this->aProfile = null;
} // if (deep)
}
@@ -1053,6 +1078,18 @@ abstract class Admin implements ActiveRecordInterface
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->aProfile !== null) {
if ($this->aProfile->isModified() || $this->aProfile->isNew()) {
$affectedRows += $this->aProfile->save($con);
}
$this->setProfile($this->aProfile);
}
if ($this->isNew() || $this->isModified()) {
// persist changes
if ($this->isNew()) {
@@ -1064,50 +1101,6 @@ abstract class Admin implements ActiveRecordInterface
$this->resetModified();
}
if ($this->groupsScheduledForDeletion !== null) {
if (!$this->groupsScheduledForDeletion->isEmpty()) {
$pks = array();
$pk = $this->getPrimaryKey();
foreach ($this->groupsScheduledForDeletion->getPrimaryKeys(false) as $remotePk) {
$pks[] = array($remotePk, $pk);
}
AdminGroupQuery::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->adminGroupsScheduledForDeletion !== null) {
if (!$this->adminGroupsScheduledForDeletion->isEmpty()) {
\Thelia\Model\AdminGroupQuery::create()
->filterByPrimaryKeys($this->adminGroupsScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
$this->adminGroupsScheduledForDeletion = null;
}
}
if ($this->collAdminGroups !== null) {
foreach ($this->collAdminGroups as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con);
}
}
}
$this->alreadyInSave = false;
}
@@ -1137,6 +1130,9 @@ abstract class Admin implements ActiveRecordInterface
if ($this->isColumnModified(AdminTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID';
}
if ($this->isColumnModified(AdminTableMap::PROFILE_ID)) {
$modifiedColumns[':p' . $index++] = 'PROFILE_ID';
}
if ($this->isColumnModified(AdminTableMap::FIRSTNAME)) {
$modifiedColumns[':p' . $index++] = 'FIRSTNAME';
}
@@ -1181,6 +1177,9 @@ abstract class Admin implements ActiveRecordInterface
case 'ID':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break;
case 'PROFILE_ID':
$stmt->bindValue($identifier, $this->profile_id, PDO::PARAM_INT);
break;
case 'FIRSTNAME':
$stmt->bindValue($identifier, $this->firstname, PDO::PARAM_STR);
break;
@@ -1277,33 +1276,36 @@ abstract class Admin implements ActiveRecordInterface
return $this->getId();
break;
case 1:
return $this->getFirstname();
return $this->getProfileId();
break;
case 2:
return $this->getLastname();
return $this->getFirstname();
break;
case 3:
return $this->getLogin();
return $this->getLastname();
break;
case 4:
return $this->getPassword();
return $this->getLogin();
break;
case 5:
return $this->getAlgo();
return $this->getPassword();
break;
case 6:
return $this->getSalt();
return $this->getAlgo();
break;
case 7:
return $this->getRememberMeToken();
return $this->getSalt();
break;
case 8:
return $this->getRememberMeSerial();
return $this->getRememberMeToken();
break;
case 9:
return $this->getCreatedAt();
return $this->getRememberMeSerial();
break;
case 10:
return $this->getCreatedAt();
break;
case 11:
return $this->getUpdatedAt();
break;
default:
@@ -1336,16 +1338,17 @@ abstract class Admin implements ActiveRecordInterface
$keys = AdminTableMap::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getFirstname(),
$keys[2] => $this->getLastname(),
$keys[3] => $this->getLogin(),
$keys[4] => $this->getPassword(),
$keys[5] => $this->getAlgo(),
$keys[6] => $this->getSalt(),
$keys[7] => $this->getRememberMeToken(),
$keys[8] => $this->getRememberMeSerial(),
$keys[9] => $this->getCreatedAt(),
$keys[10] => $this->getUpdatedAt(),
$keys[1] => $this->getProfileId(),
$keys[2] => $this->getFirstname(),
$keys[3] => $this->getLastname(),
$keys[4] => $this->getLogin(),
$keys[5] => $this->getPassword(),
$keys[6] => $this->getAlgo(),
$keys[7] => $this->getSalt(),
$keys[8] => $this->getRememberMeToken(),
$keys[9] => $this->getRememberMeSerial(),
$keys[10] => $this->getCreatedAt(),
$keys[11] => $this->getUpdatedAt(),
);
$virtualColumns = $this->virtualColumns;
foreach ($virtualColumns as $key => $virtualColumn) {
@@ -1353,8 +1356,8 @@ abstract class Admin implements ActiveRecordInterface
}
if ($includeForeignObjects) {
if (null !== $this->collAdminGroups) {
$result['AdminGroups'] = $this->collAdminGroups->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
if (null !== $this->aProfile) {
$result['Profile'] = $this->aProfile->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
}
@@ -1394,33 +1397,36 @@ abstract class Admin implements ActiveRecordInterface
$this->setId($value);
break;
case 1:
$this->setFirstname($value);
$this->setProfileId($value);
break;
case 2:
$this->setLastname($value);
$this->setFirstname($value);
break;
case 3:
$this->setLogin($value);
$this->setLastname($value);
break;
case 4:
$this->setPassword($value);
$this->setLogin($value);
break;
case 5:
$this->setAlgo($value);
$this->setPassword($value);
break;
case 6:
$this->setSalt($value);
$this->setAlgo($value);
break;
case 7:
$this->setRememberMeToken($value);
$this->setSalt($value);
break;
case 8:
$this->setRememberMeSerial($value);
$this->setRememberMeToken($value);
break;
case 9:
$this->setCreatedAt($value);
$this->setRememberMeSerial($value);
break;
case 10:
$this->setCreatedAt($value);
break;
case 11:
$this->setUpdatedAt($value);
break;
} // switch()
@@ -1448,16 +1454,17 @@ abstract class Admin implements ActiveRecordInterface
$keys = AdminTableMap::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setFirstname($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setLastname($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setLogin($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setPassword($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setAlgo($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setSalt($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setRememberMeToken($arr[$keys[7]]);
if (array_key_exists($keys[8], $arr)) $this->setRememberMeSerial($arr[$keys[8]]);
if (array_key_exists($keys[9], $arr)) $this->setCreatedAt($arr[$keys[9]]);
if (array_key_exists($keys[10], $arr)) $this->setUpdatedAt($arr[$keys[10]]);
if (array_key_exists($keys[1], $arr)) $this->setProfileId($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setFirstname($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setLastname($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setLogin($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setPassword($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setAlgo($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setSalt($arr[$keys[7]]);
if (array_key_exists($keys[8], $arr)) $this->setRememberMeToken($arr[$keys[8]]);
if (array_key_exists($keys[9], $arr)) $this->setRememberMeSerial($arr[$keys[9]]);
if (array_key_exists($keys[10], $arr)) $this->setCreatedAt($arr[$keys[10]]);
if (array_key_exists($keys[11], $arr)) $this->setUpdatedAt($arr[$keys[11]]);
}
/**
@@ -1470,6 +1477,7 @@ abstract class Admin implements ActiveRecordInterface
$criteria = new Criteria(AdminTableMap::DATABASE_NAME);
if ($this->isColumnModified(AdminTableMap::ID)) $criteria->add(AdminTableMap::ID, $this->id);
if ($this->isColumnModified(AdminTableMap::PROFILE_ID)) $criteria->add(AdminTableMap::PROFILE_ID, $this->profile_id);
if ($this->isColumnModified(AdminTableMap::FIRSTNAME)) $criteria->add(AdminTableMap::FIRSTNAME, $this->firstname);
if ($this->isColumnModified(AdminTableMap::LASTNAME)) $criteria->add(AdminTableMap::LASTNAME, $this->lastname);
if ($this->isColumnModified(AdminTableMap::LOGIN)) $criteria->add(AdminTableMap::LOGIN, $this->login);
@@ -1543,6 +1551,7 @@ abstract class Admin implements ActiveRecordInterface
*/
public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setProfileId($this->getProfileId());
$copyObj->setFirstname($this->getFirstname());
$copyObj->setLastname($this->getLastname());
$copyObj->setLogin($this->getLogin());
@@ -1553,20 +1562,6 @@ abstract class Admin implements ActiveRecordInterface
$copyObj->setRememberMeSerial($this->getRememberMeSerial());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
if ($deepCopy) {
// important: temporarily setNew(false) because this affects the behavior of
// the getter/setter methods for fkey referrer objects.
$copyObj->setNew(false);
foreach ($this->getAdminGroups() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addAdminGroup($relObj->copy($deepCopy));
}
}
} // if ($deepCopy)
if ($makeNew) {
$copyObj->setNew(true);
$copyObj->setId(NULL); // this is a auto-increment column, so set to default value
@@ -1595,449 +1590,55 @@ abstract class Admin implements ActiveRecordInterface
return $copyObj;
}
/**
* 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.
* Declares an association between this object and a ChildProfile object.
*
* @param string $relationName The name of the relation to initialize
* @return void
*/
public function initRelation($relationName)
{
if ('AdminGroup' == $relationName) {
return $this->initAdminGroups();
}
}
/**
* Clears out the collAdminGroups 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 void
* @see addAdminGroups()
*/
public function clearAdminGroups()
{
$this->collAdminGroups = null; // important to set this to NULL since that means it is uninitialized
}
/**
* Reset is the collAdminGroups collection loaded partially.
*/
public function resetPartialAdminGroups($v = true)
{
$this->collAdminGroupsPartial = $v;
}
/**
* Initializes the collAdminGroups collection.
*
* By default this just sets the collAdminGroups collection to an empty array (like clearcollAdminGroups());
* 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 initAdminGroups($overrideExisting = true)
{
if (null !== $this->collAdminGroups && !$overrideExisting) {
return;
}
$this->collAdminGroups = new ObjectCollection();
$this->collAdminGroups->setModel('\Thelia\Model\AdminGroup');
}
/**
* Gets an array of ChildAdminGroup 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 ChildAdmin 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 ConnectionInterface $con optional connection object
* @return Collection|ChildAdminGroup[] List of ChildAdminGroup objects
* @param ChildProfile $v
* @return \Thelia\Model\Admin The current object (for fluent API support)
* @throws PropelException
*/
public function getAdminGroups($criteria = null, ConnectionInterface $con = null)
public function setProfile(ChildProfile $v = null)
{
$partial = $this->collAdminGroupsPartial && !$this->isNew();
if (null === $this->collAdminGroups || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collAdminGroups) {
// return empty collection
$this->initAdminGroups();
} else {
$collAdminGroups = ChildAdminGroupQuery::create(null, $criteria)
->filterByAdmin($this)
->find($con);
if (null !== $criteria) {
if (false !== $this->collAdminGroupsPartial && count($collAdminGroups)) {
$this->initAdminGroups(false);
foreach ($collAdminGroups as $obj) {
if (false == $this->collAdminGroups->contains($obj)) {
$this->collAdminGroups->append($obj);
}
}
$this->collAdminGroupsPartial = true;
}
$collAdminGroups->getInternalIterator()->rewind();
return $collAdminGroups;
}
if ($partial && $this->collAdminGroups) {
foreach ($this->collAdminGroups as $obj) {
if ($obj->isNew()) {
$collAdminGroups[] = $obj;
}
}
}
$this->collAdminGroups = $collAdminGroups;
$this->collAdminGroupsPartial = false;
}
}
return $this->collAdminGroups;
}
/**
* Sets a collection of AdminGroup 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 Collection $adminGroups A Propel collection.
* @param ConnectionInterface $con Optional connection object
* @return ChildAdmin The current object (for fluent API support)
*/
public function setAdminGroups(Collection $adminGroups, ConnectionInterface $con = null)
{
$adminGroupsToDelete = $this->getAdminGroups(new Criteria(), $con)->diff($adminGroups);
//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->adminGroupsScheduledForDeletion = clone $adminGroupsToDelete;
foreach ($adminGroupsToDelete as $adminGroupRemoved) {
$adminGroupRemoved->setAdmin(null);
}
$this->collAdminGroups = null;
foreach ($adminGroups as $adminGroup) {
$this->addAdminGroup($adminGroup);
}
$this->collAdminGroups = $adminGroups;
$this->collAdminGroupsPartial = false;
return $this;
}
/**
* Returns the number of related AdminGroup objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param ConnectionInterface $con
* @return int Count of related AdminGroup objects.
* @throws PropelException
*/
public function countAdminGroups(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collAdminGroupsPartial && !$this->isNew();
if (null === $this->collAdminGroups || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collAdminGroups) {
return 0;
}
if ($partial && !$criteria) {
return count($this->getAdminGroups());
}
$query = ChildAdminGroupQuery::create(null, $criteria);
if ($distinct) {
$query->distinct();
}
return $query
->filterByAdmin($this)
->count($con);
}
return count($this->collAdminGroups);
}
/**
* Method called to associate a ChildAdminGroup object to this object
* through the ChildAdminGroup foreign key attribute.
*
* @param ChildAdminGroup $l ChildAdminGroup
* @return \Thelia\Model\Admin The current object (for fluent API support)
*/
public function addAdminGroup(ChildAdminGroup $l)
{
if ($this->collAdminGroups === null) {
$this->initAdminGroups();
$this->collAdminGroupsPartial = true;
}
if (!in_array($l, $this->collAdminGroups->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddAdminGroup($l);
}
return $this;
}
/**
* @param AdminGroup $adminGroup The adminGroup object to add.
*/
protected function doAddAdminGroup($adminGroup)
{
$this->collAdminGroups[]= $adminGroup;
$adminGroup->setAdmin($this);
}
/**
* @param AdminGroup $adminGroup The adminGroup object to remove.
* @return ChildAdmin The current object (for fluent API support)
*/
public function removeAdminGroup($adminGroup)
{
if ($this->getAdminGroups()->contains($adminGroup)) {
$this->collAdminGroups->remove($this->collAdminGroups->search($adminGroup));
if (null === $this->adminGroupsScheduledForDeletion) {
$this->adminGroupsScheduledForDeletion = clone $this->collAdminGroups;
$this->adminGroupsScheduledForDeletion->clear();
}
$this->adminGroupsScheduledForDeletion[]= clone $adminGroup;
$adminGroup->setAdmin(null);
}
return $this;
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this Admin is new, it will return
* an empty collection; or if this Admin has previously
* been saved, it will retrieve related AdminGroups 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 Admin.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildAdminGroup[] List of ChildAdminGroup objects
*/
public function getAdminGroupsJoinGroup($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildAdminGroupQuery::create(null, $criteria);
$query->joinWith('Group', $joinBehavior);
return $this->getAdminGroups($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 void
* @see addGroups()
*/
public function clearGroups()
{
$this->collGroups = null; // important to set this to NULL since that means it is uninitialized
$this->collGroupsPartial = null;
}
/**
* 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 ObjectCollection();
$this->collGroups->setModel('\Thelia\Model\Group');
}
/**
* Gets a collection of ChildGroup objects related by a many-to-many relationship
* to the current object by way of the admin_group 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 ChildAdmin 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 ConnectionInterface $con Optional connection object
*
* @return ObjectCollection|ChildGroup[] List of ChildGroup objects
*/
public function getGroups($criteria = null, ConnectionInterface $con = null)
{
if (null === $this->collGroups || null !== $criteria) {
if ($this->isNew() && null === $this->collGroups) {
// return empty collection
$this->initGroups();
} else {
$collGroups = ChildGroupQuery::create(null, $criteria)
->filterByAdmin($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 admin_group 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 Collection $groups A Propel collection.
* @param ConnectionInterface $con Optional connection object
* @return ChildAdmin The current object (for fluent API support)
*/
public function setGroups(Collection $groups, ConnectionInterface $con = null)
{
$this->clearGroups();
$currentGroups = $this->getGroups();
$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 ChildGroup objects related by a many-to-many relationship
* to the current object by way of the admin_group cross-reference table.
*
* @param Criteria $criteria Optional query object to filter the query
* @param boolean $distinct Set to true to force count distinct
* @param ConnectionInterface $con Optional connection object
*
* @return int the number of related ChildGroup objects
*/
public function countGroups($criteria = null, $distinct = false, ConnectionInterface $con = null)
{
if (null === $this->collGroups || null !== $criteria) {
if ($this->isNew() && null === $this->collGroups) {
return 0;
} else {
$query = ChildGroupQuery::create(null, $criteria);
if ($distinct) {
$query->distinct();
}
return $query
->filterByAdmin($this)
->count($con);
}
if ($v === null) {
$this->setProfileId(NULL);
} else {
return count($this->collGroups);
}
}
/**
* Associate a ChildGroup object to this object
* through the admin_group cross reference table.
*
* @param ChildGroup $group The ChildAdminGroup object to relate
* @return ChildAdmin The current object (for fluent API support)
*/
public function addGroup(ChildGroup $group)
{
if ($this->collGroups === null) {
$this->initGroups();
$this->setProfileId($v->getId());
}
if (!$this->collGroups->contains($group)) { // only add it if the **same** object is not already associated
$this->doAddGroup($group);
$this->collGroups[] = $group;
$this->aProfile = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the ChildProfile object, it will not be re-added.
if ($v !== null) {
$v->addAdmin($this);
}
return $this;
}
/**
* @param Group $group The group object to add.
*/
protected function doAddGroup($group)
{
$adminGroup = new ChildAdminGroup();
$adminGroup->setGroup($group);
$this->addAdminGroup($adminGroup);
// set the back reference to this object directly as using provided method either results
// in endless loop or in multiple relations
if (!$group->getAdmins()->contains($this)) {
$foreignCollection = $group->getAdmins();
$foreignCollection[] = $this;
}
}
/**
* Remove a ChildGroup object to this object
* through the admin_group cross reference table.
* Get the associated ChildProfile object
*
* @param ChildGroup $group The ChildAdminGroup object to relate
* @return ChildAdmin The current object (for fluent API support)
* @param ConnectionInterface $con Optional Connection object.
* @return ChildProfile The associated ChildProfile object.
* @throws PropelException
*/
public function removeGroup(ChildGroup $group)
public function getProfile(ConnectionInterface $con = null)
{
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;
if ($this->aProfile === null && ($this->profile_id !== null)) {
$this->aProfile = ChildProfileQuery::create()->findPk($this->profile_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->aProfile->addAdmins($this);
*/
}
return $this;
return $this->aProfile;
}
/**
@@ -2046,6 +1647,7 @@ abstract class Admin implements ActiveRecordInterface
public function clear()
{
$this->id = null;
$this->profile_id = null;
$this->firstname = null;
$this->lastname = null;
$this->login = null;
@@ -2075,26 +1677,9 @@ abstract class Admin implements ActiveRecordInterface
public function clearAllReferences($deep = false)
{
if ($deep) {
if ($this->collAdminGroups) {
foreach ($this->collAdminGroups as $o) {
$o->clearAllReferences($deep);
}
}
if ($this->collGroups) {
foreach ($this->collGroups as $o) {
$o->clearAllReferences($deep);
}
}
} // if ($deep)
if ($this->collAdminGroups instanceof Collection) {
$this->collAdminGroups->clearIterator();
}
$this->collAdminGroups = null;
if ($this->collGroups instanceof Collection) {
$this->collGroups->clearIterator();
}
$this->collGroups = null;
$this->aProfile = null;
}
/**

File diff suppressed because it is too large Load Diff

View File

@@ -1,778 +0,0 @@
<?php
namespace Thelia\Model\Base;
use \Exception;
use \PDO;
use Propel\Runtime\Propel;
use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Propel\Runtime\ActiveQuery\ModelJoin;
use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
use Thelia\Model\AdminGroup as ChildAdminGroup;
use Thelia\Model\AdminGroupQuery as ChildAdminGroupQuery;
use Thelia\Model\Map\AdminGroupTableMap;
/**
* Base class that represents a query for the 'admin_group' table.
*
*
*
* @method ChildAdminGroupQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildAdminGroupQuery orderByGroupId($order = Criteria::ASC) Order by the group_id column
* @method ChildAdminGroupQuery orderByAdminId($order = Criteria::ASC) Order by the admin_id column
* @method ChildAdminGroupQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildAdminGroupQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildAdminGroupQuery groupById() Group by the id column
* @method ChildAdminGroupQuery groupByGroupId() Group by the group_id column
* @method ChildAdminGroupQuery groupByAdminId() Group by the admin_id column
* @method ChildAdminGroupQuery groupByCreatedAt() Group by the created_at column
* @method ChildAdminGroupQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildAdminGroupQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildAdminGroupQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildAdminGroupQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildAdminGroupQuery leftJoinGroup($relationAlias = null) Adds a LEFT JOIN clause to the query using the Group relation
* @method ChildAdminGroupQuery rightJoinGroup($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Group relation
* @method ChildAdminGroupQuery innerJoinGroup($relationAlias = null) Adds a INNER JOIN clause to the query using the Group relation
*
* @method ChildAdminGroupQuery leftJoinAdmin($relationAlias = null) Adds a LEFT JOIN clause to the query using the Admin relation
* @method ChildAdminGroupQuery rightJoinAdmin($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Admin relation
* @method ChildAdminGroupQuery innerJoinAdmin($relationAlias = null) Adds a INNER JOIN clause to the query using the Admin relation
*
* @method ChildAdminGroup findOne(ConnectionInterface $con = null) Return the first ChildAdminGroup matching the query
* @method ChildAdminGroup findOneOrCreate(ConnectionInterface $con = null) Return the first ChildAdminGroup matching the query, or a new ChildAdminGroup object populated from the query conditions when no match is found
*
* @method ChildAdminGroup findOneById(int $id) Return the first ChildAdminGroup filtered by the id column
* @method ChildAdminGroup findOneByGroupId(int $group_id) Return the first ChildAdminGroup filtered by the group_id column
* @method ChildAdminGroup findOneByAdminId(int $admin_id) Return the first ChildAdminGroup filtered by the admin_id column
* @method ChildAdminGroup findOneByCreatedAt(string $created_at) Return the first ChildAdminGroup filtered by the created_at column
* @method ChildAdminGroup findOneByUpdatedAt(string $updated_at) Return the first ChildAdminGroup filtered by the updated_at column
*
* @method array findById(int $id) Return ChildAdminGroup objects filtered by the id column
* @method array findByGroupId(int $group_id) Return ChildAdminGroup objects filtered by the group_id column
* @method array findByAdminId(int $admin_id) Return ChildAdminGroup objects filtered by the admin_id column
* @method array findByCreatedAt(string $created_at) Return ChildAdminGroup objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildAdminGroup objects filtered by the updated_at column
*
*/
abstract class AdminGroupQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\AdminGroupQuery object.
*
* @param string $dbName The database name
* @param string $modelName The phpName of a model, e.g. 'Book'
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
*/
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\AdminGroup', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildAdminGroupQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildAdminGroupQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\AdminGroupQuery) {
return $criteria;
}
$query = new \Thelia\Model\AdminGroupQuery();
if (null !== $modelAlias) {
$query->setModelAlias($modelAlias);
}
if ($criteria instanceof Criteria) {
$query->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.
*
* <code>
* $obj = $c->findPk(array(12, 34, 56), $con);
* </code>
*
* @param array[$id, $group_id, $admin_id] $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildAdminGroup|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = AdminGroupTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1], (string) $key[2]))))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(AdminGroupTableMap::DATABASE_NAME);
}
$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 ConnectionInterface $con A connection object
*
* @return ChildAdminGroup A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, GROUP_ID, ADMIN_ID, CREATED_AT, UPDATED_AT FROM admin_group WHERE ID = :p0 AND GROUP_ID = :p1 AND ADMIN_ID = :p2';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
$stmt->bindValue(':p1', $key[1], PDO::PARAM_INT);
$stmt->bindValue(':p2', $key[2], 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), 0, $e);
}
$obj = null;
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
$obj = new ChildAdminGroup();
$obj->hydrate($row);
AdminGroupTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1], (string) $key[2])));
}
$stmt->closeCursor();
return $obj;
}
/**
* Find object by primary key.
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
* @return ChildAdminGroup|array|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;
$dataFetcher = $criteria
->filterByPrimaryKey($key)
->doSelect($con);
return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
}
/**
* Find objects by primary key
* <code>
* $objs = $c->findPks(array(array(12, 56), array(832, 123), array(123, 456)), $con);
* </code>
* @param array $keys Primary keys to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
*/
public function findPks($keys, $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
}
$this->basePreSelect($con);
$criteria = $this->isKeepQuery() ? clone $this : $this;
$dataFetcher = $criteria
->filterByPrimaryKeys($keys)
->doSelect($con);
return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
}
/**
* Filter the query by primary key
*
* @param mixed $key Primary key to use for the query
*
* @return ChildAdminGroupQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
$this->addUsingAlias(AdminGroupTableMap::ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(AdminGroupTableMap::GROUP_ID, $key[1], Criteria::EQUAL);
$this->addUsingAlias(AdminGroupTableMap::ADMIN_ID, $key[2], 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 ChildAdminGroupQuery 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(AdminGroupTableMap::ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(AdminGroupTableMap::GROUP_ID, $key[1], Criteria::EQUAL);
$cton0->addAnd($cton1);
$cton2 = $this->getNewCriterion(AdminGroupTableMap::ADMIN_ID, $key[2], Criteria::EQUAL);
$cton0->addAnd($cton2);
$this->addOr($cton0);
}
return $this;
}
/**
* Filter the query on the id column
*
* Example usage:
* <code>
* $query->filterById(1234); // WHERE id = 1234
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
* $query->filterById(array('min' => 12)); // WHERE id > 12
* </code>
*
* @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 ChildAdminGroupQuery 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(AdminGroupTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(AdminGroupTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AdminGroupTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the group_id column
*
* Example usage:
* <code>
* $query->filterByGroupId(1234); // WHERE group_id = 1234
* $query->filterByGroupId(array(12, 34)); // WHERE group_id IN (12, 34)
* $query->filterByGroupId(array('min' => 12)); // WHERE group_id > 12
* </code>
*
* @see filterByGroup()
*
* @param mixed $groupId 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 ChildAdminGroupQuery The current query, for fluid interface
*/
public function filterByGroupId($groupId = null, $comparison = null)
{
if (is_array($groupId)) {
$useMinMax = false;
if (isset($groupId['min'])) {
$this->addUsingAlias(AdminGroupTableMap::GROUP_ID, $groupId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($groupId['max'])) {
$this->addUsingAlias(AdminGroupTableMap::GROUP_ID, $groupId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AdminGroupTableMap::GROUP_ID, $groupId, $comparison);
}
/**
* Filter the query on the admin_id column
*
* Example usage:
* <code>
* $query->filterByAdminId(1234); // WHERE admin_id = 1234
* $query->filterByAdminId(array(12, 34)); // WHERE admin_id IN (12, 34)
* $query->filterByAdminId(array('min' => 12)); // WHERE admin_id > 12
* </code>
*
* @see filterByAdmin()
*
* @param mixed $adminId 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 ChildAdminGroupQuery The current query, for fluid interface
*/
public function filterByAdminId($adminId = null, $comparison = null)
{
if (is_array($adminId)) {
$useMinMax = false;
if (isset($adminId['min'])) {
$this->addUsingAlias(AdminGroupTableMap::ADMIN_ID, $adminId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($adminId['max'])) {
$this->addUsingAlias(AdminGroupTableMap::ADMIN_ID, $adminId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AdminGroupTableMap::ADMIN_ID, $adminId, $comparison);
}
/**
* Filter the query on the created_at column
*
* Example usage:
* <code>
* $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'
* </code>
*
* @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 ChildAdminGroupQuery 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(AdminGroupTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(AdminGroupTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AdminGroupTableMap::CREATED_AT, $createdAt, $comparison);
}
/**
* Filter the query on the updated_at column
*
* Example usage:
* <code>
* $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'
* </code>
*
* @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 ChildAdminGroupQuery 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(AdminGroupTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(AdminGroupTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AdminGroupTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Group object
*
* @param \Thelia\Model\Group|ObjectCollection $group The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAdminGroupQuery The current query, for fluid interface
*/
public function filterByGroup($group, $comparison = null)
{
if ($group instanceof \Thelia\Model\Group) {
return $this
->addUsingAlias(AdminGroupTableMap::GROUP_ID, $group->getId(), $comparison);
} elseif ($group instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(AdminGroupTableMap::GROUP_ID, $group->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByGroup() only accepts arguments of type \Thelia\Model\Group or Collection');
}
}
/**
* 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 ChildAdminGroupQuery 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 \Thelia\Model\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', '\Thelia\Model\GroupQuery');
}
/**
* Filter the query by a related \Thelia\Model\Admin object
*
* @param \Thelia\Model\Admin|ObjectCollection $admin The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAdminGroupQuery The current query, for fluid interface
*/
public function filterByAdmin($admin, $comparison = null)
{
if ($admin instanceof \Thelia\Model\Admin) {
return $this
->addUsingAlias(AdminGroupTableMap::ADMIN_ID, $admin->getId(), $comparison);
} elseif ($admin instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(AdminGroupTableMap::ADMIN_ID, $admin->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByAdmin() only accepts arguments of type \Thelia\Model\Admin or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Admin relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAdminGroupQuery The current query, for fluid interface
*/
public function joinAdmin($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Admin');
// 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, 'Admin');
}
return $this;
}
/**
* Use the Admin relation Admin 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 \Thelia\Model\AdminQuery A secondary query class using the current class as primary query
*/
public function useAdminQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinAdmin($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Admin', '\Thelia\Model\AdminQuery');
}
/**
* Exclude object from result
*
* @param ChildAdminGroup $adminGroup Object to remove from the list of results
*
* @return ChildAdminGroupQuery The current query, for fluid interface
*/
public function prune($adminGroup = null)
{
if ($adminGroup) {
$this->addCond('pruneCond0', $this->getAliasedColName(AdminGroupTableMap::ID), $adminGroup->getId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(AdminGroupTableMap::GROUP_ID), $adminGroup->getGroupId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond2', $this->getAliasedColName(AdminGroupTableMap::ADMIN_ID), $adminGroup->getAdminId(), Criteria::NOT_EQUAL);
$this->combine(array('pruneCond0', 'pruneCond1', 'pruneCond2'), Criteria::LOGICAL_OR);
}
return $this;
}
/**
* Deletes all rows from the admin_group table.
*
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
*/
public function doDeleteAll(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(AdminGroupTableMap::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 += parent::doDeleteAll($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).
AdminGroupTableMap::clearInstancePool();
AdminGroupTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildAdminGroup or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildAdminGroup object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param ConnectionInterface $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 function delete(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(AdminGroupTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(AdminGroupTableMap::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();
AdminGroupTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
AdminGroupTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
// timestampable behavior
/**
* Filter by the latest updated
*
* @param int $nbDays Maximum age of the latest update in days
*
* @return ChildAdminGroupQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(AdminGroupTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildAdminGroupQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(AdminGroupTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildAdminGroupQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(AdminGroupTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildAdminGroupQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(AdminGroupTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildAdminGroupQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(AdminGroupTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildAdminGroupQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(AdminGroupTableMap::CREATED_AT);
}
} // AdminGroupQuery

View File

@@ -22,6 +22,7 @@ use Thelia\Model\Map\AdminTableMap;
*
*
* @method ChildAdminQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildAdminQuery orderByProfileId($order = Criteria::ASC) Order by the profile_id column
* @method ChildAdminQuery orderByFirstname($order = Criteria::ASC) Order by the firstname column
* @method ChildAdminQuery orderByLastname($order = Criteria::ASC) Order by the lastname column
* @method ChildAdminQuery orderByLogin($order = Criteria::ASC) Order by the login column
@@ -34,6 +35,7 @@ use Thelia\Model\Map\AdminTableMap;
* @method ChildAdminQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildAdminQuery groupById() Group by the id column
* @method ChildAdminQuery groupByProfileId() Group by the profile_id column
* @method ChildAdminQuery groupByFirstname() Group by the firstname column
* @method ChildAdminQuery groupByLastname() Group by the lastname column
* @method ChildAdminQuery groupByLogin() Group by the login column
@@ -49,14 +51,15 @@ use Thelia\Model\Map\AdminTableMap;
* @method ChildAdminQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildAdminQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildAdminQuery leftJoinAdminGroup($relationAlias = null) Adds a LEFT JOIN clause to the query using the AdminGroup relation
* @method ChildAdminQuery rightJoinAdminGroup($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AdminGroup relation
* @method ChildAdminQuery innerJoinAdminGroup($relationAlias = null) Adds a INNER JOIN clause to the query using the AdminGroup relation
* @method ChildAdminQuery leftJoinProfile($relationAlias = null) Adds a LEFT JOIN clause to the query using the Profile relation
* @method ChildAdminQuery rightJoinProfile($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Profile relation
* @method ChildAdminQuery innerJoinProfile($relationAlias = null) Adds a INNER JOIN clause to the query using the Profile relation
*
* @method ChildAdmin findOne(ConnectionInterface $con = null) Return the first ChildAdmin matching the query
* @method ChildAdmin findOneOrCreate(ConnectionInterface $con = null) Return the first ChildAdmin matching the query, or a new ChildAdmin object populated from the query conditions when no match is found
*
* @method ChildAdmin findOneById(int $id) Return the first ChildAdmin filtered by the id column
* @method ChildAdmin findOneByProfileId(int $profile_id) Return the first ChildAdmin filtered by the profile_id column
* @method ChildAdmin findOneByFirstname(string $firstname) Return the first ChildAdmin filtered by the firstname column
* @method ChildAdmin findOneByLastname(string $lastname) Return the first ChildAdmin filtered by the lastname column
* @method ChildAdmin findOneByLogin(string $login) Return the first ChildAdmin filtered by the login column
@@ -69,6 +72,7 @@ use Thelia\Model\Map\AdminTableMap;
* @method ChildAdmin findOneByUpdatedAt(string $updated_at) Return the first ChildAdmin filtered by the updated_at column
*
* @method array findById(int $id) Return ChildAdmin objects filtered by the id column
* @method array findByProfileId(int $profile_id) Return ChildAdmin objects filtered by the profile_id column
* @method array findByFirstname(string $firstname) Return ChildAdmin objects filtered by the firstname column
* @method array findByLastname(string $lastname) Return ChildAdmin objects filtered by the lastname column
* @method array findByLogin(string $login) Return ChildAdmin objects filtered by the login column
@@ -167,7 +171,7 @@ abstract class AdminQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, FIRSTNAME, LASTNAME, LOGIN, PASSWORD, ALGO, SALT, REMEMBER_ME_TOKEN, REMEMBER_ME_SERIAL, CREATED_AT, UPDATED_AT FROM admin WHERE ID = :p0';
$sql = 'SELECT ID, PROFILE_ID, FIRSTNAME, LASTNAME, LOGIN, PASSWORD, ALGO, SALT, REMEMBER_ME_TOKEN, REMEMBER_ME_SERIAL, CREATED_AT, UPDATED_AT FROM admin WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -297,6 +301,49 @@ abstract class AdminQuery extends ModelCriteria
return $this->addUsingAlias(AdminTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the profile_id column
*
* Example usage:
* <code>
* $query->filterByProfileId(1234); // WHERE profile_id = 1234
* $query->filterByProfileId(array(12, 34)); // WHERE profile_id IN (12, 34)
* $query->filterByProfileId(array('min' => 12)); // WHERE profile_id > 12
* </code>
*
* @see filterByProfile()
*
* @param mixed $profileId 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 ChildAdminQuery The current query, for fluid interface
*/
public function filterByProfileId($profileId = null, $comparison = null)
{
if (is_array($profileId)) {
$useMinMax = false;
if (isset($profileId['min'])) {
$this->addUsingAlias(AdminTableMap::PROFILE_ID, $profileId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($profileId['max'])) {
$this->addUsingAlias(AdminTableMap::PROFILE_ID, $profileId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AdminTableMap::PROFILE_ID, $profileId, $comparison);
}
/**
* Filter the query on the firstname column
*
@@ -616,40 +663,42 @@ abstract class AdminQuery extends ModelCriteria
}
/**
* Filter the query by a related \Thelia\Model\AdminGroup object
* Filter the query by a related \Thelia\Model\Profile object
*
* @param \Thelia\Model\AdminGroup|ObjectCollection $adminGroup the related object to use as filter
* @param \Thelia\Model\Profile|ObjectCollection $profile The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAdminQuery The current query, for fluid interface
*/
public function filterByAdminGroup($adminGroup, $comparison = null)
public function filterByProfile($profile, $comparison = null)
{
if ($adminGroup instanceof \Thelia\Model\AdminGroup) {
if ($profile instanceof \Thelia\Model\Profile) {
return $this
->addUsingAlias(AdminTableMap::ID, $adminGroup->getAdminId(), $comparison);
} elseif ($adminGroup instanceof ObjectCollection) {
->addUsingAlias(AdminTableMap::PROFILE_ID, $profile->getId(), $comparison);
} elseif ($profile instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->useAdminGroupQuery()
->filterByPrimaryKeys($adminGroup->getPrimaryKeys())
->endUse();
->addUsingAlias(AdminTableMap::PROFILE_ID, $profile->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByAdminGroup() only accepts arguments of type \Thelia\Model\AdminGroup or Collection');
throw new PropelException('filterByProfile() only accepts arguments of type \Thelia\Model\Profile or Collection');
}
}
/**
* Adds a JOIN clause to the query using the AdminGroup relation
* Adds a JOIN clause to the query using the Profile relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAdminQuery The current query, for fluid interface
*/
public function joinAdminGroup($relationAlias = null, $joinType = Criteria::INNER_JOIN)
public function joinProfile($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('AdminGroup');
$relationMap = $tableMap->getRelation('Profile');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -664,14 +713,14 @@ abstract class AdminQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'AdminGroup');
$this->addJoinObject($join, 'Profile');
}
return $this;
}
/**
* Use the AdminGroup relation AdminGroup object
* Use the Profile relation Profile object
*
* @see useQuery()
*
@@ -679,30 +728,13 @@ abstract class AdminQuery extends ModelCriteria
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \Thelia\Model\AdminGroupQuery A secondary query class using the current class as primary query
* @return \Thelia\Model\ProfileQuery A secondary query class using the current class as primary query
*/
public function useAdminGroupQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
public function useProfileQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinAdminGroup($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'AdminGroup', '\Thelia\Model\AdminGroupQuery');
}
/**
* Filter the query by a related Group object
* using the admin_group 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 ChildAdminQuery The current query, for fluid interface
*/
public function filterByGroup($group, $comparison = Criteria::EQUAL)
{
return $this
->useAdminGroupQuery()
->filterByGroup($group, $comparison)
->endUse();
->joinProfile($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Profile', '\Thelia\Model\ProfileQuery');
}
/**

View File

@@ -19,8 +19,6 @@ use Propel\Runtime\Parser\AbstractParser;
use Propel\Runtime\Util\PropelDateTime;
use Thelia\Model\AreaDeliveryModule as ChildAreaDeliveryModule;
use Thelia\Model\AreaDeliveryModuleQuery as ChildAreaDeliveryModuleQuery;
use Thelia\Model\GroupModule as ChildGroupModule;
use Thelia\Model\GroupModuleQuery as ChildGroupModuleQuery;
use Thelia\Model\Module as ChildModule;
use Thelia\Model\ModuleI18n as ChildModuleI18n;
use Thelia\Model\ModuleI18nQuery as ChildModuleI18nQuery;
@@ -29,6 +27,8 @@ use Thelia\Model\ModuleImageQuery as ChildModuleImageQuery;
use Thelia\Model\ModuleQuery as ChildModuleQuery;
use Thelia\Model\Order as ChildOrder;
use Thelia\Model\OrderQuery as ChildOrderQuery;
use Thelia\Model\ProfileModule as ChildProfileModule;
use Thelia\Model\ProfileModuleQuery as ChildProfileModuleQuery;
use Thelia\Model\Map\ModuleTableMap;
abstract class Module implements ActiveRecordInterface
@@ -132,10 +132,10 @@ abstract class Module implements ActiveRecordInterface
protected $collAreaDeliveryModulesPartial;
/**
* @var ObjectCollection|ChildGroupModule[] Collection to store aggregation of ChildGroupModule objects.
* @var ObjectCollection|ChildProfileModule[] Collection to store aggregation of ChildProfileModule objects.
*/
protected $collGroupModules;
protected $collGroupModulesPartial;
protected $collProfileModules;
protected $collProfileModulesPartial;
/**
* @var ObjectCollection|ChildModuleImage[] Collection to store aggregation of ChildModuleImage objects.
@@ -193,7 +193,7 @@ abstract class Module implements ActiveRecordInterface
* An array of objects scheduled for deletion.
* @var ObjectCollection
*/
protected $groupModulesScheduledForDeletion = null;
protected $profileModulesScheduledForDeletion = null;
/**
* An array of objects scheduled for deletion.
@@ -880,7 +880,7 @@ abstract class Module implements ActiveRecordInterface
$this->collAreaDeliveryModules = null;
$this->collGroupModules = null;
$this->collProfileModules = null;
$this->collModuleImages = null;
@@ -1070,17 +1070,17 @@ abstract class Module implements ActiveRecordInterface
}
}
if ($this->groupModulesScheduledForDeletion !== null) {
if (!$this->groupModulesScheduledForDeletion->isEmpty()) {
\Thelia\Model\GroupModuleQuery::create()
->filterByPrimaryKeys($this->groupModulesScheduledForDeletion->getPrimaryKeys(false))
if ($this->profileModulesScheduledForDeletion !== null) {
if (!$this->profileModulesScheduledForDeletion->isEmpty()) {
\Thelia\Model\ProfileModuleQuery::create()
->filterByPrimaryKeys($this->profileModulesScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
$this->groupModulesScheduledForDeletion = null;
$this->profileModulesScheduledForDeletion = null;
}
}
if ($this->collGroupModules !== null) {
foreach ($this->collGroupModules as $referrerFK) {
if ($this->collProfileModules !== null) {
foreach ($this->collProfileModules as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con);
}
@@ -1345,8 +1345,8 @@ abstract class Module implements ActiveRecordInterface
if (null !== $this->collAreaDeliveryModules) {
$result['AreaDeliveryModules'] = $this->collAreaDeliveryModules->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collGroupModules) {
$result['GroupModules'] = $this->collGroupModules->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
if (null !== $this->collProfileModules) {
$result['ProfileModules'] = $this->collProfileModules->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collModuleImages) {
$result['ModuleImages'] = $this->collModuleImages->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
@@ -1557,9 +1557,9 @@ abstract class Module implements ActiveRecordInterface
}
}
foreach ($this->getGroupModules() as $relObj) {
foreach ($this->getProfileModules() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addGroupModule($relObj->copy($deepCopy));
$copyObj->addProfileModule($relObj->copy($deepCopy));
}
}
@@ -1625,8 +1625,8 @@ abstract class Module implements ActiveRecordInterface
if ('AreaDeliveryModule' == $relationName) {
return $this->initAreaDeliveryModules();
}
if ('GroupModule' == $relationName) {
return $this->initGroupModules();
if ('ProfileModule' == $relationName) {
return $this->initProfileModules();
}
if ('ModuleImage' == $relationName) {
return $this->initModuleImages();
@@ -2616,31 +2616,31 @@ abstract class Module implements ActiveRecordInterface
}
/**
* Clears out the collGroupModules collection
* Clears out the collProfileModules 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 void
* @see addGroupModules()
* @see addProfileModules()
*/
public function clearGroupModules()
public function clearProfileModules()
{
$this->collGroupModules = null; // important to set this to NULL since that means it is uninitialized
$this->collProfileModules = null; // important to set this to NULL since that means it is uninitialized
}
/**
* Reset is the collGroupModules collection loaded partially.
* Reset is the collProfileModules collection loaded partially.
*/
public function resetPartialGroupModules($v = true)
public function resetPartialProfileModules($v = true)
{
$this->collGroupModulesPartial = $v;
$this->collProfileModulesPartial = $v;
}
/**
* Initializes the collGroupModules collection.
* Initializes the collProfileModules collection.
*
* By default this just sets the collGroupModules collection to an empty array (like clearcollGroupModules());
* By default this just sets the collProfileModules collection to an empty array (like clearcollProfileModules());
* 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.
*
@@ -2649,17 +2649,17 @@ abstract class Module implements ActiveRecordInterface
*
* @return void
*/
public function initGroupModules($overrideExisting = true)
public function initProfileModules($overrideExisting = true)
{
if (null !== $this->collGroupModules && !$overrideExisting) {
if (null !== $this->collProfileModules && !$overrideExisting) {
return;
}
$this->collGroupModules = new ObjectCollection();
$this->collGroupModules->setModel('\Thelia\Model\GroupModule');
$this->collProfileModules = new ObjectCollection();
$this->collProfileModules->setModel('\Thelia\Model\ProfileModule');
}
/**
* Gets an array of ChildGroupModule objects which contain a foreign key that references this object.
* Gets an array of ChildProfileModule 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.
@@ -2669,109 +2669,109 @@ abstract class Module implements ActiveRecordInterface
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @return Collection|ChildGroupModule[] List of ChildGroupModule objects
* @return Collection|ChildProfileModule[] List of ChildProfileModule objects
* @throws PropelException
*/
public function getGroupModules($criteria = null, ConnectionInterface $con = null)
public function getProfileModules($criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collGroupModulesPartial && !$this->isNew();
if (null === $this->collGroupModules || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collGroupModules) {
$partial = $this->collProfileModulesPartial && !$this->isNew();
if (null === $this->collProfileModules || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collProfileModules) {
// return empty collection
$this->initGroupModules();
$this->initProfileModules();
} else {
$collGroupModules = ChildGroupModuleQuery::create(null, $criteria)
$collProfileModules = ChildProfileModuleQuery::create(null, $criteria)
->filterByModule($this)
->find($con);
if (null !== $criteria) {
if (false !== $this->collGroupModulesPartial && count($collGroupModules)) {
$this->initGroupModules(false);
if (false !== $this->collProfileModulesPartial && count($collProfileModules)) {
$this->initProfileModules(false);
foreach ($collGroupModules as $obj) {
if (false == $this->collGroupModules->contains($obj)) {
$this->collGroupModules->append($obj);
foreach ($collProfileModules as $obj) {
if (false == $this->collProfileModules->contains($obj)) {
$this->collProfileModules->append($obj);
}
}
$this->collGroupModulesPartial = true;
$this->collProfileModulesPartial = true;
}
$collGroupModules->getInternalIterator()->rewind();
$collProfileModules->getInternalIterator()->rewind();
return $collGroupModules;
return $collProfileModules;
}
if ($partial && $this->collGroupModules) {
foreach ($this->collGroupModules as $obj) {
if ($partial && $this->collProfileModules) {
foreach ($this->collProfileModules as $obj) {
if ($obj->isNew()) {
$collGroupModules[] = $obj;
$collProfileModules[] = $obj;
}
}
}
$this->collGroupModules = $collGroupModules;
$this->collGroupModulesPartial = false;
$this->collProfileModules = $collProfileModules;
$this->collProfileModulesPartial = false;
}
}
return $this->collGroupModules;
return $this->collProfileModules;
}
/**
* Sets a collection of GroupModule objects related by a one-to-many relationship
* Sets a collection of ProfileModule 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 Collection $groupModules A Propel collection.
* @param Collection $profileModules A Propel collection.
* @param ConnectionInterface $con Optional connection object
* @return ChildModule The current object (for fluent API support)
*/
public function setGroupModules(Collection $groupModules, ConnectionInterface $con = null)
public function setProfileModules(Collection $profileModules, ConnectionInterface $con = null)
{
$groupModulesToDelete = $this->getGroupModules(new Criteria(), $con)->diff($groupModules);
$profileModulesToDelete = $this->getProfileModules(new Criteria(), $con)->diff($profileModules);
$this->groupModulesScheduledForDeletion = $groupModulesToDelete;
$this->profileModulesScheduledForDeletion = $profileModulesToDelete;
foreach ($groupModulesToDelete as $groupModuleRemoved) {
$groupModuleRemoved->setModule(null);
foreach ($profileModulesToDelete as $profileModuleRemoved) {
$profileModuleRemoved->setModule(null);
}
$this->collGroupModules = null;
foreach ($groupModules as $groupModule) {
$this->addGroupModule($groupModule);
$this->collProfileModules = null;
foreach ($profileModules as $profileModule) {
$this->addProfileModule($profileModule);
}
$this->collGroupModules = $groupModules;
$this->collGroupModulesPartial = false;
$this->collProfileModules = $profileModules;
$this->collProfileModulesPartial = false;
return $this;
}
/**
* Returns the number of related GroupModule objects.
* Returns the number of related ProfileModule objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param ConnectionInterface $con
* @return int Count of related GroupModule objects.
* @return int Count of related ProfileModule objects.
* @throws PropelException
*/
public function countGroupModules(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
public function countProfileModules(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collGroupModulesPartial && !$this->isNew();
if (null === $this->collGroupModules || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collGroupModules) {
$partial = $this->collProfileModulesPartial && !$this->isNew();
if (null === $this->collProfileModules || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collProfileModules) {
return 0;
}
if ($partial && !$criteria) {
return count($this->getGroupModules());
return count($this->getProfileModules());
}
$query = ChildGroupModuleQuery::create(null, $criteria);
$query = ChildProfileModuleQuery::create(null, $criteria);
if ($distinct) {
$query->distinct();
}
@@ -2781,53 +2781,53 @@ abstract class Module implements ActiveRecordInterface
->count($con);
}
return count($this->collGroupModules);
return count($this->collProfileModules);
}
/**
* Method called to associate a ChildGroupModule object to this object
* through the ChildGroupModule foreign key attribute.
* Method called to associate a ChildProfileModule object to this object
* through the ChildProfileModule foreign key attribute.
*
* @param ChildGroupModule $l ChildGroupModule
* @param ChildProfileModule $l ChildProfileModule
* @return \Thelia\Model\Module The current object (for fluent API support)
*/
public function addGroupModule(ChildGroupModule $l)
public function addProfileModule(ChildProfileModule $l)
{
if ($this->collGroupModules === null) {
$this->initGroupModules();
$this->collGroupModulesPartial = true;
if ($this->collProfileModules === null) {
$this->initProfileModules();
$this->collProfileModulesPartial = true;
}
if (!in_array($l, $this->collGroupModules->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddGroupModule($l);
if (!in_array($l, $this->collProfileModules->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddProfileModule($l);
}
return $this;
}
/**
* @param GroupModule $groupModule The groupModule object to add.
* @param ProfileModule $profileModule The profileModule object to add.
*/
protected function doAddGroupModule($groupModule)
protected function doAddProfileModule($profileModule)
{
$this->collGroupModules[]= $groupModule;
$groupModule->setModule($this);
$this->collProfileModules[]= $profileModule;
$profileModule->setModule($this);
}
/**
* @param GroupModule $groupModule The groupModule object to remove.
* @param ProfileModule $profileModule The profileModule object to remove.
* @return ChildModule The current object (for fluent API support)
*/
public function removeGroupModule($groupModule)
public function removeProfileModule($profileModule)
{
if ($this->getGroupModules()->contains($groupModule)) {
$this->collGroupModules->remove($this->collGroupModules->search($groupModule));
if (null === $this->groupModulesScheduledForDeletion) {
$this->groupModulesScheduledForDeletion = clone $this->collGroupModules;
$this->groupModulesScheduledForDeletion->clear();
if ($this->getProfileModules()->contains($profileModule)) {
$this->collProfileModules->remove($this->collProfileModules->search($profileModule));
if (null === $this->profileModulesScheduledForDeletion) {
$this->profileModulesScheduledForDeletion = clone $this->collProfileModules;
$this->profileModulesScheduledForDeletion->clear();
}
$this->groupModulesScheduledForDeletion[]= $groupModule;
$groupModule->setModule(null);
$this->profileModulesScheduledForDeletion[]= $profileModule;
$profileModule->setModule(null);
}
return $this;
@@ -2839,7 +2839,7 @@ abstract class Module implements ActiveRecordInterface
* an identical criteria, it returns the collection.
* Otherwise if this Module is new, it will return
* an empty collection; or if this Module has previously
* been saved, it will retrieve related GroupModules from storage.
* been saved, it will retrieve related ProfileModules from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
@@ -2848,14 +2848,14 @@ abstract class Module implements ActiveRecordInterface
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildGroupModule[] List of ChildGroupModule objects
* @return Collection|ChildProfileModule[] List of ChildProfileModule objects
*/
public function getGroupModulesJoinGroup($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
public function getProfileModulesJoinProfile($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildGroupModuleQuery::create(null, $criteria);
$query->joinWith('Group', $joinBehavior);
$query = ChildProfileModuleQuery::create(null, $criteria);
$query->joinWith('Profile', $joinBehavior);
return $this->getGroupModules($query, $con);
return $this->getProfileModules($query, $con);
}
/**
@@ -3348,8 +3348,8 @@ abstract class Module implements ActiveRecordInterface
$o->clearAllReferences($deep);
}
}
if ($this->collGroupModules) {
foreach ($this->collGroupModules as $o) {
if ($this->collProfileModules) {
foreach ($this->collProfileModules as $o) {
$o->clearAllReferences($deep);
}
}
@@ -3381,10 +3381,10 @@ abstract class Module implements ActiveRecordInterface
$this->collAreaDeliveryModules->clearIterator();
}
$this->collAreaDeliveryModules = null;
if ($this->collGroupModules instanceof Collection) {
$this->collGroupModules->clearIterator();
if ($this->collProfileModules instanceof Collection) {
$this->collProfileModules->clearIterator();
}
$this->collGroupModules = null;
$this->collProfileModules = null;
if ($this->collModuleImages instanceof Collection) {
$this->collModuleImages->clearIterator();
}

View File

@@ -56,9 +56,9 @@ use Thelia\Model\Map\ModuleTableMap;
* @method ChildModuleQuery rightJoinAreaDeliveryModule($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AreaDeliveryModule relation
* @method ChildModuleQuery innerJoinAreaDeliveryModule($relationAlias = null) Adds a INNER JOIN clause to the query using the AreaDeliveryModule relation
*
* @method ChildModuleQuery leftJoinGroupModule($relationAlias = null) Adds a LEFT JOIN clause to the query using the GroupModule relation
* @method ChildModuleQuery rightJoinGroupModule($relationAlias = null) Adds a RIGHT JOIN clause to the query using the GroupModule relation
* @method ChildModuleQuery innerJoinGroupModule($relationAlias = null) Adds a INNER JOIN clause to the query using the GroupModule relation
* @method ChildModuleQuery leftJoinProfileModule($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProfileModule relation
* @method ChildModuleQuery rightJoinProfileModule($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProfileModule relation
* @method ChildModuleQuery innerJoinProfileModule($relationAlias = null) Adds a INNER JOIN clause to the query using the ProfileModule relation
*
* @method ChildModuleQuery leftJoinModuleImage($relationAlias = null) Adds a LEFT JOIN clause to the query using the ModuleImage relation
* @method ChildModuleQuery rightJoinModuleImage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ModuleImage relation
@@ -793,40 +793,40 @@ abstract class ModuleQuery extends ModelCriteria
}
/**
* Filter the query by a related \Thelia\Model\GroupModule object
* Filter the query by a related \Thelia\Model\ProfileModule object
*
* @param \Thelia\Model\GroupModule|ObjectCollection $groupModule the related object to use as filter
* @param \Thelia\Model\ProfileModule|ObjectCollection $profileModule the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildModuleQuery The current query, for fluid interface
*/
public function filterByGroupModule($groupModule, $comparison = null)
public function filterByProfileModule($profileModule, $comparison = null)
{
if ($groupModule instanceof \Thelia\Model\GroupModule) {
if ($profileModule instanceof \Thelia\Model\ProfileModule) {
return $this
->addUsingAlias(ModuleTableMap::ID, $groupModule->getModuleId(), $comparison);
} elseif ($groupModule instanceof ObjectCollection) {
->addUsingAlias(ModuleTableMap::ID, $profileModule->getModuleId(), $comparison);
} elseif ($profileModule instanceof ObjectCollection) {
return $this
->useGroupModuleQuery()
->filterByPrimaryKeys($groupModule->getPrimaryKeys())
->useProfileModuleQuery()
->filterByPrimaryKeys($profileModule->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByGroupModule() only accepts arguments of type \Thelia\Model\GroupModule or Collection');
throw new PropelException('filterByProfileModule() only accepts arguments of type \Thelia\Model\ProfileModule or Collection');
}
}
/**
* Adds a JOIN clause to the query using the GroupModule relation
* Adds a JOIN clause to the query using the ProfileModule relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildModuleQuery The current query, for fluid interface
*/
public function joinGroupModule($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function joinProfileModule($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('GroupModule');
$relationMap = $tableMap->getRelation('ProfileModule');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -841,14 +841,14 @@ abstract class ModuleQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'GroupModule');
$this->addJoinObject($join, 'ProfileModule');
}
return $this;
}
/**
* Use the GroupModule relation GroupModule object
* Use the ProfileModule relation ProfileModule object
*
* @see useQuery()
*
@@ -856,13 +856,13 @@ abstract class ModuleQuery extends ModelCriteria
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \Thelia\Model\GroupModuleQuery A secondary query class using the current class as primary query
* @return \Thelia\Model\ProfileModuleQuery A secondary query class using the current class as primary query
*/
public function useGroupModuleQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
public function useProfileModuleQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinGroupModule($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'GroupModule', '\Thelia\Model\GroupModuleQuery');
->joinProfileModule($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'ProfileModule', '\Thelia\Model\ProfileModuleQuery');
}
/**

View File

@@ -145,6 +145,12 @@ abstract class OrderProduct implements ActiveRecordInterface
*/
protected $weight;
/**
* The value for the ean_code field.
* @var string
*/
protected $ean_code;
/**
* The value for the tax_rule_title field.
* @var string
@@ -624,6 +630,17 @@ abstract class OrderProduct implements ActiveRecordInterface
return $this->weight;
}
/**
* Get the [ean_code] column value.
*
* @return string
*/
public function getEanCode()
{
return $this->ean_code;
}
/**
* Get the [tax_rule_title] column value.
*
@@ -995,6 +1012,27 @@ abstract class OrderProduct implements ActiveRecordInterface
return $this;
} // setWeight()
/**
* Set the value of [ean_code] column.
*
* @param string $v new value
* @return \Thelia\Model\OrderProduct The current object (for fluent API support)
*/
public function setEanCode($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->ean_code !== $v) {
$this->ean_code = $v;
$this->modifiedColumns[] = OrderProductTableMap::EAN_CODE;
}
return $this;
} // setEanCode()
/**
* Set the value of [tax_rule_title] column.
*
@@ -1179,22 +1217,25 @@ abstract class OrderProduct implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 13 + $startcol : OrderProductTableMap::translateFieldName('Weight', TableMap::TYPE_PHPNAME, $indexType)];
$this->weight = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 14 + $startcol : OrderProductTableMap::translateFieldName('TaxRuleTitle', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 14 + $startcol : OrderProductTableMap::translateFieldName('EanCode', TableMap::TYPE_PHPNAME, $indexType)];
$this->ean_code = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 15 + $startcol : OrderProductTableMap::translateFieldName('TaxRuleTitle', TableMap::TYPE_PHPNAME, $indexType)];
$this->tax_rule_title = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 15 + $startcol : OrderProductTableMap::translateFieldName('TaxRuleDescription', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 16 + $startcol : OrderProductTableMap::translateFieldName('TaxRuleDescription', TableMap::TYPE_PHPNAME, $indexType)];
$this->tax_rule_description = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 16 + $startcol : OrderProductTableMap::translateFieldName('Parent', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 17 + $startcol : OrderProductTableMap::translateFieldName('Parent', TableMap::TYPE_PHPNAME, $indexType)];
$this->parent = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 17 + $startcol : OrderProductTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 18 + $startcol : OrderProductTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
$this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 18 + $startcol : OrderProductTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 19 + $startcol : OrderProductTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -1207,7 +1248,7 @@ abstract class OrderProduct implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 19; // 19 = OrderProductTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 20; // 20 = OrderProductTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\OrderProduct object", 0, $e);
@@ -1523,6 +1564,9 @@ abstract class OrderProduct implements ActiveRecordInterface
if ($this->isColumnModified(OrderProductTableMap::WEIGHT)) {
$modifiedColumns[':p' . $index++] = 'WEIGHT';
}
if ($this->isColumnModified(OrderProductTableMap::EAN_CODE)) {
$modifiedColumns[':p' . $index++] = 'EAN_CODE';
}
if ($this->isColumnModified(OrderProductTableMap::TAX_RULE_TITLE)) {
$modifiedColumns[':p' . $index++] = 'TAX_RULE_TITLE';
}
@@ -1591,6 +1635,9 @@ abstract class OrderProduct implements ActiveRecordInterface
case 'WEIGHT':
$stmt->bindValue($identifier, $this->weight, PDO::PARAM_STR);
break;
case 'EAN_CODE':
$stmt->bindValue($identifier, $this->ean_code, PDO::PARAM_STR);
break;
case 'TAX_RULE_TITLE':
$stmt->bindValue($identifier, $this->tax_rule_title, PDO::PARAM_STR);
break;
@@ -1711,18 +1758,21 @@ abstract class OrderProduct implements ActiveRecordInterface
return $this->getWeight();
break;
case 14:
return $this->getTaxRuleTitle();
return $this->getEanCode();
break;
case 15:
return $this->getTaxRuleDescription();
return $this->getTaxRuleTitle();
break;
case 16:
return $this->getParent();
return $this->getTaxRuleDescription();
break;
case 17:
return $this->getCreatedAt();
return $this->getParent();
break;
case 18:
return $this->getCreatedAt();
break;
case 19:
return $this->getUpdatedAt();
break;
default:
@@ -1768,11 +1818,12 @@ abstract class OrderProduct implements ActiveRecordInterface
$keys[11] => $this->getWasNew(),
$keys[12] => $this->getWasInPromo(),
$keys[13] => $this->getWeight(),
$keys[14] => $this->getTaxRuleTitle(),
$keys[15] => $this->getTaxRuleDescription(),
$keys[16] => $this->getParent(),
$keys[17] => $this->getCreatedAt(),
$keys[18] => $this->getUpdatedAt(),
$keys[14] => $this->getEanCode(),
$keys[15] => $this->getTaxRuleTitle(),
$keys[16] => $this->getTaxRuleDescription(),
$keys[17] => $this->getParent(),
$keys[18] => $this->getCreatedAt(),
$keys[19] => $this->getUpdatedAt(),
);
$virtualColumns = $this->virtualColumns;
foreach ($virtualColumns as $key => $virtualColumn) {
@@ -1866,18 +1917,21 @@ abstract class OrderProduct implements ActiveRecordInterface
$this->setWeight($value);
break;
case 14:
$this->setTaxRuleTitle($value);
$this->setEanCode($value);
break;
case 15:
$this->setTaxRuleDescription($value);
$this->setTaxRuleTitle($value);
break;
case 16:
$this->setParent($value);
$this->setTaxRuleDescription($value);
break;
case 17:
$this->setCreatedAt($value);
$this->setParent($value);
break;
case 18:
$this->setCreatedAt($value);
break;
case 19:
$this->setUpdatedAt($value);
break;
} // switch()
@@ -1918,11 +1972,12 @@ abstract class OrderProduct implements ActiveRecordInterface
if (array_key_exists($keys[11], $arr)) $this->setWasNew($arr[$keys[11]]);
if (array_key_exists($keys[12], $arr)) $this->setWasInPromo($arr[$keys[12]]);
if (array_key_exists($keys[13], $arr)) $this->setWeight($arr[$keys[13]]);
if (array_key_exists($keys[14], $arr)) $this->setTaxRuleTitle($arr[$keys[14]]);
if (array_key_exists($keys[15], $arr)) $this->setTaxRuleDescription($arr[$keys[15]]);
if (array_key_exists($keys[16], $arr)) $this->setParent($arr[$keys[16]]);
if (array_key_exists($keys[17], $arr)) $this->setCreatedAt($arr[$keys[17]]);
if (array_key_exists($keys[18], $arr)) $this->setUpdatedAt($arr[$keys[18]]);
if (array_key_exists($keys[14], $arr)) $this->setEanCode($arr[$keys[14]]);
if (array_key_exists($keys[15], $arr)) $this->setTaxRuleTitle($arr[$keys[15]]);
if (array_key_exists($keys[16], $arr)) $this->setTaxRuleDescription($arr[$keys[16]]);
if (array_key_exists($keys[17], $arr)) $this->setParent($arr[$keys[17]]);
if (array_key_exists($keys[18], $arr)) $this->setCreatedAt($arr[$keys[18]]);
if (array_key_exists($keys[19], $arr)) $this->setUpdatedAt($arr[$keys[19]]);
}
/**
@@ -1948,6 +2003,7 @@ abstract class OrderProduct implements ActiveRecordInterface
if ($this->isColumnModified(OrderProductTableMap::WAS_NEW)) $criteria->add(OrderProductTableMap::WAS_NEW, $this->was_new);
if ($this->isColumnModified(OrderProductTableMap::WAS_IN_PROMO)) $criteria->add(OrderProductTableMap::WAS_IN_PROMO, $this->was_in_promo);
if ($this->isColumnModified(OrderProductTableMap::WEIGHT)) $criteria->add(OrderProductTableMap::WEIGHT, $this->weight);
if ($this->isColumnModified(OrderProductTableMap::EAN_CODE)) $criteria->add(OrderProductTableMap::EAN_CODE, $this->ean_code);
if ($this->isColumnModified(OrderProductTableMap::TAX_RULE_TITLE)) $criteria->add(OrderProductTableMap::TAX_RULE_TITLE, $this->tax_rule_title);
if ($this->isColumnModified(OrderProductTableMap::TAX_RULE_DESCRIPTION)) $criteria->add(OrderProductTableMap::TAX_RULE_DESCRIPTION, $this->tax_rule_description);
if ($this->isColumnModified(OrderProductTableMap::PARENT)) $criteria->add(OrderProductTableMap::PARENT, $this->parent);
@@ -2029,6 +2085,7 @@ abstract class OrderProduct implements ActiveRecordInterface
$copyObj->setWasNew($this->getWasNew());
$copyObj->setWasInPromo($this->getWasInPromo());
$copyObj->setWeight($this->getWeight());
$copyObj->setEanCode($this->getEanCode());
$copyObj->setTaxRuleTitle($this->getTaxRuleTitle());
$copyObj->setTaxRuleDescription($this->getTaxRuleDescription());
$copyObj->setParent($this->getParent());
@@ -2607,6 +2664,7 @@ abstract class OrderProduct implements ActiveRecordInterface
$this->was_new = null;
$this->was_in_promo = null;
$this->weight = null;
$this->ean_code = null;
$this->tax_rule_title = null;
$this->tax_rule_description = null;
$this->parent = null;

View File

@@ -35,6 +35,7 @@ use Thelia\Model\Map\OrderProductTableMap;
* @method ChildOrderProductQuery orderByWasNew($order = Criteria::ASC) Order by the was_new column
* @method ChildOrderProductQuery orderByWasInPromo($order = Criteria::ASC) Order by the was_in_promo column
* @method ChildOrderProductQuery orderByWeight($order = Criteria::ASC) Order by the weight column
* @method ChildOrderProductQuery orderByEanCode($order = Criteria::ASC) Order by the ean_code column
* @method ChildOrderProductQuery orderByTaxRuleTitle($order = Criteria::ASC) Order by the tax_rule_title column
* @method ChildOrderProductQuery orderByTaxRuleDescription($order = Criteria::ASC) Order by the tax_rule_description column
* @method ChildOrderProductQuery orderByParent($order = Criteria::ASC) Order by the parent column
@@ -55,6 +56,7 @@ use Thelia\Model\Map\OrderProductTableMap;
* @method ChildOrderProductQuery groupByWasNew() Group by the was_new column
* @method ChildOrderProductQuery groupByWasInPromo() Group by the was_in_promo column
* @method ChildOrderProductQuery groupByWeight() Group by the weight column
* @method ChildOrderProductQuery groupByEanCode() Group by the ean_code column
* @method ChildOrderProductQuery groupByTaxRuleTitle() Group by the tax_rule_title column
* @method ChildOrderProductQuery groupByTaxRuleDescription() Group by the tax_rule_description column
* @method ChildOrderProductQuery groupByParent() Group by the parent column
@@ -94,6 +96,7 @@ use Thelia\Model\Map\OrderProductTableMap;
* @method ChildOrderProduct findOneByWasNew(int $was_new) Return the first ChildOrderProduct filtered by the was_new column
* @method ChildOrderProduct findOneByWasInPromo(int $was_in_promo) Return the first ChildOrderProduct filtered by the was_in_promo column
* @method ChildOrderProduct findOneByWeight(string $weight) Return the first ChildOrderProduct filtered by the weight column
* @method ChildOrderProduct findOneByEanCode(string $ean_code) Return the first ChildOrderProduct filtered by the ean_code column
* @method ChildOrderProduct findOneByTaxRuleTitle(string $tax_rule_title) Return the first ChildOrderProduct filtered by the tax_rule_title column
* @method ChildOrderProduct findOneByTaxRuleDescription(string $tax_rule_description) Return the first ChildOrderProduct filtered by the tax_rule_description column
* @method ChildOrderProduct findOneByParent(int $parent) Return the first ChildOrderProduct filtered by the parent column
@@ -114,6 +117,7 @@ use Thelia\Model\Map\OrderProductTableMap;
* @method array findByWasNew(int $was_new) Return ChildOrderProduct objects filtered by the was_new column
* @method array findByWasInPromo(int $was_in_promo) Return ChildOrderProduct objects filtered by the was_in_promo column
* @method array findByWeight(string $weight) Return ChildOrderProduct objects filtered by the weight column
* @method array findByEanCode(string $ean_code) Return ChildOrderProduct objects filtered by the ean_code column
* @method array findByTaxRuleTitle(string $tax_rule_title) Return ChildOrderProduct objects filtered by the tax_rule_title column
* @method array findByTaxRuleDescription(string $tax_rule_description) Return ChildOrderProduct objects filtered by the tax_rule_description column
* @method array findByParent(int $parent) Return ChildOrderProduct objects filtered by the parent column
@@ -207,7 +211,7 @@ abstract class OrderProductQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, ORDER_ID, PRODUCT_REF, PRODUCT_SALE_ELEMENTS_REF, TITLE, CHAPO, DESCRIPTION, POSTSCRIPTUM, QUANTITY, PRICE, PROMO_PRICE, WAS_NEW, WAS_IN_PROMO, WEIGHT, TAX_RULE_TITLE, TAX_RULE_DESCRIPTION, PARENT, CREATED_AT, UPDATED_AT FROM order_product WHERE ID = :p0';
$sql = 'SELECT ID, ORDER_ID, PRODUCT_REF, PRODUCT_SALE_ELEMENTS_REF, TITLE, CHAPO, DESCRIPTION, POSTSCRIPTUM, QUANTITY, PRICE, PROMO_PRICE, WAS_NEW, WAS_IN_PROMO, WEIGHT, EAN_CODE, TAX_RULE_TITLE, TAX_RULE_DESCRIPTION, PARENT, CREATED_AT, UPDATED_AT FROM order_product WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -776,6 +780,35 @@ abstract class OrderProductQuery extends ModelCriteria
return $this->addUsingAlias(OrderProductTableMap::WEIGHT, $weight, $comparison);
}
/**
* Filter the query on the ean_code column
*
* Example usage:
* <code>
* $query->filterByEanCode('fooValue'); // WHERE ean_code = 'fooValue'
* $query->filterByEanCode('%fooValue%'); // WHERE ean_code LIKE '%fooValue%'
* </code>
*
* @param string $eanCode 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 ChildOrderProductQuery The current query, for fluid interface
*/
public function filterByEanCode($eanCode = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($eanCode)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $eanCode)) {
$eanCode = str_replace('*', '%', $eanCode);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(OrderProductTableMap::EAN_CODE, $eanCode, $comparison);
}
/**
* Filter the query on the tax_rule_title column
*

View File

@@ -115,6 +115,12 @@ abstract class ProductSaleElements implements ActiveRecordInterface
*/
protected $is_default;
/**
* The value for the ean_code field.
* @var string
*/
protected $ean_code;
/**
* The value for the created_at field.
* @var string
@@ -538,6 +544,17 @@ abstract class ProductSaleElements implements ActiveRecordInterface
return $this->is_default;
}
/**
* Get the [ean_code] column value.
*
* @return string
*/
public function getEanCode()
{
return $this->ean_code;
}
/**
* Get the [optionally formatted] temporal [created_at] column value.
*
@@ -758,6 +775,27 @@ abstract class ProductSaleElements implements ActiveRecordInterface
return $this;
} // setIsDefault()
/**
* Set the value of [ean_code] column.
*
* @param string $v new value
* @return \Thelia\Model\ProductSaleElements The current object (for fluent API support)
*/
public function setEanCode($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->ean_code !== $v) {
$this->ean_code = $v;
$this->modifiedColumns[] = ProductSaleElementsTableMap::EAN_CODE;
}
return $this;
} // setEanCode()
/**
* Sets the value of [created_at] column to a normalized version of the date/time value specified.
*
@@ -877,13 +915,16 @@ abstract class ProductSaleElements implements ActiveRecordInterface
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : ProductSaleElementsTableMap::translateFieldName('IsDefault', TableMap::TYPE_PHPNAME, $indexType)];
$this->is_default = (null !== $col) ? (boolean) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : ProductSaleElementsTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : ProductSaleElementsTableMap::translateFieldName('EanCode', TableMap::TYPE_PHPNAME, $indexType)];
$this->ean_code = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : ProductSaleElementsTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
$this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : ProductSaleElementsTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 10 + $startcol : ProductSaleElementsTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -896,7 +937,7 @@ abstract class ProductSaleElements implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 10; // 10 = ProductSaleElementsTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 11; // 11 = ProductSaleElementsTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\ProductSaleElements object", 0, $e);
@@ -1213,6 +1254,9 @@ abstract class ProductSaleElements implements ActiveRecordInterface
if ($this->isColumnModified(ProductSaleElementsTableMap::IS_DEFAULT)) {
$modifiedColumns[':p' . $index++] = 'IS_DEFAULT';
}
if ($this->isColumnModified(ProductSaleElementsTableMap::EAN_CODE)) {
$modifiedColumns[':p' . $index++] = 'EAN_CODE';
}
if ($this->isColumnModified(ProductSaleElementsTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
}
@@ -1254,6 +1298,9 @@ abstract class ProductSaleElements implements ActiveRecordInterface
case 'IS_DEFAULT':
$stmt->bindValue($identifier, (int) $this->is_default, PDO::PARAM_INT);
break;
case 'EAN_CODE':
$stmt->bindValue($identifier, $this->ean_code, PDO::PARAM_STR);
break;
case 'CREATED_AT':
$stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
break;
@@ -1347,9 +1394,12 @@ abstract class ProductSaleElements implements ActiveRecordInterface
return $this->getIsDefault();
break;
case 8:
return $this->getCreatedAt();
return $this->getEanCode();
break;
case 9:
return $this->getCreatedAt();
break;
case 10:
return $this->getUpdatedAt();
break;
default:
@@ -1389,8 +1439,9 @@ abstract class ProductSaleElements implements ActiveRecordInterface
$keys[5] => $this->getNewness(),
$keys[6] => $this->getWeight(),
$keys[7] => $this->getIsDefault(),
$keys[8] => $this->getCreatedAt(),
$keys[9] => $this->getUpdatedAt(),
$keys[8] => $this->getEanCode(),
$keys[9] => $this->getCreatedAt(),
$keys[10] => $this->getUpdatedAt(),
);
$virtualColumns = $this->virtualColumns;
foreach ($virtualColumns as $key => $virtualColumn) {
@@ -1469,9 +1520,12 @@ abstract class ProductSaleElements implements ActiveRecordInterface
$this->setIsDefault($value);
break;
case 8:
$this->setCreatedAt($value);
$this->setEanCode($value);
break;
case 9:
$this->setCreatedAt($value);
break;
case 10:
$this->setUpdatedAt($value);
break;
} // switch()
@@ -1506,8 +1560,9 @@ abstract class ProductSaleElements implements ActiveRecordInterface
if (array_key_exists($keys[5], $arr)) $this->setNewness($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setWeight($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setIsDefault($arr[$keys[7]]);
if (array_key_exists($keys[8], $arr)) $this->setCreatedAt($arr[$keys[8]]);
if (array_key_exists($keys[9], $arr)) $this->setUpdatedAt($arr[$keys[9]]);
if (array_key_exists($keys[8], $arr)) $this->setEanCode($arr[$keys[8]]);
if (array_key_exists($keys[9], $arr)) $this->setCreatedAt($arr[$keys[9]]);
if (array_key_exists($keys[10], $arr)) $this->setUpdatedAt($arr[$keys[10]]);
}
/**
@@ -1527,6 +1582,7 @@ abstract class ProductSaleElements implements ActiveRecordInterface
if ($this->isColumnModified(ProductSaleElementsTableMap::NEWNESS)) $criteria->add(ProductSaleElementsTableMap::NEWNESS, $this->newness);
if ($this->isColumnModified(ProductSaleElementsTableMap::WEIGHT)) $criteria->add(ProductSaleElementsTableMap::WEIGHT, $this->weight);
if ($this->isColumnModified(ProductSaleElementsTableMap::IS_DEFAULT)) $criteria->add(ProductSaleElementsTableMap::IS_DEFAULT, $this->is_default);
if ($this->isColumnModified(ProductSaleElementsTableMap::EAN_CODE)) $criteria->add(ProductSaleElementsTableMap::EAN_CODE, $this->ean_code);
if ($this->isColumnModified(ProductSaleElementsTableMap::CREATED_AT)) $criteria->add(ProductSaleElementsTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(ProductSaleElementsTableMap::UPDATED_AT)) $criteria->add(ProductSaleElementsTableMap::UPDATED_AT, $this->updated_at);
@@ -1599,6 +1655,7 @@ abstract class ProductSaleElements implements ActiveRecordInterface
$copyObj->setNewness($this->getNewness());
$copyObj->setWeight($this->getWeight());
$copyObj->setIsDefault($this->getIsDefault());
$copyObj->setEanCode($this->getEanCode());
$copyObj->setCreatedAt($this->getCreatedAt());
$copyObj->setUpdatedAt($this->getUpdatedAt());
@@ -2526,6 +2583,7 @@ abstract class ProductSaleElements implements ActiveRecordInterface
$this->newness = null;
$this->weight = null;
$this->is_default = null;
$this->ean_code = null;
$this->created_at = null;
$this->updated_at = null;
$this->alreadyInSave = false;

View File

@@ -29,6 +29,7 @@ use Thelia\Model\Map\ProductSaleElementsTableMap;
* @method ChildProductSaleElementsQuery orderByNewness($order = Criteria::ASC) Order by the newness column
* @method ChildProductSaleElementsQuery orderByWeight($order = Criteria::ASC) Order by the weight column
* @method ChildProductSaleElementsQuery orderByIsDefault($order = Criteria::ASC) Order by the is_default column
* @method ChildProductSaleElementsQuery orderByEanCode($order = Criteria::ASC) Order by the ean_code column
* @method ChildProductSaleElementsQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildProductSaleElementsQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
@@ -40,6 +41,7 @@ use Thelia\Model\Map\ProductSaleElementsTableMap;
* @method ChildProductSaleElementsQuery groupByNewness() Group by the newness column
* @method ChildProductSaleElementsQuery groupByWeight() Group by the weight column
* @method ChildProductSaleElementsQuery groupByIsDefault() Group by the is_default column
* @method ChildProductSaleElementsQuery groupByEanCode() Group by the ean_code column
* @method ChildProductSaleElementsQuery groupByCreatedAt() Group by the created_at column
* @method ChildProductSaleElementsQuery groupByUpdatedAt() Group by the updated_at column
*
@@ -74,6 +76,7 @@ use Thelia\Model\Map\ProductSaleElementsTableMap;
* @method ChildProductSaleElements findOneByNewness(int $newness) Return the first ChildProductSaleElements filtered by the newness column
* @method ChildProductSaleElements findOneByWeight(double $weight) Return the first ChildProductSaleElements filtered by the weight column
* @method ChildProductSaleElements findOneByIsDefault(boolean $is_default) Return the first ChildProductSaleElements filtered by the is_default column
* @method ChildProductSaleElements findOneByEanCode(string $ean_code) Return the first ChildProductSaleElements filtered by the ean_code column
* @method ChildProductSaleElements findOneByCreatedAt(string $created_at) Return the first ChildProductSaleElements filtered by the created_at column
* @method ChildProductSaleElements findOneByUpdatedAt(string $updated_at) Return the first ChildProductSaleElements filtered by the updated_at column
*
@@ -85,6 +88,7 @@ use Thelia\Model\Map\ProductSaleElementsTableMap;
* @method array findByNewness(int $newness) Return ChildProductSaleElements objects filtered by the newness column
* @method array findByWeight(double $weight) Return ChildProductSaleElements objects filtered by the weight column
* @method array findByIsDefault(boolean $is_default) Return ChildProductSaleElements objects filtered by the is_default column
* @method array findByEanCode(string $ean_code) Return ChildProductSaleElements objects filtered by the ean_code column
* @method array findByCreatedAt(string $created_at) Return ChildProductSaleElements objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildProductSaleElements objects filtered by the updated_at column
*
@@ -175,7 +179,7 @@ abstract class ProductSaleElementsQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, PRODUCT_ID, REF, QUANTITY, PROMO, NEWNESS, WEIGHT, IS_DEFAULT, CREATED_AT, UPDATED_AT FROM product_sale_elements WHERE ID = :p0';
$sql = 'SELECT ID, PRODUCT_ID, REF, QUANTITY, PROMO, NEWNESS, WEIGHT, IS_DEFAULT, EAN_CODE, CREATED_AT, UPDATED_AT FROM product_sale_elements WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -568,6 +572,35 @@ abstract class ProductSaleElementsQuery extends ModelCriteria
return $this->addUsingAlias(ProductSaleElementsTableMap::IS_DEFAULT, $isDefault, $comparison);
}
/**
* Filter the query on the ean_code column
*
* Example usage:
* <code>
* $query->filterByEanCode('fooValue'); // WHERE ean_code = 'fooValue'
* $query->filterByEanCode('%fooValue%'); // WHERE ean_code LIKE '%fooValue%'
* </code>
*
* @param string $eanCode 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 ChildProductSaleElementsQuery The current query, for fluid interface
*/
public function filterByEanCode($eanCode = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($eanCode)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $eanCode)) {
$eanCode = str_replace('*', '%', $eanCode);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(ProductSaleElementsTableMap::EAN_CODE, $eanCode, $comparison);
}
/**
* Filter the query on the created_at column
*

View File

@@ -14,17 +14,17 @@ use Propel\Runtime\Exception\BadMethodCallException;
use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Parser\AbstractParser;
use Thelia\Model\Group as ChildGroup;
use Thelia\Model\GroupI18nQuery as ChildGroupI18nQuery;
use Thelia\Model\GroupQuery as ChildGroupQuery;
use Thelia\Model\Map\GroupI18nTableMap;
use Thelia\Model\Profile as ChildProfile;
use Thelia\Model\ProfileI18nQuery as ChildProfileI18nQuery;
use Thelia\Model\ProfileQuery as ChildProfileQuery;
use Thelia\Model\Map\ProfileI18nTableMap;
abstract class GroupI18n implements ActiveRecordInterface
abstract class ProfileI18n implements ActiveRecordInterface
{
/**
* TableMap class name
*/
const TABLE_MAP = '\\Thelia\\Model\\Map\\GroupI18nTableMap';
const TABLE_MAP = '\\Thelia\\Model\\Map\\ProfileI18nTableMap';
/**
@@ -91,9 +91,9 @@ abstract class GroupI18n implements ActiveRecordInterface
protected $postscriptum;
/**
* @var Group
* @var Profile
*/
protected $aGroup;
protected $aProfile;
/**
* Flag to prevent endless save loop, if this object is referenced
@@ -115,7 +115,7 @@ abstract class GroupI18n implements ActiveRecordInterface
}
/**
* Initializes internal state of Thelia\Model\Base\GroupI18n object.
* Initializes internal state of Thelia\Model\Base\ProfileI18n object.
* @see applyDefaults()
*/
public function __construct()
@@ -212,9 +212,9 @@ abstract class GroupI18n implements ActiveRecordInterface
}
/**
* Compares this with another <code>GroupI18n</code> instance. If
* <code>obj</code> is an instance of <code>GroupI18n</code>, delegates to
* <code>equals(GroupI18n)</code>. Otherwise, returns <code>false</code>.
* Compares this with another <code>ProfileI18n</code> instance. If
* <code>obj</code> is an instance of <code>ProfileI18n</code>, delegates to
* <code>equals(ProfileI18n)</code>. Otherwise, returns <code>false</code>.
*
* @param mixed $obj The object to compare to.
* @return boolean Whether equal to the object specified.
@@ -297,7 +297,7 @@ abstract class GroupI18n implements ActiveRecordInterface
* @param string $name The virtual column name
* @param mixed $value The value to give to the virtual column
*
* @return GroupI18n The current object, for fluid interface
* @return ProfileI18n The current object, for fluid interface
*/
public function setVirtualColumn($name, $value)
{
@@ -329,7 +329,7 @@ abstract class GroupI18n implements ActiveRecordInterface
* or a format name ('XML', 'YAML', 'JSON', 'CSV')
* @param string $data The source data to import from
*
* @return GroupI18n The current object, for fluid interface
* @return ProfileI18n The current object, for fluid interface
*/
public function importFrom($parser, $data)
{
@@ -444,7 +444,7 @@ abstract class GroupI18n implements ActiveRecordInterface
* Set the value of [id] column.
*
* @param int $v new value
* @return \Thelia\Model\GroupI18n The current object (for fluent API support)
* @return \Thelia\Model\ProfileI18n The current object (for fluent API support)
*/
public function setId($v)
{
@@ -454,11 +454,11 @@ abstract class GroupI18n implements ActiveRecordInterface
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = GroupI18nTableMap::ID;
$this->modifiedColumns[] = ProfileI18nTableMap::ID;
}
if ($this->aGroup !== null && $this->aGroup->getId() !== $v) {
$this->aGroup = null;
if ($this->aProfile !== null && $this->aProfile->getId() !== $v) {
$this->aProfile = null;
}
@@ -469,7 +469,7 @@ abstract class GroupI18n implements ActiveRecordInterface
* Set the value of [locale] column.
*
* @param string $v new value
* @return \Thelia\Model\GroupI18n The current object (for fluent API support)
* @return \Thelia\Model\ProfileI18n The current object (for fluent API support)
*/
public function setLocale($v)
{
@@ -479,7 +479,7 @@ abstract class GroupI18n implements ActiveRecordInterface
if ($this->locale !== $v) {
$this->locale = $v;
$this->modifiedColumns[] = GroupI18nTableMap::LOCALE;
$this->modifiedColumns[] = ProfileI18nTableMap::LOCALE;
}
@@ -490,7 +490,7 @@ abstract class GroupI18n implements ActiveRecordInterface
* Set the value of [title] column.
*
* @param string $v new value
* @return \Thelia\Model\GroupI18n The current object (for fluent API support)
* @return \Thelia\Model\ProfileI18n The current object (for fluent API support)
*/
public function setTitle($v)
{
@@ -500,7 +500,7 @@ abstract class GroupI18n implements ActiveRecordInterface
if ($this->title !== $v) {
$this->title = $v;
$this->modifiedColumns[] = GroupI18nTableMap::TITLE;
$this->modifiedColumns[] = ProfileI18nTableMap::TITLE;
}
@@ -511,7 +511,7 @@ abstract class GroupI18n implements ActiveRecordInterface
* Set the value of [description] column.
*
* @param string $v new value
* @return \Thelia\Model\GroupI18n The current object (for fluent API support)
* @return \Thelia\Model\ProfileI18n The current object (for fluent API support)
*/
public function setDescription($v)
{
@@ -521,7 +521,7 @@ abstract class GroupI18n implements ActiveRecordInterface
if ($this->description !== $v) {
$this->description = $v;
$this->modifiedColumns[] = GroupI18nTableMap::DESCRIPTION;
$this->modifiedColumns[] = ProfileI18nTableMap::DESCRIPTION;
}
@@ -532,7 +532,7 @@ abstract class GroupI18n implements ActiveRecordInterface
* Set the value of [chapo] column.
*
* @param string $v new value
* @return \Thelia\Model\GroupI18n The current object (for fluent API support)
* @return \Thelia\Model\ProfileI18n The current object (for fluent API support)
*/
public function setChapo($v)
{
@@ -542,7 +542,7 @@ abstract class GroupI18n implements ActiveRecordInterface
if ($this->chapo !== $v) {
$this->chapo = $v;
$this->modifiedColumns[] = GroupI18nTableMap::CHAPO;
$this->modifiedColumns[] = ProfileI18nTableMap::CHAPO;
}
@@ -553,7 +553,7 @@ abstract class GroupI18n implements ActiveRecordInterface
* Set the value of [postscriptum] column.
*
* @param string $v new value
* @return \Thelia\Model\GroupI18n The current object (for fluent API support)
* @return \Thelia\Model\ProfileI18n The current object (for fluent API support)
*/
public function setPostscriptum($v)
{
@@ -563,7 +563,7 @@ abstract class GroupI18n implements ActiveRecordInterface
if ($this->postscriptum !== $v) {
$this->postscriptum = $v;
$this->modifiedColumns[] = GroupI18nTableMap::POSTSCRIPTUM;
$this->modifiedColumns[] = ProfileI18nTableMap::POSTSCRIPTUM;
}
@@ -611,22 +611,22 @@ abstract class GroupI18n implements ActiveRecordInterface
try {
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : GroupI18nTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : ProfileI18nTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$this->id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : GroupI18nTableMap::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ProfileI18nTableMap::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)];
$this->locale = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : GroupI18nTableMap::translateFieldName('Title', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ProfileI18nTableMap::translateFieldName('Title', TableMap::TYPE_PHPNAME, $indexType)];
$this->title = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : GroupI18nTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ProfileI18nTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)];
$this->description = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : GroupI18nTableMap::translateFieldName('Chapo', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ProfileI18nTableMap::translateFieldName('Chapo', TableMap::TYPE_PHPNAME, $indexType)];
$this->chapo = (null !== $col) ? (string) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : GroupI18nTableMap::translateFieldName('Postscriptum', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ProfileI18nTableMap::translateFieldName('Postscriptum', TableMap::TYPE_PHPNAME, $indexType)];
$this->postscriptum = (null !== $col) ? (string) $col : null;
$this->resetModified();
@@ -636,10 +636,10 @@ abstract class GroupI18n implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 6; // 6 = GroupI18nTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 6; // 6 = ProfileI18nTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\GroupI18n object", 0, $e);
throw new PropelException("Error populating \Thelia\Model\ProfileI18n object", 0, $e);
}
}
@@ -658,8 +658,8 @@ abstract class GroupI18n implements ActiveRecordInterface
*/
public function ensureConsistency()
{
if ($this->aGroup !== null && $this->id !== $this->aGroup->getId()) {
$this->aGroup = null;
if ($this->aProfile !== null && $this->id !== $this->aProfile->getId()) {
$this->aProfile = null;
}
} // ensureConsistency
@@ -684,13 +684,13 @@ abstract class GroupI18n implements ActiveRecordInterface
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(GroupI18nTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getReadConnection(ProfileI18nTableMap::DATABASE_NAME);
}
// We don't need to alter the object instance pool; we're just modifying this instance
// already in the pool.
$dataFetcher = ChildGroupI18nQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
$dataFetcher = ChildProfileI18nQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
$row = $dataFetcher->fetch();
$dataFetcher->close();
if (!$row) {
@@ -700,7 +700,7 @@ abstract class GroupI18n implements ActiveRecordInterface
if ($deep) { // also de-associate any related objects?
$this->aGroup = null;
$this->aProfile = null;
} // if (deep)
}
@@ -710,8 +710,8 @@ abstract class GroupI18n implements ActiveRecordInterface
* @param ConnectionInterface $con
* @return void
* @throws PropelException
* @see GroupI18n::setDeleted()
* @see GroupI18n::isDeleted()
* @see ProfileI18n::setDeleted()
* @see ProfileI18n::isDeleted()
*/
public function delete(ConnectionInterface $con = null)
{
@@ -720,12 +720,12 @@ abstract class GroupI18n implements ActiveRecordInterface
}
if ($con === null) {
$con = Propel::getServiceContainer()->getWriteConnection(GroupI18nTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProfileI18nTableMap::DATABASE_NAME);
}
$con->beginTransaction();
try {
$deleteQuery = ChildGroupI18nQuery::create()
$deleteQuery = ChildProfileI18nQuery::create()
->filterByPrimaryKey($this->getPrimaryKey());
$ret = $this->preDelete($con);
if ($ret) {
@@ -762,7 +762,7 @@ abstract class GroupI18n implements ActiveRecordInterface
}
if ($con === null) {
$con = Propel::getServiceContainer()->getWriteConnection(GroupI18nTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProfileI18nTableMap::DATABASE_NAME);
}
$con->beginTransaction();
@@ -782,7 +782,7 @@ abstract class GroupI18n implements ActiveRecordInterface
$this->postUpdate($con);
}
$this->postSave($con);
GroupI18nTableMap::addInstanceToPool($this);
ProfileI18nTableMap::addInstanceToPool($this);
} else {
$affectedRows = 0;
}
@@ -817,11 +817,11 @@ abstract class GroupI18n implements ActiveRecordInterface
// method. This object relates to these object(s) by a
// foreign key reference.
if ($this->aGroup !== null) {
if ($this->aGroup->isModified() || $this->aGroup->isNew()) {
$affectedRows += $this->aGroup->save($con);
if ($this->aProfile !== null) {
if ($this->aProfile->isModified() || $this->aProfile->isNew()) {
$affectedRows += $this->aProfile->save($con);
}
$this->setGroup($this->aGroup);
$this->setProfile($this->aProfile);
}
if ($this->isNew() || $this->isModified()) {
@@ -857,27 +857,27 @@ abstract class GroupI18n implements ActiveRecordInterface
// check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(GroupI18nTableMap::ID)) {
if ($this->isColumnModified(ProfileI18nTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID';
}
if ($this->isColumnModified(GroupI18nTableMap::LOCALE)) {
if ($this->isColumnModified(ProfileI18nTableMap::LOCALE)) {
$modifiedColumns[':p' . $index++] = 'LOCALE';
}
if ($this->isColumnModified(GroupI18nTableMap::TITLE)) {
if ($this->isColumnModified(ProfileI18nTableMap::TITLE)) {
$modifiedColumns[':p' . $index++] = 'TITLE';
}
if ($this->isColumnModified(GroupI18nTableMap::DESCRIPTION)) {
if ($this->isColumnModified(ProfileI18nTableMap::DESCRIPTION)) {
$modifiedColumns[':p' . $index++] = 'DESCRIPTION';
}
if ($this->isColumnModified(GroupI18nTableMap::CHAPO)) {
if ($this->isColumnModified(ProfileI18nTableMap::CHAPO)) {
$modifiedColumns[':p' . $index++] = 'CHAPO';
}
if ($this->isColumnModified(GroupI18nTableMap::POSTSCRIPTUM)) {
if ($this->isColumnModified(ProfileI18nTableMap::POSTSCRIPTUM)) {
$modifiedColumns[':p' . $index++] = 'POSTSCRIPTUM';
}
$sql = sprintf(
'INSERT INTO group_i18n (%s) VALUES (%s)',
'INSERT INTO profile_i18n (%s) VALUES (%s)',
implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns))
);
@@ -943,7 +943,7 @@ abstract class GroupI18n implements ActiveRecordInterface
*/
public function getByName($name, $type = TableMap::TYPE_PHPNAME)
{
$pos = GroupI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
$pos = ProfileI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
$field = $this->getByPosition($pos);
return $field;
@@ -1000,11 +1000,11 @@ abstract class GroupI18n implements ActiveRecordInterface
*/
public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['GroupI18n'][serialize($this->getPrimaryKey())])) {
if (isset($alreadyDumpedObjects['ProfileI18n'][serialize($this->getPrimaryKey())])) {
return '*RECURSION*';
}
$alreadyDumpedObjects['GroupI18n'][serialize($this->getPrimaryKey())] = true;
$keys = GroupI18nTableMap::getFieldNames($keyType);
$alreadyDumpedObjects['ProfileI18n'][serialize($this->getPrimaryKey())] = true;
$keys = ProfileI18nTableMap::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getLocale(),
@@ -1019,8 +1019,8 @@ abstract class GroupI18n implements ActiveRecordInterface
}
if ($includeForeignObjects) {
if (null !== $this->aGroup) {
$result['Group'] = $this->aGroup->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
if (null !== $this->aProfile) {
$result['Profile'] = $this->aProfile->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
}
@@ -1040,7 +1040,7 @@ abstract class GroupI18n implements ActiveRecordInterface
*/
public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
{
$pos = GroupI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
$pos = ProfileI18nTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
@@ -1096,7 +1096,7 @@ abstract class GroupI18n implements ActiveRecordInterface
*/
public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
{
$keys = GroupI18nTableMap::getFieldNames($keyType);
$keys = ProfileI18nTableMap::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setLocale($arr[$keys[1]]);
@@ -1113,14 +1113,14 @@ abstract class GroupI18n implements ActiveRecordInterface
*/
public function buildCriteria()
{
$criteria = new Criteria(GroupI18nTableMap::DATABASE_NAME);
$criteria = new Criteria(ProfileI18nTableMap::DATABASE_NAME);
if ($this->isColumnModified(GroupI18nTableMap::ID)) $criteria->add(GroupI18nTableMap::ID, $this->id);
if ($this->isColumnModified(GroupI18nTableMap::LOCALE)) $criteria->add(GroupI18nTableMap::LOCALE, $this->locale);
if ($this->isColumnModified(GroupI18nTableMap::TITLE)) $criteria->add(GroupI18nTableMap::TITLE, $this->title);
if ($this->isColumnModified(GroupI18nTableMap::DESCRIPTION)) $criteria->add(GroupI18nTableMap::DESCRIPTION, $this->description);
if ($this->isColumnModified(GroupI18nTableMap::CHAPO)) $criteria->add(GroupI18nTableMap::CHAPO, $this->chapo);
if ($this->isColumnModified(GroupI18nTableMap::POSTSCRIPTUM)) $criteria->add(GroupI18nTableMap::POSTSCRIPTUM, $this->postscriptum);
if ($this->isColumnModified(ProfileI18nTableMap::ID)) $criteria->add(ProfileI18nTableMap::ID, $this->id);
if ($this->isColumnModified(ProfileI18nTableMap::LOCALE)) $criteria->add(ProfileI18nTableMap::LOCALE, $this->locale);
if ($this->isColumnModified(ProfileI18nTableMap::TITLE)) $criteria->add(ProfileI18nTableMap::TITLE, $this->title);
if ($this->isColumnModified(ProfileI18nTableMap::DESCRIPTION)) $criteria->add(ProfileI18nTableMap::DESCRIPTION, $this->description);
if ($this->isColumnModified(ProfileI18nTableMap::CHAPO)) $criteria->add(ProfileI18nTableMap::CHAPO, $this->chapo);
if ($this->isColumnModified(ProfileI18nTableMap::POSTSCRIPTUM)) $criteria->add(ProfileI18nTableMap::POSTSCRIPTUM, $this->postscriptum);
return $criteria;
}
@@ -1135,9 +1135,9 @@ abstract class GroupI18n implements ActiveRecordInterface
*/
public function buildPkeyCriteria()
{
$criteria = new Criteria(GroupI18nTableMap::DATABASE_NAME);
$criteria->add(GroupI18nTableMap::ID, $this->id);
$criteria->add(GroupI18nTableMap::LOCALE, $this->locale);
$criteria = new Criteria(ProfileI18nTableMap::DATABASE_NAME);
$criteria->add(ProfileI18nTableMap::ID, $this->id);
$criteria->add(ProfileI18nTableMap::LOCALE, $this->locale);
return $criteria;
}
@@ -1184,7 +1184,7 @@ abstract class GroupI18n implements ActiveRecordInterface
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
* @param object $copyObj An object of \Thelia\Model\GroupI18n (or compatible) type.
* @param object $copyObj An object of \Thelia\Model\ProfileI18n (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
@@ -1211,7 +1211,7 @@ abstract class GroupI18n implements ActiveRecordInterface
* objects.
*
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @return \Thelia\Model\GroupI18n Clone of current object.
* @return \Thelia\Model\ProfileI18n Clone of current object.
* @throws PropelException
*/
public function copy($deepCopy = false)
@@ -1225,13 +1225,13 @@ abstract class GroupI18n implements ActiveRecordInterface
}
/**
* Declares an association between this object and a ChildGroup object.
* Declares an association between this object and a ChildProfile object.
*
* @param ChildGroup $v
* @return \Thelia\Model\GroupI18n The current object (for fluent API support)
* @param ChildProfile $v
* @return \Thelia\Model\ProfileI18n The current object (for fluent API support)
* @throws PropelException
*/
public function setGroup(ChildGroup $v = null)
public function setProfile(ChildProfile $v = null)
{
if ($v === null) {
$this->setId(NULL);
@@ -1239,12 +1239,12 @@ abstract class GroupI18n implements ActiveRecordInterface
$this->setId($v->getId());
}
$this->aGroup = $v;
$this->aProfile = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the ChildGroup object, it will not be re-added.
// If this object has already been added to the ChildProfile object, it will not be re-added.
if ($v !== null) {
$v->addGroupI18n($this);
$v->addProfileI18n($this);
}
@@ -1253,26 +1253,26 @@ abstract class GroupI18n implements ActiveRecordInterface
/**
* Get the associated ChildGroup object
* Get the associated ChildProfile object
*
* @param ConnectionInterface $con Optional Connection object.
* @return ChildGroup The associated ChildGroup object.
* @return ChildProfile The associated ChildProfile object.
* @throws PropelException
*/
public function getGroup(ConnectionInterface $con = null)
public function getProfile(ConnectionInterface $con = null)
{
if ($this->aGroup === null && ($this->id !== null)) {
$this->aGroup = ChildGroupQuery::create()->findPk($this->id, $con);
if ($this->aProfile === null && ($this->id !== null)) {
$this->aProfile = ChildProfileQuery::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->aGroup->addGroupI18ns($this);
$this->aProfile->addProfileI18ns($this);
*/
}
return $this->aGroup;
return $this->aProfile;
}
/**
@@ -1308,7 +1308,7 @@ abstract class GroupI18n implements ActiveRecordInterface
if ($deep) {
} // if ($deep)
$this->aGroup = null;
$this->aProfile = null;
}
/**
@@ -1318,7 +1318,7 @@ abstract class GroupI18n implements ActiveRecordInterface
*/
public function __toString()
{
return (string) $this->exportTo(GroupI18nTableMap::DEFAULT_STRING_FORMAT);
return (string) $this->exportTo(ProfileI18nTableMap::DEFAULT_STRING_FORMAT);
}
/**

View File

@@ -12,84 +12,84 @@ use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
use Thelia\Model\GroupI18n as ChildGroupI18n;
use Thelia\Model\GroupI18nQuery as ChildGroupI18nQuery;
use Thelia\Model\Map\GroupI18nTableMap;
use Thelia\Model\ProfileI18n as ChildProfileI18n;
use Thelia\Model\ProfileI18nQuery as ChildProfileI18nQuery;
use Thelia\Model\Map\ProfileI18nTableMap;
/**
* Base class that represents a query for the 'group_i18n' table.
* Base class that represents a query for the 'profile_i18n' table.
*
*
*
* @method ChildGroupI18nQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildGroupI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
* @method ChildGroupI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
* @method ChildGroupI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
* @method ChildGroupI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
* @method ChildGroupI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
* @method ChildProfileI18nQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildProfileI18nQuery orderByLocale($order = Criteria::ASC) Order by the locale column
* @method ChildProfileI18nQuery orderByTitle($order = Criteria::ASC) Order by the title column
* @method ChildProfileI18nQuery orderByDescription($order = Criteria::ASC) Order by the description column
* @method ChildProfileI18nQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
* @method ChildProfileI18nQuery orderByPostscriptum($order = Criteria::ASC) Order by the postscriptum column
*
* @method ChildGroupI18nQuery groupById() Group by the id column
* @method ChildGroupI18nQuery groupByLocale() Group by the locale column
* @method ChildGroupI18nQuery groupByTitle() Group by the title column
* @method ChildGroupI18nQuery groupByDescription() Group by the description column
* @method ChildGroupI18nQuery groupByChapo() Group by the chapo column
* @method ChildGroupI18nQuery groupByPostscriptum() Group by the postscriptum column
* @method ChildProfileI18nQuery groupById() Group by the id column
* @method ChildProfileI18nQuery groupByLocale() Group by the locale column
* @method ChildProfileI18nQuery groupByTitle() Group by the title column
* @method ChildProfileI18nQuery groupByDescription() Group by the description column
* @method ChildProfileI18nQuery groupByChapo() Group by the chapo column
* @method ChildProfileI18nQuery groupByPostscriptum() Group by the postscriptum column
*
* @method ChildGroupI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildGroupI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildGroupI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
* @method ChildProfileI18nQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildProfileI18nQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildProfileI18nQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildGroupI18nQuery leftJoinGroup($relationAlias = null) Adds a LEFT JOIN clause to the query using the Group relation
* @method ChildGroupI18nQuery rightJoinGroup($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Group relation
* @method ChildGroupI18nQuery innerJoinGroup($relationAlias = null) Adds a INNER JOIN clause to the query using the Group relation
* @method ChildProfileI18nQuery leftJoinProfile($relationAlias = null) Adds a LEFT JOIN clause to the query using the Profile relation
* @method ChildProfileI18nQuery rightJoinProfile($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Profile relation
* @method ChildProfileI18nQuery innerJoinProfile($relationAlias = null) Adds a INNER JOIN clause to the query using the Profile relation
*
* @method ChildGroupI18n findOne(ConnectionInterface $con = null) Return the first ChildGroupI18n matching the query
* @method ChildGroupI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildGroupI18n matching the query, or a new ChildGroupI18n object populated from the query conditions when no match is found
* @method ChildProfileI18n findOne(ConnectionInterface $con = null) Return the first ChildProfileI18n matching the query
* @method ChildProfileI18n findOneOrCreate(ConnectionInterface $con = null) Return the first ChildProfileI18n matching the query, or a new ChildProfileI18n object populated from the query conditions when no match is found
*
* @method ChildGroupI18n findOneById(int $id) Return the first ChildGroupI18n filtered by the id column
* @method ChildGroupI18n findOneByLocale(string $locale) Return the first ChildGroupI18n filtered by the locale column
* @method ChildGroupI18n findOneByTitle(string $title) Return the first ChildGroupI18n filtered by the title column
* @method ChildGroupI18n findOneByDescription(string $description) Return the first ChildGroupI18n filtered by the description column
* @method ChildGroupI18n findOneByChapo(string $chapo) Return the first ChildGroupI18n filtered by the chapo column
* @method ChildGroupI18n findOneByPostscriptum(string $postscriptum) Return the first ChildGroupI18n filtered by the postscriptum column
* @method ChildProfileI18n findOneById(int $id) Return the first ChildProfileI18n filtered by the id column
* @method ChildProfileI18n findOneByLocale(string $locale) Return the first ChildProfileI18n filtered by the locale column
* @method ChildProfileI18n findOneByTitle(string $title) Return the first ChildProfileI18n filtered by the title column
* @method ChildProfileI18n findOneByDescription(string $description) Return the first ChildProfileI18n filtered by the description column
* @method ChildProfileI18n findOneByChapo(string $chapo) Return the first ChildProfileI18n filtered by the chapo column
* @method ChildProfileI18n findOneByPostscriptum(string $postscriptum) Return the first ChildProfileI18n filtered by the postscriptum column
*
* @method array findById(int $id) Return ChildGroupI18n objects filtered by the id column
* @method array findByLocale(string $locale) Return ChildGroupI18n objects filtered by the locale column
* @method array findByTitle(string $title) Return ChildGroupI18n objects filtered by the title column
* @method array findByDescription(string $description) Return ChildGroupI18n objects filtered by the description column
* @method array findByChapo(string $chapo) Return ChildGroupI18n objects filtered by the chapo column
* @method array findByPostscriptum(string $postscriptum) Return ChildGroupI18n objects filtered by the postscriptum column
* @method array findById(int $id) Return ChildProfileI18n objects filtered by the id column
* @method array findByLocale(string $locale) Return ChildProfileI18n objects filtered by the locale column
* @method array findByTitle(string $title) Return ChildProfileI18n objects filtered by the title column
* @method array findByDescription(string $description) Return ChildProfileI18n objects filtered by the description column
* @method array findByChapo(string $chapo) Return ChildProfileI18n objects filtered by the chapo column
* @method array findByPostscriptum(string $postscriptum) Return ChildProfileI18n objects filtered by the postscriptum column
*
*/
abstract class GroupI18nQuery extends ModelCriteria
abstract class ProfileI18nQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\GroupI18nQuery object.
* Initializes internal state of \Thelia\Model\Base\ProfileI18nQuery object.
*
* @param string $dbName The database name
* @param string $modelName The phpName of a model, e.g. 'Book'
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
*/
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\GroupI18n', $modelAlias = null)
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\ProfileI18n', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildGroupI18nQuery object.
* Returns a new ChildProfileI18nQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildGroupI18nQuery
* @return ChildProfileI18nQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\GroupI18nQuery) {
if ($criteria instanceof \Thelia\Model\ProfileI18nQuery) {
return $criteria;
}
$query = new \Thelia\Model\GroupI18nQuery();
$query = new \Thelia\Model\ProfileI18nQuery();
if (null !== $modelAlias) {
$query->setModelAlias($modelAlias);
}
@@ -112,19 +112,19 @@ abstract class GroupI18nQuery extends ModelCriteria
* @param array[$id, $locale] $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildGroupI18n|array|mixed the result, formatted by the current formatter
* @return ChildProfileI18n|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = GroupI18nTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
if ((null !== ($obj = ProfileI18nTableMap::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::getServiceContainer()->getReadConnection(GroupI18nTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getReadConnection(ProfileI18nTableMap::DATABASE_NAME);
}
$this->basePreSelect($con);
if ($this->formatter || $this->modelAlias || $this->with || $this->select
@@ -143,11 +143,11 @@ abstract class GroupI18nQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
* @return ChildGroupI18n A model object, or null if the key is not found
* @return ChildProfileI18n A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM group_i18n WHERE ID = :p0 AND LOCALE = :p1';
$sql = 'SELECT ID, LOCALE, TITLE, DESCRIPTION, CHAPO, POSTSCRIPTUM FROM profile_i18n WHERE ID = :p0 AND LOCALE = :p1';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
@@ -159,9 +159,9 @@ abstract class GroupI18nQuery extends ModelCriteria
}
$obj = null;
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
$obj = new ChildGroupI18n();
$obj = new ChildProfileI18n();
$obj->hydrate($row);
GroupI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
ProfileI18nTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
}
$stmt->closeCursor();
@@ -174,7 +174,7 @@ abstract class GroupI18nQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
* @return ChildGroupI18n|array|mixed the result, formatted by the current formatter
* @return ChildProfileI18n|array|mixed the result, formatted by the current formatter
*/
protected function findPkComplex($key, $con)
{
@@ -216,12 +216,12 @@ abstract class GroupI18nQuery extends ModelCriteria
*
* @param mixed $key Primary key to use for the query
*
* @return ChildGroupI18nQuery The current query, for fluid interface
* @return ChildProfileI18nQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
$this->addUsingAlias(GroupI18nTableMap::ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(GroupI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
$this->addUsingAlias(ProfileI18nTableMap::ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(ProfileI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
return $this;
}
@@ -231,7 +231,7 @@ abstract class GroupI18nQuery extends ModelCriteria
*
* @param array $keys The list of primary key to use for the query
*
* @return ChildGroupI18nQuery The current query, for fluid interface
* @return ChildProfileI18nQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
@@ -239,8 +239,8 @@ abstract class GroupI18nQuery extends ModelCriteria
return $this->add(null, '1<>1', Criteria::CUSTOM);
}
foreach ($keys as $key) {
$cton0 = $this->getNewCriterion(GroupI18nTableMap::ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(GroupI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
$cton0 = $this->getNewCriterion(ProfileI18nTableMap::ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(ProfileI18nTableMap::LOCALE, $key[1], Criteria::EQUAL);
$cton0->addAnd($cton1);
$this->addOr($cton0);
}
@@ -258,7 +258,7 @@ abstract class GroupI18nQuery extends ModelCriteria
* $query->filterById(array('min' => 12)); // WHERE id > 12
* </code>
*
* @see filterByGroup()
* @see filterByProfile()
*
* @param mixed $id The value to use as filter.
* Use scalar values for equality.
@@ -266,18 +266,18 @@ abstract class GroupI18nQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupI18nQuery The current query, for fluid interface
* @return ChildProfileI18nQuery 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(GroupI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$this->addUsingAlias(ProfileI18nTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(GroupI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$this->addUsingAlias(ProfileI18nTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -288,7 +288,7 @@ abstract class GroupI18nQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupI18nTableMap::ID, $id, $comparison);
return $this->addUsingAlias(ProfileI18nTableMap::ID, $id, $comparison);
}
/**
@@ -304,7 +304,7 @@ abstract class GroupI18nQuery extends ModelCriteria
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupI18nQuery The current query, for fluid interface
* @return ChildProfileI18nQuery The current query, for fluid interface
*/
public function filterByLocale($locale = null, $comparison = null)
{
@@ -317,7 +317,7 @@ abstract class GroupI18nQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupI18nTableMap::LOCALE, $locale, $comparison);
return $this->addUsingAlias(ProfileI18nTableMap::LOCALE, $locale, $comparison);
}
/**
@@ -333,7 +333,7 @@ abstract class GroupI18nQuery extends ModelCriteria
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupI18nQuery The current query, for fluid interface
* @return ChildProfileI18nQuery The current query, for fluid interface
*/
public function filterByTitle($title = null, $comparison = null)
{
@@ -346,7 +346,7 @@ abstract class GroupI18nQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupI18nTableMap::TITLE, $title, $comparison);
return $this->addUsingAlias(ProfileI18nTableMap::TITLE, $title, $comparison);
}
/**
@@ -362,7 +362,7 @@ abstract class GroupI18nQuery extends ModelCriteria
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupI18nQuery The current query, for fluid interface
* @return ChildProfileI18nQuery The current query, for fluid interface
*/
public function filterByDescription($description = null, $comparison = null)
{
@@ -375,7 +375,7 @@ abstract class GroupI18nQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupI18nTableMap::DESCRIPTION, $description, $comparison);
return $this->addUsingAlias(ProfileI18nTableMap::DESCRIPTION, $description, $comparison);
}
/**
@@ -391,7 +391,7 @@ abstract class GroupI18nQuery extends ModelCriteria
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupI18nQuery The current query, for fluid interface
* @return ChildProfileI18nQuery The current query, for fluid interface
*/
public function filterByChapo($chapo = null, $comparison = null)
{
@@ -404,7 +404,7 @@ abstract class GroupI18nQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupI18nTableMap::CHAPO, $chapo, $comparison);
return $this->addUsingAlias(ProfileI18nTableMap::CHAPO, $chapo, $comparison);
}
/**
@@ -420,7 +420,7 @@ abstract class GroupI18nQuery extends ModelCriteria
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupI18nQuery The current query, for fluid interface
* @return ChildProfileI18nQuery The current query, for fluid interface
*/
public function filterByPostscriptum($postscriptum = null, $comparison = null)
{
@@ -433,46 +433,46 @@ abstract class GroupI18nQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
return $this->addUsingAlias(ProfileI18nTableMap::POSTSCRIPTUM, $postscriptum, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Group object
* Filter the query by a related \Thelia\Model\Profile object
*
* @param \Thelia\Model\Group|ObjectCollection $group The related object(s) to use as filter
* @param \Thelia\Model\Profile|ObjectCollection $profile The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupI18nQuery The current query, for fluid interface
* @return ChildProfileI18nQuery The current query, for fluid interface
*/
public function filterByGroup($group, $comparison = null)
public function filterByProfile($profile, $comparison = null)
{
if ($group instanceof \Thelia\Model\Group) {
if ($profile instanceof \Thelia\Model\Profile) {
return $this
->addUsingAlias(GroupI18nTableMap::ID, $group->getId(), $comparison);
} elseif ($group instanceof ObjectCollection) {
->addUsingAlias(ProfileI18nTableMap::ID, $profile->getId(), $comparison);
} elseif ($profile instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(GroupI18nTableMap::ID, $group->toKeyValue('PrimaryKey', 'Id'), $comparison);
->addUsingAlias(ProfileI18nTableMap::ID, $profile->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByGroup() only accepts arguments of type \Thelia\Model\Group or Collection');
throw new PropelException('filterByProfile() only accepts arguments of type \Thelia\Model\Profile or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Group relation
* Adds a JOIN clause to the query using the Profile relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildGroupI18nQuery The current query, for fluid interface
* @return ChildProfileI18nQuery The current query, for fluid interface
*/
public function joinGroup($relationAlias = null, $joinType = 'LEFT JOIN')
public function joinProfile($relationAlias = null, $joinType = 'LEFT JOIN')
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Group');
$relationMap = $tableMap->getRelation('Profile');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -487,14 +487,14 @@ abstract class GroupI18nQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'Group');
$this->addJoinObject($join, 'Profile');
}
return $this;
}
/**
* Use the Group relation Group object
* Use the Profile relation Profile object
*
* @see useQuery()
*
@@ -502,27 +502,27 @@ abstract class GroupI18nQuery extends ModelCriteria
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \Thelia\Model\GroupQuery A secondary query class using the current class as primary query
* @return \Thelia\Model\ProfileQuery A secondary query class using the current class as primary query
*/
public function useGroupQuery($relationAlias = null, $joinType = 'LEFT JOIN')
public function useProfileQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinGroup($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Group', '\Thelia\Model\GroupQuery');
->joinProfile($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Profile', '\Thelia\Model\ProfileQuery');
}
/**
* Exclude object from result
*
* @param ChildGroupI18n $groupI18n Object to remove from the list of results
* @param ChildProfileI18n $profileI18n Object to remove from the list of results
*
* @return ChildGroupI18nQuery The current query, for fluid interface
* @return ChildProfileI18nQuery The current query, for fluid interface
*/
public function prune($groupI18n = null)
public function prune($profileI18n = null)
{
if ($groupI18n) {
$this->addCond('pruneCond0', $this->getAliasedColName(GroupI18nTableMap::ID), $groupI18n->getId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(GroupI18nTableMap::LOCALE), $groupI18n->getLocale(), Criteria::NOT_EQUAL);
if ($profileI18n) {
$this->addCond('pruneCond0', $this->getAliasedColName(ProfileI18nTableMap::ID), $profileI18n->getId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(ProfileI18nTableMap::LOCALE), $profileI18n->getLocale(), Criteria::NOT_EQUAL);
$this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
}
@@ -530,7 +530,7 @@ abstract class GroupI18nQuery extends ModelCriteria
}
/**
* Deletes all rows from the group_i18n table.
* Deletes all rows from the profile_i18n table.
*
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
@@ -538,7 +538,7 @@ abstract class GroupI18nQuery extends ModelCriteria
public function doDeleteAll(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(GroupI18nTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProfileI18nTableMap::DATABASE_NAME);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
@@ -549,8 +549,8 @@ abstract class GroupI18nQuery extends ModelCriteria
// 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).
GroupI18nTableMap::clearInstancePool();
GroupI18nTableMap::clearRelatedInstancePool();
ProfileI18nTableMap::clearInstancePool();
ProfileI18nTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
@@ -562,9 +562,9 @@ abstract class GroupI18nQuery extends ModelCriteria
}
/**
* Performs a DELETE on the database, given a ChildGroupI18n or Criteria object OR a primary key value.
* Performs a DELETE on the database, given a ChildProfileI18n or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildGroupI18n object or primary key or array of primary keys
* @param mixed $values Criteria or ChildProfileI18n object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
@@ -575,13 +575,13 @@ abstract class GroupI18nQuery extends ModelCriteria
public function delete(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(GroupI18nTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProfileI18nTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(GroupI18nTableMap::DATABASE_NAME);
$criteria->setDbName(ProfileI18nTableMap::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
@@ -591,10 +591,10 @@ abstract class GroupI18nQuery extends ModelCriteria
$con->beginTransaction();
GroupI18nTableMap::removeInstanceFromPool($criteria);
ProfileI18nTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
GroupI18nTableMap::clearRelatedInstancePool();
ProfileI18nTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
@@ -604,4 +604,4 @@ abstract class GroupI18nQuery extends ModelCriteria
}
}
} // GroupI18nQuery
} // ProfileI18nQuery

View File

@@ -16,20 +16,20 @@ use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Parser\AbstractParser;
use Propel\Runtime\Util\PropelDateTime;
use Thelia\Model\Group as ChildGroup;
use Thelia\Model\GroupModule as ChildGroupModule;
use Thelia\Model\GroupModuleQuery as ChildGroupModuleQuery;
use Thelia\Model\GroupQuery as ChildGroupQuery;
use Thelia\Model\Module as ChildModule;
use Thelia\Model\ModuleQuery as ChildModuleQuery;
use Thelia\Model\Map\GroupModuleTableMap;
use Thelia\Model\Profile as ChildProfile;
use Thelia\Model\ProfileModule as ChildProfileModule;
use Thelia\Model\ProfileModuleQuery as ChildProfileModuleQuery;
use Thelia\Model\ProfileQuery as ChildProfileQuery;
use Thelia\Model\Map\ProfileModuleTableMap;
abstract class GroupModule implements ActiveRecordInterface
abstract class ProfileModule implements ActiveRecordInterface
{
/**
* TableMap class name
*/
const TABLE_MAP = '\\Thelia\\Model\\Map\\GroupModuleTableMap';
const TABLE_MAP = '\\Thelia\\Model\\Map\\ProfileModuleTableMap';
/**
@@ -65,10 +65,10 @@ abstract class GroupModule implements ActiveRecordInterface
protected $id;
/**
* The value for the group_id field.
* The value for the profile_id field.
* @var int
*/
protected $group_id;
protected $profile_id;
/**
* The value for the module_id field.
@@ -96,9 +96,9 @@ abstract class GroupModule implements ActiveRecordInterface
protected $updated_at;
/**
* @var Group
* @var Profile
*/
protected $aGroup;
protected $aProfile;
/**
* @var Module
@@ -125,7 +125,7 @@ abstract class GroupModule implements ActiveRecordInterface
}
/**
* Initializes internal state of Thelia\Model\Base\GroupModule object.
* Initializes internal state of Thelia\Model\Base\ProfileModule object.
* @see applyDefaults()
*/
public function __construct()
@@ -222,9 +222,9 @@ abstract class GroupModule implements ActiveRecordInterface
}
/**
* Compares this with another <code>GroupModule</code> instance. If
* <code>obj</code> is an instance of <code>GroupModule</code>, delegates to
* <code>equals(GroupModule)</code>. Otherwise, returns <code>false</code>.
* Compares this with another <code>ProfileModule</code> instance. If
* <code>obj</code> is an instance of <code>ProfileModule</code>, delegates to
* <code>equals(ProfileModule)</code>. Otherwise, returns <code>false</code>.
*
* @param mixed $obj The object to compare to.
* @return boolean Whether equal to the object specified.
@@ -307,7 +307,7 @@ abstract class GroupModule implements ActiveRecordInterface
* @param string $name The virtual column name
* @param mixed $value The value to give to the virtual column
*
* @return GroupModule The current object, for fluid interface
* @return ProfileModule The current object, for fluid interface
*/
public function setVirtualColumn($name, $value)
{
@@ -339,7 +339,7 @@ abstract class GroupModule implements ActiveRecordInterface
* or a format name ('XML', 'YAML', 'JSON', 'CSV')
* @param string $data The source data to import from
*
* @return GroupModule The current object, for fluid interface
* @return ProfileModule The current object, for fluid interface
*/
public function importFrom($parser, $data)
{
@@ -396,14 +396,14 @@ abstract class GroupModule implements ActiveRecordInterface
}
/**
* Get the [group_id] column value.
* Get the [profile_id] column value.
*
* @return int
*/
public function getGroupId()
public function getProfileId()
{
return $this->group_id;
return $this->profile_id;
}
/**
@@ -472,7 +472,7 @@ abstract class GroupModule implements ActiveRecordInterface
* Set the value of [id] column.
*
* @param int $v new value
* @return \Thelia\Model\GroupModule The current object (for fluent API support)
* @return \Thelia\Model\ProfileModule The current object (for fluent API support)
*/
public function setId($v)
{
@@ -482,7 +482,7 @@ abstract class GroupModule implements ActiveRecordInterface
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = GroupModuleTableMap::ID;
$this->modifiedColumns[] = ProfileModuleTableMap::ID;
}
@@ -490,35 +490,35 @@ abstract class GroupModule implements ActiveRecordInterface
} // setId()
/**
* Set the value of [group_id] column.
* Set the value of [profile_id] column.
*
* @param int $v new value
* @return \Thelia\Model\GroupModule The current object (for fluent API support)
* @return \Thelia\Model\ProfileModule The current object (for fluent API support)
*/
public function setGroupId($v)
public function setProfileId($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->group_id !== $v) {
$this->group_id = $v;
$this->modifiedColumns[] = GroupModuleTableMap::GROUP_ID;
if ($this->profile_id !== $v) {
$this->profile_id = $v;
$this->modifiedColumns[] = ProfileModuleTableMap::PROFILE_ID;
}
if ($this->aGroup !== null && $this->aGroup->getId() !== $v) {
$this->aGroup = null;
if ($this->aProfile !== null && $this->aProfile->getId() !== $v) {
$this->aProfile = null;
}
return $this;
} // setGroupId()
} // setProfileId()
/**
* Set the value of [module_id] column.
*
* @param int $v new value
* @return \Thelia\Model\GroupModule The current object (for fluent API support)
* @return \Thelia\Model\ProfileModule The current object (for fluent API support)
*/
public function setModuleId($v)
{
@@ -528,7 +528,7 @@ abstract class GroupModule implements ActiveRecordInterface
if ($this->module_id !== $v) {
$this->module_id = $v;
$this->modifiedColumns[] = GroupModuleTableMap::MODULE_ID;
$this->modifiedColumns[] = ProfileModuleTableMap::MODULE_ID;
}
if ($this->aModule !== null && $this->aModule->getId() !== $v) {
@@ -543,7 +543,7 @@ abstract class GroupModule implements ActiveRecordInterface
* Set the value of [access] column.
*
* @param int $v new value
* @return \Thelia\Model\GroupModule The current object (for fluent API support)
* @return \Thelia\Model\ProfileModule The current object (for fluent API support)
*/
public function setAccess($v)
{
@@ -553,7 +553,7 @@ abstract class GroupModule implements ActiveRecordInterface
if ($this->access !== $v) {
$this->access = $v;
$this->modifiedColumns[] = GroupModuleTableMap::ACCESS;
$this->modifiedColumns[] = ProfileModuleTableMap::ACCESS;
}
@@ -565,7 +565,7 @@ abstract class GroupModule implements ActiveRecordInterface
*
* @param mixed $v string, integer (timestamp), or \DateTime value.
* Empty strings are treated as NULL.
* @return \Thelia\Model\GroupModule The current object (for fluent API support)
* @return \Thelia\Model\ProfileModule The current object (for fluent API support)
*/
public function setCreatedAt($v)
{
@@ -573,7 +573,7 @@ abstract class GroupModule implements ActiveRecordInterface
if ($this->created_at !== null || $dt !== null) {
if ($dt !== $this->created_at) {
$this->created_at = $dt;
$this->modifiedColumns[] = GroupModuleTableMap::CREATED_AT;
$this->modifiedColumns[] = ProfileModuleTableMap::CREATED_AT;
}
} // if either are not null
@@ -586,7 +586,7 @@ abstract class GroupModule implements ActiveRecordInterface
*
* @param mixed $v string, integer (timestamp), or \DateTime value.
* Empty strings are treated as NULL.
* @return \Thelia\Model\GroupModule The current object (for fluent API support)
* @return \Thelia\Model\ProfileModule The current object (for fluent API support)
*/
public function setUpdatedAt($v)
{
@@ -594,7 +594,7 @@ abstract class GroupModule implements ActiveRecordInterface
if ($this->updated_at !== null || $dt !== null) {
if ($dt !== $this->updated_at) {
$this->updated_at = $dt;
$this->modifiedColumns[] = GroupModuleTableMap::UPDATED_AT;
$this->modifiedColumns[] = ProfileModuleTableMap::UPDATED_AT;
}
} // if either are not null
@@ -643,25 +643,25 @@ abstract class GroupModule implements ActiveRecordInterface
try {
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : GroupModuleTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : ProfileModuleTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$this->id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : GroupModuleTableMap::translateFieldName('GroupId', TableMap::TYPE_PHPNAME, $indexType)];
$this->group_id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ProfileModuleTableMap::translateFieldName('ProfileId', TableMap::TYPE_PHPNAME, $indexType)];
$this->profile_id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : GroupModuleTableMap::translateFieldName('ModuleId', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ProfileModuleTableMap::translateFieldName('ModuleId', TableMap::TYPE_PHPNAME, $indexType)];
$this->module_id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : GroupModuleTableMap::translateFieldName('Access', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ProfileModuleTableMap::translateFieldName('Access', TableMap::TYPE_PHPNAME, $indexType)];
$this->access = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : GroupModuleTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ProfileModuleTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
$this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : GroupModuleTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ProfileModuleTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -674,10 +674,10 @@ abstract class GroupModule implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 6; // 6 = GroupModuleTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 6; // 6 = ProfileModuleTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\GroupModule object", 0, $e);
throw new PropelException("Error populating \Thelia\Model\ProfileModule object", 0, $e);
}
}
@@ -696,8 +696,8 @@ abstract class GroupModule implements ActiveRecordInterface
*/
public function ensureConsistency()
{
if ($this->aGroup !== null && $this->group_id !== $this->aGroup->getId()) {
$this->aGroup = null;
if ($this->aProfile !== null && $this->profile_id !== $this->aProfile->getId()) {
$this->aProfile = null;
}
if ($this->aModule !== null && $this->module_id !== $this->aModule->getId()) {
$this->aModule = null;
@@ -725,13 +725,13 @@ abstract class GroupModule implements ActiveRecordInterface
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(GroupModuleTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getReadConnection(ProfileModuleTableMap::DATABASE_NAME);
}
// We don't need to alter the object instance pool; we're just modifying this instance
// already in the pool.
$dataFetcher = ChildGroupModuleQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
$dataFetcher = ChildProfileModuleQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
$row = $dataFetcher->fetch();
$dataFetcher->close();
if (!$row) {
@@ -741,7 +741,7 @@ abstract class GroupModule implements ActiveRecordInterface
if ($deep) { // also de-associate any related objects?
$this->aGroup = null;
$this->aProfile = null;
$this->aModule = null;
} // if (deep)
}
@@ -752,8 +752,8 @@ abstract class GroupModule implements ActiveRecordInterface
* @param ConnectionInterface $con
* @return void
* @throws PropelException
* @see GroupModule::setDeleted()
* @see GroupModule::isDeleted()
* @see ProfileModule::setDeleted()
* @see ProfileModule::isDeleted()
*/
public function delete(ConnectionInterface $con = null)
{
@@ -762,12 +762,12 @@ abstract class GroupModule implements ActiveRecordInterface
}
if ($con === null) {
$con = Propel::getServiceContainer()->getWriteConnection(GroupModuleTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProfileModuleTableMap::DATABASE_NAME);
}
$con->beginTransaction();
try {
$deleteQuery = ChildGroupModuleQuery::create()
$deleteQuery = ChildProfileModuleQuery::create()
->filterByPrimaryKey($this->getPrimaryKey());
$ret = $this->preDelete($con);
if ($ret) {
@@ -804,7 +804,7 @@ abstract class GroupModule implements ActiveRecordInterface
}
if ($con === null) {
$con = Propel::getServiceContainer()->getWriteConnection(GroupModuleTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProfileModuleTableMap::DATABASE_NAME);
}
$con->beginTransaction();
@@ -814,16 +814,16 @@ abstract class GroupModule implements ActiveRecordInterface
if ($isInsert) {
$ret = $ret && $this->preInsert($con);
// timestampable behavior
if (!$this->isColumnModified(GroupModuleTableMap::CREATED_AT)) {
if (!$this->isColumnModified(ProfileModuleTableMap::CREATED_AT)) {
$this->setCreatedAt(time());
}
if (!$this->isColumnModified(GroupModuleTableMap::UPDATED_AT)) {
if (!$this->isColumnModified(ProfileModuleTableMap::UPDATED_AT)) {
$this->setUpdatedAt(time());
}
} else {
$ret = $ret && $this->preUpdate($con);
// timestampable behavior
if ($this->isModified() && !$this->isColumnModified(GroupModuleTableMap::UPDATED_AT)) {
if ($this->isModified() && !$this->isColumnModified(ProfileModuleTableMap::UPDATED_AT)) {
$this->setUpdatedAt(time());
}
}
@@ -835,7 +835,7 @@ abstract class GroupModule implements ActiveRecordInterface
$this->postUpdate($con);
}
$this->postSave($con);
GroupModuleTableMap::addInstanceToPool($this);
ProfileModuleTableMap::addInstanceToPool($this);
} else {
$affectedRows = 0;
}
@@ -870,11 +870,11 @@ abstract class GroupModule implements ActiveRecordInterface
// method. This object relates to these object(s) by a
// foreign key reference.
if ($this->aGroup !== null) {
if ($this->aGroup->isModified() || $this->aGroup->isNew()) {
$affectedRows += $this->aGroup->save($con);
if ($this->aProfile !== null) {
if ($this->aProfile->isModified() || $this->aProfile->isNew()) {
$affectedRows += $this->aProfile->save($con);
}
$this->setGroup($this->aGroup);
$this->setProfile($this->aProfile);
}
if ($this->aModule !== null) {
@@ -915,33 +915,33 @@ abstract class GroupModule implements ActiveRecordInterface
$modifiedColumns = array();
$index = 0;
$this->modifiedColumns[] = GroupModuleTableMap::ID;
$this->modifiedColumns[] = ProfileModuleTableMap::ID;
if (null !== $this->id) {
throw new PropelException('Cannot insert a value for auto-increment primary key (' . GroupModuleTableMap::ID . ')');
throw new PropelException('Cannot insert a value for auto-increment primary key (' . ProfileModuleTableMap::ID . ')');
}
// check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(GroupModuleTableMap::ID)) {
if ($this->isColumnModified(ProfileModuleTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID';
}
if ($this->isColumnModified(GroupModuleTableMap::GROUP_ID)) {
$modifiedColumns[':p' . $index++] = 'GROUP_ID';
if ($this->isColumnModified(ProfileModuleTableMap::PROFILE_ID)) {
$modifiedColumns[':p' . $index++] = 'PROFILE_ID';
}
if ($this->isColumnModified(GroupModuleTableMap::MODULE_ID)) {
if ($this->isColumnModified(ProfileModuleTableMap::MODULE_ID)) {
$modifiedColumns[':p' . $index++] = 'MODULE_ID';
}
if ($this->isColumnModified(GroupModuleTableMap::ACCESS)) {
if ($this->isColumnModified(ProfileModuleTableMap::ACCESS)) {
$modifiedColumns[':p' . $index++] = 'ACCESS';
}
if ($this->isColumnModified(GroupModuleTableMap::CREATED_AT)) {
if ($this->isColumnModified(ProfileModuleTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
}
if ($this->isColumnModified(GroupModuleTableMap::UPDATED_AT)) {
if ($this->isColumnModified(ProfileModuleTableMap::UPDATED_AT)) {
$modifiedColumns[':p' . $index++] = 'UPDATED_AT';
}
$sql = sprintf(
'INSERT INTO group_module (%s) VALUES (%s)',
'INSERT INTO profile_module (%s) VALUES (%s)',
implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns))
);
@@ -953,8 +953,8 @@ abstract class GroupModule implements ActiveRecordInterface
case 'ID':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break;
case 'GROUP_ID':
$stmt->bindValue($identifier, $this->group_id, PDO::PARAM_INT);
case 'PROFILE_ID':
$stmt->bindValue($identifier, $this->profile_id, PDO::PARAM_INT);
break;
case 'MODULE_ID':
$stmt->bindValue($identifier, $this->module_id, PDO::PARAM_INT);
@@ -1014,7 +1014,7 @@ abstract class GroupModule implements ActiveRecordInterface
*/
public function getByName($name, $type = TableMap::TYPE_PHPNAME)
{
$pos = GroupModuleTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
$pos = ProfileModuleTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
$field = $this->getByPosition($pos);
return $field;
@@ -1034,7 +1034,7 @@ abstract class GroupModule implements ActiveRecordInterface
return $this->getId();
break;
case 1:
return $this->getGroupId();
return $this->getProfileId();
break;
case 2:
return $this->getModuleId();
@@ -1071,14 +1071,14 @@ abstract class GroupModule implements ActiveRecordInterface
*/
public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['GroupModule'][$this->getPrimaryKey()])) {
if (isset($alreadyDumpedObjects['ProfileModule'][$this->getPrimaryKey()])) {
return '*RECURSION*';
}
$alreadyDumpedObjects['GroupModule'][$this->getPrimaryKey()] = true;
$keys = GroupModuleTableMap::getFieldNames($keyType);
$alreadyDumpedObjects['ProfileModule'][$this->getPrimaryKey()] = true;
$keys = ProfileModuleTableMap::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getGroupId(),
$keys[1] => $this->getProfileId(),
$keys[2] => $this->getModuleId(),
$keys[3] => $this->getAccess(),
$keys[4] => $this->getCreatedAt(),
@@ -1090,8 +1090,8 @@ abstract class GroupModule implements ActiveRecordInterface
}
if ($includeForeignObjects) {
if (null !== $this->aGroup) {
$result['Group'] = $this->aGroup->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
if (null !== $this->aProfile) {
$result['Profile'] = $this->aProfile->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
if (null !== $this->aModule) {
$result['Module'] = $this->aModule->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
@@ -1114,7 +1114,7 @@ abstract class GroupModule implements ActiveRecordInterface
*/
public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
{
$pos = GroupModuleTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
$pos = ProfileModuleTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
@@ -1134,7 +1134,7 @@ abstract class GroupModule implements ActiveRecordInterface
$this->setId($value);
break;
case 1:
$this->setGroupId($value);
$this->setProfileId($value);
break;
case 2:
$this->setModuleId($value);
@@ -1170,10 +1170,10 @@ abstract class GroupModule implements ActiveRecordInterface
*/
public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
{
$keys = GroupModuleTableMap::getFieldNames($keyType);
$keys = ProfileModuleTableMap::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setGroupId($arr[$keys[1]]);
if (array_key_exists($keys[1], $arr)) $this->setProfileId($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setModuleId($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setAccess($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setCreatedAt($arr[$keys[4]]);
@@ -1187,14 +1187,14 @@ abstract class GroupModule implements ActiveRecordInterface
*/
public function buildCriteria()
{
$criteria = new Criteria(GroupModuleTableMap::DATABASE_NAME);
$criteria = new Criteria(ProfileModuleTableMap::DATABASE_NAME);
if ($this->isColumnModified(GroupModuleTableMap::ID)) $criteria->add(GroupModuleTableMap::ID, $this->id);
if ($this->isColumnModified(GroupModuleTableMap::GROUP_ID)) $criteria->add(GroupModuleTableMap::GROUP_ID, $this->group_id);
if ($this->isColumnModified(GroupModuleTableMap::MODULE_ID)) $criteria->add(GroupModuleTableMap::MODULE_ID, $this->module_id);
if ($this->isColumnModified(GroupModuleTableMap::ACCESS)) $criteria->add(GroupModuleTableMap::ACCESS, $this->access);
if ($this->isColumnModified(GroupModuleTableMap::CREATED_AT)) $criteria->add(GroupModuleTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(GroupModuleTableMap::UPDATED_AT)) $criteria->add(GroupModuleTableMap::UPDATED_AT, $this->updated_at);
if ($this->isColumnModified(ProfileModuleTableMap::ID)) $criteria->add(ProfileModuleTableMap::ID, $this->id);
if ($this->isColumnModified(ProfileModuleTableMap::PROFILE_ID)) $criteria->add(ProfileModuleTableMap::PROFILE_ID, $this->profile_id);
if ($this->isColumnModified(ProfileModuleTableMap::MODULE_ID)) $criteria->add(ProfileModuleTableMap::MODULE_ID, $this->module_id);
if ($this->isColumnModified(ProfileModuleTableMap::ACCESS)) $criteria->add(ProfileModuleTableMap::ACCESS, $this->access);
if ($this->isColumnModified(ProfileModuleTableMap::CREATED_AT)) $criteria->add(ProfileModuleTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(ProfileModuleTableMap::UPDATED_AT)) $criteria->add(ProfileModuleTableMap::UPDATED_AT, $this->updated_at);
return $criteria;
}
@@ -1209,8 +1209,8 @@ abstract class GroupModule implements ActiveRecordInterface
*/
public function buildPkeyCriteria()
{
$criteria = new Criteria(GroupModuleTableMap::DATABASE_NAME);
$criteria->add(GroupModuleTableMap::ID, $this->id);
$criteria = new Criteria(ProfileModuleTableMap::DATABASE_NAME);
$criteria->add(ProfileModuleTableMap::ID, $this->id);
return $criteria;
}
@@ -1251,14 +1251,14 @@ abstract class GroupModule implements ActiveRecordInterface
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
* @param object $copyObj An object of \Thelia\Model\GroupModule (or compatible) type.
* @param object $copyObj An object of \Thelia\Model\ProfileModule (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->setGroupId($this->getGroupId());
$copyObj->setProfileId($this->getProfileId());
$copyObj->setModuleId($this->getModuleId());
$copyObj->setAccess($this->getAccess());
$copyObj->setCreatedAt($this->getCreatedAt());
@@ -1278,7 +1278,7 @@ abstract class GroupModule implements ActiveRecordInterface
* objects.
*
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @return \Thelia\Model\GroupModule Clone of current object.
* @return \Thelia\Model\ProfileModule Clone of current object.
* @throws PropelException
*/
public function copy($deepCopy = false)
@@ -1292,26 +1292,26 @@ abstract class GroupModule implements ActiveRecordInterface
}
/**
* Declares an association between this object and a ChildGroup object.
* Declares an association between this object and a ChildProfile object.
*
* @param ChildGroup $v
* @return \Thelia\Model\GroupModule The current object (for fluent API support)
* @param ChildProfile $v
* @return \Thelia\Model\ProfileModule The current object (for fluent API support)
* @throws PropelException
*/
public function setGroup(ChildGroup $v = null)
public function setProfile(ChildProfile $v = null)
{
if ($v === null) {
$this->setGroupId(NULL);
$this->setProfileId(NULL);
} else {
$this->setGroupId($v->getId());
$this->setProfileId($v->getId());
}
$this->aGroup = $v;
$this->aProfile = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the ChildGroup object, it will not be re-added.
// If this object has already been added to the ChildProfile object, it will not be re-added.
if ($v !== null) {
$v->addGroupModule($this);
$v->addProfileModule($this);
}
@@ -1320,33 +1320,33 @@ abstract class GroupModule implements ActiveRecordInterface
/**
* Get the associated ChildGroup object
* Get the associated ChildProfile object
*
* @param ConnectionInterface $con Optional Connection object.
* @return ChildGroup The associated ChildGroup object.
* @return ChildProfile The associated ChildProfile object.
* @throws PropelException
*/
public function getGroup(ConnectionInterface $con = null)
public function getProfile(ConnectionInterface $con = null)
{
if ($this->aGroup === null && ($this->group_id !== null)) {
$this->aGroup = ChildGroupQuery::create()->findPk($this->group_id, $con);
if ($this->aProfile === null && ($this->profile_id !== null)) {
$this->aProfile = ChildProfileQuery::create()->findPk($this->profile_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->addGroupModules($this);
$this->aProfile->addProfileModules($this);
*/
}
return $this->aGroup;
return $this->aProfile;
}
/**
* Declares an association between this object and a ChildModule object.
*
* @param ChildModule $v
* @return \Thelia\Model\GroupModule The current object (for fluent API support)
* @return \Thelia\Model\ProfileModule The current object (for fluent API support)
* @throws PropelException
*/
public function setModule(ChildModule $v = null)
@@ -1362,7 +1362,7 @@ abstract class GroupModule implements ActiveRecordInterface
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the ChildModule object, it will not be re-added.
if ($v !== null) {
$v->addGroupModule($this);
$v->addProfileModule($this);
}
@@ -1386,7 +1386,7 @@ abstract class GroupModule implements ActiveRecordInterface
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->aModule->addGroupModules($this);
$this->aModule->addProfileModules($this);
*/
}
@@ -1399,7 +1399,7 @@ abstract class GroupModule implements ActiveRecordInterface
public function clear()
{
$this->id = null;
$this->group_id = null;
$this->profile_id = null;
$this->module_id = null;
$this->access = null;
$this->created_at = null;
@@ -1426,7 +1426,7 @@ abstract class GroupModule implements ActiveRecordInterface
if ($deep) {
} // if ($deep)
$this->aGroup = null;
$this->aProfile = null;
$this->aModule = null;
}
@@ -1437,7 +1437,7 @@ abstract class GroupModule implements ActiveRecordInterface
*/
public function __toString()
{
return (string) $this->exportTo(GroupModuleTableMap::DEFAULT_STRING_FORMAT);
return (string) $this->exportTo(ProfileModuleTableMap::DEFAULT_STRING_FORMAT);
}
// timestampable behavior
@@ -1445,11 +1445,11 @@ abstract class GroupModule implements ActiveRecordInterface
/**
* Mark the current object so that the update date doesn't get updated during next save
*
* @return ChildGroupModule The current object (for fluent API support)
* @return ChildProfileModule The current object (for fluent API support)
*/
public function keepUpdateDateUnchanged()
{
$this->modifiedColumns[] = GroupModuleTableMap::UPDATED_AT;
$this->modifiedColumns[] = ProfileModuleTableMap::UPDATED_AT;
return $this;
}

View File

@@ -12,88 +12,88 @@ use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
use Thelia\Model\GroupModule as ChildGroupModule;
use Thelia\Model\GroupModuleQuery as ChildGroupModuleQuery;
use Thelia\Model\Map\GroupModuleTableMap;
use Thelia\Model\ProfileModule as ChildProfileModule;
use Thelia\Model\ProfileModuleQuery as ChildProfileModuleQuery;
use Thelia\Model\Map\ProfileModuleTableMap;
/**
* Base class that represents a query for the 'group_module' table.
* Base class that represents a query for the 'profile_module' table.
*
*
*
* @method ChildGroupModuleQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildGroupModuleQuery orderByGroupId($order = Criteria::ASC) Order by the group_id column
* @method ChildGroupModuleQuery orderByModuleId($order = Criteria::ASC) Order by the module_id column
* @method ChildGroupModuleQuery orderByAccess($order = Criteria::ASC) Order by the access column
* @method ChildGroupModuleQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildGroupModuleQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
* @method ChildProfileModuleQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildProfileModuleQuery orderByProfileId($order = Criteria::ASC) Order by the profile_id column
* @method ChildProfileModuleQuery orderByModuleId($order = Criteria::ASC) Order by the module_id column
* @method ChildProfileModuleQuery orderByAccess($order = Criteria::ASC) Order by the access column
* @method ChildProfileModuleQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildProfileModuleQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildGroupModuleQuery groupById() Group by the id column
* @method ChildGroupModuleQuery groupByGroupId() Group by the group_id column
* @method ChildGroupModuleQuery groupByModuleId() Group by the module_id column
* @method ChildGroupModuleQuery groupByAccess() Group by the access column
* @method ChildGroupModuleQuery groupByCreatedAt() Group by the created_at column
* @method ChildGroupModuleQuery groupByUpdatedAt() Group by the updated_at column
* @method ChildProfileModuleQuery groupById() Group by the id column
* @method ChildProfileModuleQuery groupByProfileId() Group by the profile_id column
* @method ChildProfileModuleQuery groupByModuleId() Group by the module_id column
* @method ChildProfileModuleQuery groupByAccess() Group by the access column
* @method ChildProfileModuleQuery groupByCreatedAt() Group by the created_at column
* @method ChildProfileModuleQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildGroupModuleQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildGroupModuleQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildGroupModuleQuery innerJoin($relation) Adds a INNER JOIN clause to the query
* @method ChildProfileModuleQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildProfileModuleQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildProfileModuleQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildGroupModuleQuery leftJoinGroup($relationAlias = null) Adds a LEFT JOIN clause to the query using the Group relation
* @method ChildGroupModuleQuery rightJoinGroup($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Group relation
* @method ChildGroupModuleQuery innerJoinGroup($relationAlias = null) Adds a INNER JOIN clause to the query using the Group relation
* @method ChildProfileModuleQuery leftJoinProfile($relationAlias = null) Adds a LEFT JOIN clause to the query using the Profile relation
* @method ChildProfileModuleQuery rightJoinProfile($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Profile relation
* @method ChildProfileModuleQuery innerJoinProfile($relationAlias = null) Adds a INNER JOIN clause to the query using the Profile relation
*
* @method ChildGroupModuleQuery leftJoinModule($relationAlias = null) Adds a LEFT JOIN clause to the query using the Module relation
* @method ChildGroupModuleQuery rightJoinModule($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Module relation
* @method ChildGroupModuleQuery innerJoinModule($relationAlias = null) Adds a INNER JOIN clause to the query using the Module relation
* @method ChildProfileModuleQuery leftJoinModule($relationAlias = null) Adds a LEFT JOIN clause to the query using the Module relation
* @method ChildProfileModuleQuery rightJoinModule($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Module relation
* @method ChildProfileModuleQuery innerJoinModule($relationAlias = null) Adds a INNER JOIN clause to the query using the Module relation
*
* @method ChildGroupModule findOne(ConnectionInterface $con = null) Return the first ChildGroupModule matching the query
* @method ChildGroupModule findOneOrCreate(ConnectionInterface $con = null) Return the first ChildGroupModule matching the query, or a new ChildGroupModule object populated from the query conditions when no match is found
* @method ChildProfileModule findOne(ConnectionInterface $con = null) Return the first ChildProfileModule matching the query
* @method ChildProfileModule findOneOrCreate(ConnectionInterface $con = null) Return the first ChildProfileModule matching the query, or a new ChildProfileModule object populated from the query conditions when no match is found
*
* @method ChildGroupModule findOneById(int $id) Return the first ChildGroupModule filtered by the id column
* @method ChildGroupModule findOneByGroupId(int $group_id) Return the first ChildGroupModule filtered by the group_id column
* @method ChildGroupModule findOneByModuleId(int $module_id) Return the first ChildGroupModule filtered by the module_id column
* @method ChildGroupModule findOneByAccess(int $access) Return the first ChildGroupModule filtered by the access column
* @method ChildGroupModule findOneByCreatedAt(string $created_at) Return the first ChildGroupModule filtered by the created_at column
* @method ChildGroupModule findOneByUpdatedAt(string $updated_at) Return the first ChildGroupModule filtered by the updated_at column
* @method ChildProfileModule findOneById(int $id) Return the first ChildProfileModule filtered by the id column
* @method ChildProfileModule findOneByProfileId(int $profile_id) Return the first ChildProfileModule filtered by the profile_id column
* @method ChildProfileModule findOneByModuleId(int $module_id) Return the first ChildProfileModule filtered by the module_id column
* @method ChildProfileModule findOneByAccess(int $access) Return the first ChildProfileModule filtered by the access column
* @method ChildProfileModule findOneByCreatedAt(string $created_at) Return the first ChildProfileModule filtered by the created_at column
* @method ChildProfileModule findOneByUpdatedAt(string $updated_at) Return the first ChildProfileModule filtered by the updated_at column
*
* @method array findById(int $id) Return ChildGroupModule objects filtered by the id column
* @method array findByGroupId(int $group_id) Return ChildGroupModule objects filtered by the group_id column
* @method array findByModuleId(int $module_id) Return ChildGroupModule objects filtered by the module_id column
* @method array findByAccess(int $access) Return ChildGroupModule objects filtered by the access column
* @method array findByCreatedAt(string $created_at) Return ChildGroupModule objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildGroupModule objects filtered by the updated_at column
* @method array findById(int $id) Return ChildProfileModule objects filtered by the id column
* @method array findByProfileId(int $profile_id) Return ChildProfileModule objects filtered by the profile_id column
* @method array findByModuleId(int $module_id) Return ChildProfileModule objects filtered by the module_id column
* @method array findByAccess(int $access) Return ChildProfileModule objects filtered by the access column
* @method array findByCreatedAt(string $created_at) Return ChildProfileModule objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildProfileModule objects filtered by the updated_at column
*
*/
abstract class GroupModuleQuery extends ModelCriteria
abstract class ProfileModuleQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\GroupModuleQuery object.
* Initializes internal state of \Thelia\Model\Base\ProfileModuleQuery object.
*
* @param string $dbName The database name
* @param string $modelName The phpName of a model, e.g. 'Book'
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
*/
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\GroupModule', $modelAlias = null)
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\ProfileModule', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildGroupModuleQuery object.
* Returns a new ChildProfileModuleQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildGroupModuleQuery
* @return ChildProfileModuleQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\GroupModuleQuery) {
if ($criteria instanceof \Thelia\Model\ProfileModuleQuery) {
return $criteria;
}
$query = new \Thelia\Model\GroupModuleQuery();
$query = new \Thelia\Model\ProfileModuleQuery();
if (null !== $modelAlias) {
$query->setModelAlias($modelAlias);
}
@@ -116,19 +116,19 @@ abstract class GroupModuleQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildGroupModule|array|mixed the result, formatted by the current formatter
* @return ChildProfileModule|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = GroupModuleTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
if ((null !== ($obj = ProfileModuleTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(GroupModuleTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getReadConnection(ProfileModuleTableMap::DATABASE_NAME);
}
$this->basePreSelect($con);
if ($this->formatter || $this->modelAlias || $this->with || $this->select
@@ -147,11 +147,11 @@ abstract class GroupModuleQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
* @return ChildGroupModule A model object, or null if the key is not found
* @return ChildProfileModule A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, GROUP_ID, MODULE_ID, ACCESS, CREATED_AT, UPDATED_AT FROM group_module WHERE ID = :p0';
$sql = 'SELECT ID, PROFILE_ID, MODULE_ID, ACCESS, CREATED_AT, UPDATED_AT FROM profile_module WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -162,9 +162,9 @@ abstract class GroupModuleQuery extends ModelCriteria
}
$obj = null;
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
$obj = new ChildGroupModule();
$obj = new ChildProfileModule();
$obj->hydrate($row);
GroupModuleTableMap::addInstanceToPool($obj, (string) $key);
ProfileModuleTableMap::addInstanceToPool($obj, (string) $key);
}
$stmt->closeCursor();
@@ -177,7 +177,7 @@ abstract class GroupModuleQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
* @return ChildGroupModule|array|mixed the result, formatted by the current formatter
* @return ChildProfileModule|array|mixed the result, formatted by the current formatter
*/
protected function findPkComplex($key, $con)
{
@@ -219,12 +219,12 @@ abstract class GroupModuleQuery extends ModelCriteria
*
* @param mixed $key Primary key to use for the query
*
* @return ChildGroupModuleQuery The current query, for fluid interface
* @return ChildProfileModuleQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(GroupModuleTableMap::ID, $key, Criteria::EQUAL);
return $this->addUsingAlias(ProfileModuleTableMap::ID, $key, Criteria::EQUAL);
}
/**
@@ -232,12 +232,12 @@ abstract class GroupModuleQuery extends ModelCriteria
*
* @param array $keys The list of primary key to use for the query
*
* @return ChildGroupModuleQuery The current query, for fluid interface
* @return ChildProfileModuleQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(GroupModuleTableMap::ID, $keys, Criteria::IN);
return $this->addUsingAlias(ProfileModuleTableMap::ID, $keys, Criteria::IN);
}
/**
@@ -256,18 +256,18 @@ abstract class GroupModuleQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupModuleQuery The current query, for fluid interface
* @return ChildProfileModuleQuery 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(GroupModuleTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$this->addUsingAlias(ProfileModuleTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(GroupModuleTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$this->addUsingAlias(ProfileModuleTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -278,39 +278,39 @@ abstract class GroupModuleQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupModuleTableMap::ID, $id, $comparison);
return $this->addUsingAlias(ProfileModuleTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the group_id column
* Filter the query on the profile_id column
*
* Example usage:
* <code>
* $query->filterByGroupId(1234); // WHERE group_id = 1234
* $query->filterByGroupId(array(12, 34)); // WHERE group_id IN (12, 34)
* $query->filterByGroupId(array('min' => 12)); // WHERE group_id > 12
* $query->filterByProfileId(1234); // WHERE profile_id = 1234
* $query->filterByProfileId(array(12, 34)); // WHERE profile_id IN (12, 34)
* $query->filterByProfileId(array('min' => 12)); // WHERE profile_id > 12
* </code>
*
* @see filterByGroup()
* @see filterByProfile()
*
* @param mixed $groupId The value to use as filter.
* @param mixed $profileId 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 ChildGroupModuleQuery The current query, for fluid interface
* @return ChildProfileModuleQuery The current query, for fluid interface
*/
public function filterByGroupId($groupId = null, $comparison = null)
public function filterByProfileId($profileId = null, $comparison = null)
{
if (is_array($groupId)) {
if (is_array($profileId)) {
$useMinMax = false;
if (isset($groupId['min'])) {
$this->addUsingAlias(GroupModuleTableMap::GROUP_ID, $groupId['min'], Criteria::GREATER_EQUAL);
if (isset($profileId['min'])) {
$this->addUsingAlias(ProfileModuleTableMap::PROFILE_ID, $profileId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($groupId['max'])) {
$this->addUsingAlias(GroupModuleTableMap::GROUP_ID, $groupId['max'], Criteria::LESS_EQUAL);
if (isset($profileId['max'])) {
$this->addUsingAlias(ProfileModuleTableMap::PROFILE_ID, $profileId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -321,7 +321,7 @@ abstract class GroupModuleQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupModuleTableMap::GROUP_ID, $groupId, $comparison);
return $this->addUsingAlias(ProfileModuleTableMap::PROFILE_ID, $profileId, $comparison);
}
/**
@@ -342,18 +342,18 @@ abstract class GroupModuleQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupModuleQuery The current query, for fluid interface
* @return ChildProfileModuleQuery The current query, for fluid interface
*/
public function filterByModuleId($moduleId = null, $comparison = null)
{
if (is_array($moduleId)) {
$useMinMax = false;
if (isset($moduleId['min'])) {
$this->addUsingAlias(GroupModuleTableMap::MODULE_ID, $moduleId['min'], Criteria::GREATER_EQUAL);
$this->addUsingAlias(ProfileModuleTableMap::MODULE_ID, $moduleId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($moduleId['max'])) {
$this->addUsingAlias(GroupModuleTableMap::MODULE_ID, $moduleId['max'], Criteria::LESS_EQUAL);
$this->addUsingAlias(ProfileModuleTableMap::MODULE_ID, $moduleId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -364,7 +364,7 @@ abstract class GroupModuleQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupModuleTableMap::MODULE_ID, $moduleId, $comparison);
return $this->addUsingAlias(ProfileModuleTableMap::MODULE_ID, $moduleId, $comparison);
}
/**
@@ -383,18 +383,18 @@ abstract class GroupModuleQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupModuleQuery The current query, for fluid interface
* @return ChildProfileModuleQuery The current query, for fluid interface
*/
public function filterByAccess($access = null, $comparison = null)
{
if (is_array($access)) {
$useMinMax = false;
if (isset($access['min'])) {
$this->addUsingAlias(GroupModuleTableMap::ACCESS, $access['min'], Criteria::GREATER_EQUAL);
$this->addUsingAlias(ProfileModuleTableMap::ACCESS, $access['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($access['max'])) {
$this->addUsingAlias(GroupModuleTableMap::ACCESS, $access['max'], Criteria::LESS_EQUAL);
$this->addUsingAlias(ProfileModuleTableMap::ACCESS, $access['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -405,7 +405,7 @@ abstract class GroupModuleQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupModuleTableMap::ACCESS, $access, $comparison);
return $this->addUsingAlias(ProfileModuleTableMap::ACCESS, $access, $comparison);
}
/**
@@ -426,18 +426,18 @@ abstract class GroupModuleQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupModuleQuery The current query, for fluid interface
* @return ChildProfileModuleQuery 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(GroupModuleTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$this->addUsingAlias(ProfileModuleTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(GroupModuleTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$this->addUsingAlias(ProfileModuleTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -448,7 +448,7 @@ abstract class GroupModuleQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupModuleTableMap::CREATED_AT, $createdAt, $comparison);
return $this->addUsingAlias(ProfileModuleTableMap::CREATED_AT, $createdAt, $comparison);
}
/**
@@ -469,18 +469,18 @@ abstract class GroupModuleQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupModuleQuery The current query, for fluid interface
* @return ChildProfileModuleQuery 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(GroupModuleTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$this->addUsingAlias(ProfileModuleTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(GroupModuleTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$this->addUsingAlias(ProfileModuleTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -491,46 +491,46 @@ abstract class GroupModuleQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupModuleTableMap::UPDATED_AT, $updatedAt, $comparison);
return $this->addUsingAlias(ProfileModuleTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Group object
* Filter the query by a related \Thelia\Model\Profile object
*
* @param \Thelia\Model\Group|ObjectCollection $group The related object(s) to use as filter
* @param \Thelia\Model\Profile|ObjectCollection $profile The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupModuleQuery The current query, for fluid interface
* @return ChildProfileModuleQuery The current query, for fluid interface
*/
public function filterByGroup($group, $comparison = null)
public function filterByProfile($profile, $comparison = null)
{
if ($group instanceof \Thelia\Model\Group) {
if ($profile instanceof \Thelia\Model\Profile) {
return $this
->addUsingAlias(GroupModuleTableMap::GROUP_ID, $group->getId(), $comparison);
} elseif ($group instanceof ObjectCollection) {
->addUsingAlias(ProfileModuleTableMap::PROFILE_ID, $profile->getId(), $comparison);
} elseif ($profile instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(GroupModuleTableMap::GROUP_ID, $group->toKeyValue('PrimaryKey', 'Id'), $comparison);
->addUsingAlias(ProfileModuleTableMap::PROFILE_ID, $profile->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByGroup() only accepts arguments of type \Thelia\Model\Group or Collection');
throw new PropelException('filterByProfile() only accepts arguments of type \Thelia\Model\Profile or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Group relation
* Adds a JOIN clause to the query using the Profile relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildGroupModuleQuery The current query, for fluid interface
* @return ChildProfileModuleQuery The current query, for fluid interface
*/
public function joinGroup($relationAlias = null, $joinType = Criteria::INNER_JOIN)
public function joinProfile($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Group');
$relationMap = $tableMap->getRelation('Profile');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -545,14 +545,14 @@ abstract class GroupModuleQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'Group');
$this->addJoinObject($join, 'Profile');
}
return $this;
}
/**
* Use the Group relation Group object
* Use the Profile relation Profile object
*
* @see useQuery()
*
@@ -560,13 +560,13 @@ abstract class GroupModuleQuery extends ModelCriteria
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \Thelia\Model\GroupQuery A secondary query class using the current class as primary query
* @return \Thelia\Model\ProfileQuery A secondary query class using the current class as primary query
*/
public function useGroupQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
public function useProfileQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinGroup($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Group', '\Thelia\Model\GroupQuery');
->joinProfile($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Profile', '\Thelia\Model\ProfileQuery');
}
/**
@@ -575,20 +575,20 @@ abstract class GroupModuleQuery extends ModelCriteria
* @param \Thelia\Model\Module|ObjectCollection $module The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupModuleQuery The current query, for fluid interface
* @return ChildProfileModuleQuery The current query, for fluid interface
*/
public function filterByModule($module, $comparison = null)
{
if ($module instanceof \Thelia\Model\Module) {
return $this
->addUsingAlias(GroupModuleTableMap::MODULE_ID, $module->getId(), $comparison);
->addUsingAlias(ProfileModuleTableMap::MODULE_ID, $module->getId(), $comparison);
} elseif ($module instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(GroupModuleTableMap::MODULE_ID, $module->toKeyValue('PrimaryKey', 'Id'), $comparison);
->addUsingAlias(ProfileModuleTableMap::MODULE_ID, $module->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByModule() only accepts arguments of type \Thelia\Model\Module or Collection');
}
@@ -600,7 +600,7 @@ abstract class GroupModuleQuery extends ModelCriteria
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildGroupModuleQuery The current query, for fluid interface
* @return ChildProfileModuleQuery The current query, for fluid interface
*/
public function joinModule($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
@@ -647,21 +647,21 @@ abstract class GroupModuleQuery extends ModelCriteria
/**
* Exclude object from result
*
* @param ChildGroupModule $groupModule Object to remove from the list of results
* @param ChildProfileModule $profileModule Object to remove from the list of results
*
* @return ChildGroupModuleQuery The current query, for fluid interface
* @return ChildProfileModuleQuery The current query, for fluid interface
*/
public function prune($groupModule = null)
public function prune($profileModule = null)
{
if ($groupModule) {
$this->addUsingAlias(GroupModuleTableMap::ID, $groupModule->getId(), Criteria::NOT_EQUAL);
if ($profileModule) {
$this->addUsingAlias(ProfileModuleTableMap::ID, $profileModule->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the group_module table.
* Deletes all rows from the profile_module table.
*
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
@@ -669,7 +669,7 @@ abstract class GroupModuleQuery extends ModelCriteria
public function doDeleteAll(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(GroupModuleTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProfileModuleTableMap::DATABASE_NAME);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
@@ -680,8 +680,8 @@ abstract class GroupModuleQuery extends ModelCriteria
// 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).
GroupModuleTableMap::clearInstancePool();
GroupModuleTableMap::clearRelatedInstancePool();
ProfileModuleTableMap::clearInstancePool();
ProfileModuleTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
@@ -693,9 +693,9 @@ abstract class GroupModuleQuery extends ModelCriteria
}
/**
* Performs a DELETE on the database, given a ChildGroupModule or Criteria object OR a primary key value.
* Performs a DELETE on the database, given a ChildProfileModule or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildGroupModule object or primary key or array of primary keys
* @param mixed $values Criteria or ChildProfileModule object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
@@ -706,13 +706,13 @@ abstract class GroupModuleQuery extends ModelCriteria
public function delete(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(GroupModuleTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProfileModuleTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(GroupModuleTableMap::DATABASE_NAME);
$criteria->setDbName(ProfileModuleTableMap::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
@@ -722,10 +722,10 @@ abstract class GroupModuleQuery extends ModelCriteria
$con->beginTransaction();
GroupModuleTableMap::removeInstanceFromPool($criteria);
ProfileModuleTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
GroupModuleTableMap::clearRelatedInstancePool();
ProfileModuleTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
@@ -742,11 +742,11 @@ abstract class GroupModuleQuery extends ModelCriteria
*
* @param int $nbDays Maximum age of the latest update in days
*
* @return ChildGroupModuleQuery The current query, for fluid interface
* @return ChildProfileModuleQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(GroupModuleTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
return $this->addUsingAlias(ProfileModuleTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
@@ -754,51 +754,51 @@ abstract class GroupModuleQuery extends ModelCriteria
*
* @param int $nbDays Maximum age of in days
*
* @return ChildGroupModuleQuery The current query, for fluid interface
* @return ChildProfileModuleQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(GroupModuleTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
return $this->addUsingAlias(ProfileModuleTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildGroupModuleQuery The current query, for fluid interface
* @return ChildProfileModuleQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(GroupModuleTableMap::UPDATED_AT);
return $this->addDescendingOrderByColumn(ProfileModuleTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildGroupModuleQuery The current query, for fluid interface
* @return ChildProfileModuleQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(GroupModuleTableMap::UPDATED_AT);
return $this->addAscendingOrderByColumn(ProfileModuleTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildGroupModuleQuery The current query, for fluid interface
* @return ChildProfileModuleQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(GroupModuleTableMap::CREATED_AT);
return $this->addDescendingOrderByColumn(ProfileModuleTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildGroupModuleQuery The current query, for fluid interface
* @return ChildProfileModuleQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(GroupModuleTableMap::CREATED_AT);
return $this->addAscendingOrderByColumn(ProfileModuleTableMap::CREATED_AT);
}
} // GroupModuleQuery
} // ProfileModuleQuery

View File

@@ -12,89 +12,89 @@ use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
use Thelia\Model\Group as ChildGroup;
use Thelia\Model\GroupI18nQuery as ChildGroupI18nQuery;
use Thelia\Model\GroupQuery as ChildGroupQuery;
use Thelia\Model\Map\GroupTableMap;
use Thelia\Model\Profile as ChildProfile;
use Thelia\Model\ProfileI18nQuery as ChildProfileI18nQuery;
use Thelia\Model\ProfileQuery as ChildProfileQuery;
use Thelia\Model\Map\ProfileTableMap;
/**
* Base class that represents a query for the 'group' table.
* Base class that represents a query for the 'profile' table.
*
*
*
* @method ChildGroupQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildGroupQuery orderByCode($order = Criteria::ASC) Order by the code column
* @method ChildGroupQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildGroupQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
* @method ChildProfileQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildProfileQuery orderByCode($order = Criteria::ASC) Order by the code column
* @method ChildProfileQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildProfileQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildGroupQuery groupById() Group by the id column
* @method ChildGroupQuery groupByCode() Group by the code column
* @method ChildGroupQuery groupByCreatedAt() Group by the created_at column
* @method ChildGroupQuery groupByUpdatedAt() Group by the updated_at column
* @method ChildProfileQuery groupById() Group by the id column
* @method ChildProfileQuery groupByCode() Group by the code column
* @method ChildProfileQuery groupByCreatedAt() Group by the created_at column
* @method ChildProfileQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildGroupQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildGroupQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildGroupQuery innerJoin($relation) Adds a INNER JOIN clause to the query
* @method ChildProfileQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildProfileQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildProfileQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildGroupQuery leftJoinAdminGroup($relationAlias = null) Adds a LEFT JOIN clause to the query using the AdminGroup relation
* @method ChildGroupQuery rightJoinAdminGroup($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AdminGroup relation
* @method ChildGroupQuery innerJoinAdminGroup($relationAlias = null) Adds a INNER JOIN clause to the query using the AdminGroup relation
* @method ChildProfileQuery leftJoinAdmin($relationAlias = null) Adds a LEFT JOIN clause to the query using the Admin relation
* @method ChildProfileQuery rightJoinAdmin($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Admin relation
* @method ChildProfileQuery innerJoinAdmin($relationAlias = null) Adds a INNER JOIN clause to the query using the Admin relation
*
* @method ChildGroupQuery leftJoinGroupResource($relationAlias = null) Adds a LEFT JOIN clause to the query using the GroupResource relation
* @method ChildGroupQuery rightJoinGroupResource($relationAlias = null) Adds a RIGHT JOIN clause to the query using the GroupResource relation
* @method ChildGroupQuery innerJoinGroupResource($relationAlias = null) Adds a INNER JOIN clause to the query using the GroupResource relation
* @method ChildProfileQuery leftJoinProfileResource($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProfileResource relation
* @method ChildProfileQuery rightJoinProfileResource($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProfileResource relation
* @method ChildProfileQuery innerJoinProfileResource($relationAlias = null) Adds a INNER JOIN clause to the query using the ProfileResource relation
*
* @method ChildGroupQuery leftJoinGroupModule($relationAlias = null) Adds a LEFT JOIN clause to the query using the GroupModule relation
* @method ChildGroupQuery rightJoinGroupModule($relationAlias = null) Adds a RIGHT JOIN clause to the query using the GroupModule relation
* @method ChildGroupQuery innerJoinGroupModule($relationAlias = null) Adds a INNER JOIN clause to the query using the GroupModule relation
* @method ChildProfileQuery leftJoinProfileModule($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProfileModule relation
* @method ChildProfileQuery rightJoinProfileModule($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProfileModule relation
* @method ChildProfileQuery innerJoinProfileModule($relationAlias = null) Adds a INNER JOIN clause to the query using the ProfileModule relation
*
* @method ChildGroupQuery leftJoinGroupI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the GroupI18n relation
* @method ChildGroupQuery rightJoinGroupI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the GroupI18n relation
* @method ChildGroupQuery innerJoinGroupI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the GroupI18n relation
* @method ChildProfileQuery leftJoinProfileI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProfileI18n relation
* @method ChildProfileQuery rightJoinProfileI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProfileI18n relation
* @method ChildProfileQuery innerJoinProfileI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the ProfileI18n relation
*
* @method ChildGroup findOne(ConnectionInterface $con = null) Return the first ChildGroup matching the query
* @method ChildGroup findOneOrCreate(ConnectionInterface $con = null) Return the first ChildGroup matching the query, or a new ChildGroup object populated from the query conditions when no match is found
* @method ChildProfile findOne(ConnectionInterface $con = null) Return the first ChildProfile matching the query
* @method ChildProfile findOneOrCreate(ConnectionInterface $con = null) Return the first ChildProfile matching the query, or a new ChildProfile object populated from the query conditions when no match is found
*
* @method ChildGroup findOneById(int $id) Return the first ChildGroup filtered by the id column
* @method ChildGroup findOneByCode(string $code) Return the first ChildGroup filtered by the code column
* @method ChildGroup findOneByCreatedAt(string $created_at) Return the first ChildGroup filtered by the created_at column
* @method ChildGroup findOneByUpdatedAt(string $updated_at) Return the first ChildGroup filtered by the updated_at column
* @method ChildProfile findOneById(int $id) Return the first ChildProfile filtered by the id column
* @method ChildProfile findOneByCode(string $code) Return the first ChildProfile filtered by the code column
* @method ChildProfile findOneByCreatedAt(string $created_at) Return the first ChildProfile filtered by the created_at column
* @method ChildProfile findOneByUpdatedAt(string $updated_at) Return the first ChildProfile filtered by the updated_at column
*
* @method array findById(int $id) Return ChildGroup objects filtered by the id column
* @method array findByCode(string $code) Return ChildGroup objects filtered by the code column
* @method array findByCreatedAt(string $created_at) Return ChildGroup objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildGroup objects filtered by the updated_at column
* @method array findById(int $id) Return ChildProfile objects filtered by the id column
* @method array findByCode(string $code) Return ChildProfile objects filtered by the code column
* @method array findByCreatedAt(string $created_at) Return ChildProfile objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildProfile objects filtered by the updated_at column
*
*/
abstract class GroupQuery extends ModelCriteria
abstract class ProfileQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\GroupQuery object.
* Initializes internal state of \Thelia\Model\Base\ProfileQuery object.
*
* @param string $dbName The database name
* @param string $modelName The phpName of a model, e.g. 'Book'
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
*/
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\Group', $modelAlias = null)
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\Profile', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildGroupQuery object.
* Returns a new ChildProfileQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildGroupQuery
* @return ChildProfileQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\GroupQuery) {
if ($criteria instanceof \Thelia\Model\ProfileQuery) {
return $criteria;
}
$query = new \Thelia\Model\GroupQuery();
$query = new \Thelia\Model\ProfileQuery();
if (null !== $modelAlias) {
$query->setModelAlias($modelAlias);
}
@@ -117,19 +117,19 @@ abstract class GroupQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildGroup|array|mixed the result, formatted by the current formatter
* @return ChildProfile|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = GroupTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
if ((null !== ($obj = ProfileTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(GroupTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getReadConnection(ProfileTableMap::DATABASE_NAME);
}
$this->basePreSelect($con);
if ($this->formatter || $this->modelAlias || $this->with || $this->select
@@ -148,11 +148,11 @@ abstract class GroupQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
* @return ChildGroup A model object, or null if the key is not found
* @return ChildProfile A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, CODE, CREATED_AT, UPDATED_AT FROM group WHERE ID = :p0';
$sql = 'SELECT ID, CODE, CREATED_AT, UPDATED_AT FROM profile WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
@@ -163,9 +163,9 @@ abstract class GroupQuery extends ModelCriteria
}
$obj = null;
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
$obj = new ChildGroup();
$obj = new ChildProfile();
$obj->hydrate($row);
GroupTableMap::addInstanceToPool($obj, (string) $key);
ProfileTableMap::addInstanceToPool($obj, (string) $key);
}
$stmt->closeCursor();
@@ -178,7 +178,7 @@ abstract class GroupQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
* @return ChildGroup|array|mixed the result, formatted by the current formatter
* @return ChildProfile|array|mixed the result, formatted by the current formatter
*/
protected function findPkComplex($key, $con)
{
@@ -220,12 +220,12 @@ abstract class GroupQuery extends ModelCriteria
*
* @param mixed $key Primary key to use for the query
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(GroupTableMap::ID, $key, Criteria::EQUAL);
return $this->addUsingAlias(ProfileTableMap::ID, $key, Criteria::EQUAL);
}
/**
@@ -233,12 +233,12 @@ abstract class GroupQuery extends ModelCriteria
*
* @param array $keys The list of primary key to use for the query
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(GroupTableMap::ID, $keys, Criteria::IN);
return $this->addUsingAlias(ProfileTableMap::ID, $keys, Criteria::IN);
}
/**
@@ -257,18 +257,18 @@ abstract class GroupQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery 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(GroupTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$this->addUsingAlias(ProfileTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(GroupTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$this->addUsingAlias(ProfileTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -279,7 +279,7 @@ abstract class GroupQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupTableMap::ID, $id, $comparison);
return $this->addUsingAlias(ProfileTableMap::ID, $id, $comparison);
}
/**
@@ -295,7 +295,7 @@ abstract class GroupQuery extends ModelCriteria
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery The current query, for fluid interface
*/
public function filterByCode($code = null, $comparison = null)
{
@@ -308,7 +308,7 @@ abstract class GroupQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupTableMap::CODE, $code, $comparison);
return $this->addUsingAlias(ProfileTableMap::CODE, $code, $comparison);
}
/**
@@ -329,18 +329,18 @@ abstract class GroupQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery 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(GroupTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$this->addUsingAlias(ProfileTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(GroupTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$this->addUsingAlias(ProfileTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -351,7 +351,7 @@ abstract class GroupQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupTableMap::CREATED_AT, $createdAt, $comparison);
return $this->addUsingAlias(ProfileTableMap::CREATED_AT, $createdAt, $comparison);
}
/**
@@ -372,18 +372,18 @@ abstract class GroupQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery 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(GroupTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$this->addUsingAlias(ProfileTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(GroupTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$this->addUsingAlias(ProfileTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -394,44 +394,44 @@ abstract class GroupQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupTableMap::UPDATED_AT, $updatedAt, $comparison);
return $this->addUsingAlias(ProfileTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\AdminGroup object
* Filter the query by a related \Thelia\Model\Admin object
*
* @param \Thelia\Model\AdminGroup|ObjectCollection $adminGroup the related object to use as filter
* @param \Thelia\Model\Admin|ObjectCollection $admin the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery The current query, for fluid interface
*/
public function filterByAdminGroup($adminGroup, $comparison = null)
public function filterByAdmin($admin, $comparison = null)
{
if ($adminGroup instanceof \Thelia\Model\AdminGroup) {
if ($admin instanceof \Thelia\Model\Admin) {
return $this
->addUsingAlias(GroupTableMap::ID, $adminGroup->getGroupId(), $comparison);
} elseif ($adminGroup instanceof ObjectCollection) {
->addUsingAlias(ProfileTableMap::ID, $admin->getProfileId(), $comparison);
} elseif ($admin instanceof ObjectCollection) {
return $this
->useAdminGroupQuery()
->filterByPrimaryKeys($adminGroup->getPrimaryKeys())
->useAdminQuery()
->filterByPrimaryKeys($admin->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByAdminGroup() only accepts arguments of type \Thelia\Model\AdminGroup or Collection');
throw new PropelException('filterByAdmin() only accepts arguments of type \Thelia\Model\Admin or Collection');
}
}
/**
* Adds a JOIN clause to the query using the AdminGroup relation
* Adds a JOIN clause to the query using the Admin relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery The current query, for fluid interface
*/
public function joinAdminGroup($relationAlias = null, $joinType = Criteria::INNER_JOIN)
public function joinAdmin($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('AdminGroup');
$relationMap = $tableMap->getRelation('Admin');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -446,14 +446,14 @@ abstract class GroupQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'AdminGroup');
$this->addJoinObject($join, 'Admin');
}
return $this;
}
/**
* Use the AdminGroup relation AdminGroup object
* Use the Admin relation Admin object
*
* @see useQuery()
*
@@ -461,50 +461,50 @@ abstract class GroupQuery extends ModelCriteria
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \Thelia\Model\AdminGroupQuery A secondary query class using the current class as primary query
* @return \Thelia\Model\AdminQuery A secondary query class using the current class as primary query
*/
public function useAdminGroupQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
public function useAdminQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinAdminGroup($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'AdminGroup', '\Thelia\Model\AdminGroupQuery');
->joinAdmin($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Admin', '\Thelia\Model\AdminQuery');
}
/**
* Filter the query by a related \Thelia\Model\GroupResource object
* Filter the query by a related \Thelia\Model\ProfileResource object
*
* @param \Thelia\Model\GroupResource|ObjectCollection $groupResource the related object to use as filter
* @param \Thelia\Model\ProfileResource|ObjectCollection $profileResource the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery The current query, for fluid interface
*/
public function filterByGroupResource($groupResource, $comparison = null)
public function filterByProfileResource($profileResource, $comparison = null)
{
if ($groupResource instanceof \Thelia\Model\GroupResource) {
if ($profileResource instanceof \Thelia\Model\ProfileResource) {
return $this
->addUsingAlias(GroupTableMap::ID, $groupResource->getGroupId(), $comparison);
} elseif ($groupResource instanceof ObjectCollection) {
->addUsingAlias(ProfileTableMap::ID, $profileResource->getProfileId(), $comparison);
} elseif ($profileResource instanceof ObjectCollection) {
return $this
->useGroupResourceQuery()
->filterByPrimaryKeys($groupResource->getPrimaryKeys())
->useProfileResourceQuery()
->filterByPrimaryKeys($profileResource->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByGroupResource() only accepts arguments of type \Thelia\Model\GroupResource or Collection');
throw new PropelException('filterByProfileResource() only accepts arguments of type \Thelia\Model\ProfileResource or Collection');
}
}
/**
* Adds a JOIN clause to the query using the GroupResource relation
* Adds a JOIN clause to the query using the ProfileResource relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery The current query, for fluid interface
*/
public function joinGroupResource($relationAlias = null, $joinType = Criteria::INNER_JOIN)
public function joinProfileResource($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('GroupResource');
$relationMap = $tableMap->getRelation('ProfileResource');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -519,14 +519,14 @@ abstract class GroupQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'GroupResource');
$this->addJoinObject($join, 'ProfileResource');
}
return $this;
}
/**
* Use the GroupResource relation GroupResource object
* Use the ProfileResource relation ProfileResource object
*
* @see useQuery()
*
@@ -534,50 +534,50 @@ abstract class GroupQuery extends ModelCriteria
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \Thelia\Model\GroupResourceQuery A secondary query class using the current class as primary query
* @return \Thelia\Model\ProfileResourceQuery A secondary query class using the current class as primary query
*/
public function useGroupResourceQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
public function useProfileResourceQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinGroupResource($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'GroupResource', '\Thelia\Model\GroupResourceQuery');
->joinProfileResource($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'ProfileResource', '\Thelia\Model\ProfileResourceQuery');
}
/**
* Filter the query by a related \Thelia\Model\GroupModule object
* Filter the query by a related \Thelia\Model\ProfileModule object
*
* @param \Thelia\Model\GroupModule|ObjectCollection $groupModule the related object to use as filter
* @param \Thelia\Model\ProfileModule|ObjectCollection $profileModule the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery The current query, for fluid interface
*/
public function filterByGroupModule($groupModule, $comparison = null)
public function filterByProfileModule($profileModule, $comparison = null)
{
if ($groupModule instanceof \Thelia\Model\GroupModule) {
if ($profileModule instanceof \Thelia\Model\ProfileModule) {
return $this
->addUsingAlias(GroupTableMap::ID, $groupModule->getGroupId(), $comparison);
} elseif ($groupModule instanceof ObjectCollection) {
->addUsingAlias(ProfileTableMap::ID, $profileModule->getProfileId(), $comparison);
} elseif ($profileModule instanceof ObjectCollection) {
return $this
->useGroupModuleQuery()
->filterByPrimaryKeys($groupModule->getPrimaryKeys())
->useProfileModuleQuery()
->filterByPrimaryKeys($profileModule->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByGroupModule() only accepts arguments of type \Thelia\Model\GroupModule or Collection');
throw new PropelException('filterByProfileModule() only accepts arguments of type \Thelia\Model\ProfileModule or Collection');
}
}
/**
* Adds a JOIN clause to the query using the GroupModule relation
* Adds a JOIN clause to the query using the ProfileModule relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery The current query, for fluid interface
*/
public function joinGroupModule($relationAlias = null, $joinType = Criteria::INNER_JOIN)
public function joinProfileModule($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('GroupModule');
$relationMap = $tableMap->getRelation('ProfileModule');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -592,14 +592,14 @@ abstract class GroupQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'GroupModule');
$this->addJoinObject($join, 'ProfileModule');
}
return $this;
}
/**
* Use the GroupModule relation GroupModule object
* Use the ProfileModule relation ProfileModule object
*
* @see useQuery()
*
@@ -607,50 +607,50 @@ abstract class GroupQuery extends ModelCriteria
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \Thelia\Model\GroupModuleQuery A secondary query class using the current class as primary query
* @return \Thelia\Model\ProfileModuleQuery A secondary query class using the current class as primary query
*/
public function useGroupModuleQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
public function useProfileModuleQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinGroupModule($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'GroupModule', '\Thelia\Model\GroupModuleQuery');
->joinProfileModule($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'ProfileModule', '\Thelia\Model\ProfileModuleQuery');
}
/**
* Filter the query by a related \Thelia\Model\GroupI18n object
* Filter the query by a related \Thelia\Model\ProfileI18n object
*
* @param \Thelia\Model\GroupI18n|ObjectCollection $groupI18n the related object to use as filter
* @param \Thelia\Model\ProfileI18n|ObjectCollection $profileI18n the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery The current query, for fluid interface
*/
public function filterByGroupI18n($groupI18n, $comparison = null)
public function filterByProfileI18n($profileI18n, $comparison = null)
{
if ($groupI18n instanceof \Thelia\Model\GroupI18n) {
if ($profileI18n instanceof \Thelia\Model\ProfileI18n) {
return $this
->addUsingAlias(GroupTableMap::ID, $groupI18n->getId(), $comparison);
} elseif ($groupI18n instanceof ObjectCollection) {
->addUsingAlias(ProfileTableMap::ID, $profileI18n->getId(), $comparison);
} elseif ($profileI18n instanceof ObjectCollection) {
return $this
->useGroupI18nQuery()
->filterByPrimaryKeys($groupI18n->getPrimaryKeys())
->useProfileI18nQuery()
->filterByPrimaryKeys($profileI18n->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByGroupI18n() only accepts arguments of type \Thelia\Model\GroupI18n or Collection');
throw new PropelException('filterByProfileI18n() only accepts arguments of type \Thelia\Model\ProfileI18n or Collection');
}
}
/**
* Adds a JOIN clause to the query using the GroupI18n relation
* Adds a JOIN clause to the query using the ProfileI18n relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery The current query, for fluid interface
*/
public function joinGroupI18n($relationAlias = null, $joinType = 'LEFT JOIN')
public function joinProfileI18n($relationAlias = null, $joinType = 'LEFT JOIN')
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('GroupI18n');
$relationMap = $tableMap->getRelation('ProfileI18n');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -665,14 +665,14 @@ abstract class GroupQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'GroupI18n');
$this->addJoinObject($join, 'ProfileI18n');
}
return $this;
}
/**
* Use the GroupI18n relation GroupI18n object
* Use the ProfileI18n relation ProfileI18n object
*
* @see useQuery()
*
@@ -680,45 +680,28 @@ abstract class GroupQuery extends ModelCriteria
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \Thelia\Model\GroupI18nQuery A secondary query class using the current class as primary query
* @return \Thelia\Model\ProfileI18nQuery A secondary query class using the current class as primary query
*/
public function useGroupI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
public function useProfileI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
{
return $this
->joinGroupI18n($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'GroupI18n', '\Thelia\Model\GroupI18nQuery');
}
/**
* Filter the query by a related Admin object
* using the admin_group table as cross reference
*
* @param Admin $admin the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupQuery The current query, for fluid interface
*/
public function filterByAdmin($admin, $comparison = Criteria::EQUAL)
{
return $this
->useAdminGroupQuery()
->filterByAdmin($admin, $comparison)
->endUse();
->joinProfileI18n($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'ProfileI18n', '\Thelia\Model\ProfileI18nQuery');
}
/**
* Filter the query by a related Resource object
* using the group_resource table as cross reference
* using the profile_resource table as cross reference
*
* @param Resource $resource the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery The current query, for fluid interface
*/
public function filterByResource($resource, $comparison = Criteria::EQUAL)
{
return $this
->useGroupResourceQuery()
->useProfileResourceQuery()
->filterByResource($resource, $comparison)
->endUse();
}
@@ -726,21 +709,21 @@ abstract class GroupQuery extends ModelCriteria
/**
* Exclude object from result
*
* @param ChildGroup $group Object to remove from the list of results
* @param ChildProfile $profile Object to remove from the list of results
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery The current query, for fluid interface
*/
public function prune($group = null)
public function prune($profile = null)
{
if ($group) {
$this->addUsingAlias(GroupTableMap::ID, $group->getId(), Criteria::NOT_EQUAL);
if ($profile) {
$this->addUsingAlias(ProfileTableMap::ID, $profile->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the group table.
* Deletes all rows from the profile table.
*
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
@@ -748,7 +731,7 @@ abstract class GroupQuery extends ModelCriteria
public function doDeleteAll(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(GroupTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProfileTableMap::DATABASE_NAME);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
@@ -759,8 +742,8 @@ abstract class GroupQuery extends ModelCriteria
// 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).
GroupTableMap::clearInstancePool();
GroupTableMap::clearRelatedInstancePool();
ProfileTableMap::clearInstancePool();
ProfileTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
@@ -772,9 +755,9 @@ abstract class GroupQuery extends ModelCriteria
}
/**
* Performs a DELETE on the database, given a ChildGroup or Criteria object OR a primary key value.
* Performs a DELETE on the database, given a ChildProfile or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildGroup object or primary key or array of primary keys
* @param mixed $values Criteria or ChildProfile object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
@@ -785,13 +768,13 @@ abstract class GroupQuery extends ModelCriteria
public function delete(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(GroupTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProfileTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(GroupTableMap::DATABASE_NAME);
$criteria->setDbName(ProfileTableMap::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
@@ -801,10 +784,10 @@ abstract class GroupQuery extends ModelCriteria
$con->beginTransaction();
GroupTableMap::removeInstanceFromPool($criteria);
ProfileTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
GroupTableMap::clearRelatedInstancePool();
ProfileTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
@@ -821,11 +804,11 @@ abstract class GroupQuery extends ModelCriteria
*
* @param int $nbDays Maximum age of the latest update in days
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(GroupTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
return $this->addUsingAlias(ProfileTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
@@ -833,51 +816,51 @@ abstract class GroupQuery extends ModelCriteria
*
* @param int $nbDays Maximum age of in days
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(GroupTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
return $this->addUsingAlias(ProfileTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(GroupTableMap::UPDATED_AT);
return $this->addDescendingOrderByColumn(ProfileTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(GroupTableMap::UPDATED_AT);
return $this->addAscendingOrderByColumn(ProfileTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(GroupTableMap::CREATED_AT);
return $this->addDescendingOrderByColumn(ProfileTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(GroupTableMap::CREATED_AT);
return $this->addAscendingOrderByColumn(ProfileTableMap::CREATED_AT);
}
// i18n behavior
@@ -889,14 +872,14 @@ abstract class GroupQuery extends ModelCriteria
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery The current query, for fluid interface
*/
public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$relationName = $relationAlias ? $relationAlias : 'GroupI18n';
$relationName = $relationAlias ? $relationAlias : 'ProfileI18n';
return $this
->joinGroupI18n($relationAlias, $joinType)
->joinProfileI18n($relationAlias, $joinType)
->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
}
@@ -907,14 +890,14 @@ abstract class GroupQuery extends ModelCriteria
* @param string $locale Locale to use for the join condition, e.g. 'fr_FR'
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
*
* @return ChildGroupQuery The current query, for fluid interface
* @return ChildProfileQuery The current query, for fluid interface
*/
public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN)
{
$this
->joinI18n($locale, null, $joinType)
->with('GroupI18n');
$this->with['GroupI18n']->setIsWithOneToMany(false);
->with('ProfileI18n');
$this->with['ProfileI18n']->setIsWithOneToMany(false);
return $this;
}
@@ -928,13 +911,13 @@ abstract class GroupQuery extends ModelCriteria
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
*
* @return ChildGroupI18nQuery A secondary query class using the current class as primary query
* @return ChildProfileI18nQuery A secondary query class using the current class as primary query
*/
public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinI18n($locale, $relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'GroupI18n', '\Thelia\Model\GroupI18nQuery');
->useQuery($relationAlias ? $relationAlias : 'ProfileI18n', '\Thelia\Model\ProfileI18nQuery');
}
} // GroupQuery
} // ProfileQuery

View File

@@ -16,20 +16,20 @@ use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Parser\AbstractParser;
use Propel\Runtime\Util\PropelDateTime;
use Thelia\Model\Group as ChildGroup;
use Thelia\Model\GroupQuery as ChildGroupQuery;
use Thelia\Model\GroupResource as ChildGroupResource;
use Thelia\Model\GroupResourceQuery as ChildGroupResourceQuery;
use Thelia\Model\Profile as ChildProfile;
use Thelia\Model\ProfileQuery as ChildProfileQuery;
use Thelia\Model\ProfileResource as ChildProfileResource;
use Thelia\Model\ProfileResourceQuery as ChildProfileResourceQuery;
use Thelia\Model\Resource as ChildResource;
use Thelia\Model\ResourceQuery as ChildResourceQuery;
use Thelia\Model\Map\GroupResourceTableMap;
use Thelia\Model\Map\ProfileResourceTableMap;
abstract class GroupResource implements ActiveRecordInterface
abstract class ProfileResource implements ActiveRecordInterface
{
/**
* TableMap class name
*/
const TABLE_MAP = '\\Thelia\\Model\\Map\\GroupResourceTableMap';
const TABLE_MAP = '\\Thelia\\Model\\Map\\ProfileResourceTableMap';
/**
@@ -65,10 +65,10 @@ abstract class GroupResource implements ActiveRecordInterface
protected $id;
/**
* The value for the group_id field.
* The value for the profile_id field.
* @var int
*/
protected $group_id;
protected $profile_id;
/**
* The value for the resource_id field.
@@ -103,9 +103,9 @@ abstract class GroupResource implements ActiveRecordInterface
protected $updated_at;
/**
* @var Group
* @var Profile
*/
protected $aGroup;
protected $aProfile;
/**
* @var Resource
@@ -133,7 +133,7 @@ abstract class GroupResource implements ActiveRecordInterface
}
/**
* Initializes internal state of Thelia\Model\Base\GroupResource object.
* Initializes internal state of Thelia\Model\Base\ProfileResource object.
* @see applyDefaults()
*/
public function __construct()
@@ -230,9 +230,9 @@ abstract class GroupResource implements ActiveRecordInterface
}
/**
* Compares this with another <code>GroupResource</code> instance. If
* <code>obj</code> is an instance of <code>GroupResource</code>, delegates to
* <code>equals(GroupResource)</code>. Otherwise, returns <code>false</code>.
* Compares this with another <code>ProfileResource</code> instance. If
* <code>obj</code> is an instance of <code>ProfileResource</code>, delegates to
* <code>equals(ProfileResource)</code>. Otherwise, returns <code>false</code>.
*
* @param mixed $obj The object to compare to.
* @return boolean Whether equal to the object specified.
@@ -315,7 +315,7 @@ abstract class GroupResource implements ActiveRecordInterface
* @param string $name The virtual column name
* @param mixed $value The value to give to the virtual column
*
* @return GroupResource The current object, for fluid interface
* @return ProfileResource The current object, for fluid interface
*/
public function setVirtualColumn($name, $value)
{
@@ -347,7 +347,7 @@ abstract class GroupResource implements ActiveRecordInterface
* or a format name ('XML', 'YAML', 'JSON', 'CSV')
* @param string $data The source data to import from
*
* @return GroupResource The current object, for fluid interface
* @return ProfileResource The current object, for fluid interface
*/
public function importFrom($parser, $data)
{
@@ -404,14 +404,14 @@ abstract class GroupResource implements ActiveRecordInterface
}
/**
* Get the [group_id] column value.
* Get the [profile_id] column value.
*
* @return int
*/
public function getGroupId()
public function getProfileId()
{
return $this->group_id;
return $this->profile_id;
}
/**
@@ -491,7 +491,7 @@ abstract class GroupResource implements ActiveRecordInterface
* Set the value of [id] column.
*
* @param int $v new value
* @return \Thelia\Model\GroupResource The current object (for fluent API support)
* @return \Thelia\Model\ProfileResource The current object (for fluent API support)
*/
public function setId($v)
{
@@ -501,7 +501,7 @@ abstract class GroupResource implements ActiveRecordInterface
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = GroupResourceTableMap::ID;
$this->modifiedColumns[] = ProfileResourceTableMap::ID;
}
@@ -509,35 +509,35 @@ abstract class GroupResource implements ActiveRecordInterface
} // setId()
/**
* Set the value of [group_id] column.
* Set the value of [profile_id] column.
*
* @param int $v new value
* @return \Thelia\Model\GroupResource The current object (for fluent API support)
* @return \Thelia\Model\ProfileResource The current object (for fluent API support)
*/
public function setGroupId($v)
public function setProfileId($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->group_id !== $v) {
$this->group_id = $v;
$this->modifiedColumns[] = GroupResourceTableMap::GROUP_ID;
if ($this->profile_id !== $v) {
$this->profile_id = $v;
$this->modifiedColumns[] = ProfileResourceTableMap::PROFILE_ID;
}
if ($this->aGroup !== null && $this->aGroup->getId() !== $v) {
$this->aGroup = null;
if ($this->aProfile !== null && $this->aProfile->getId() !== $v) {
$this->aProfile = null;
}
return $this;
} // setGroupId()
} // setProfileId()
/**
* Set the value of [resource_id] column.
*
* @param int $v new value
* @return \Thelia\Model\GroupResource The current object (for fluent API support)
* @return \Thelia\Model\ProfileResource The current object (for fluent API support)
*/
public function setResourceId($v)
{
@@ -547,7 +547,7 @@ abstract class GroupResource implements ActiveRecordInterface
if ($this->resource_id !== $v) {
$this->resource_id = $v;
$this->modifiedColumns[] = GroupResourceTableMap::RESOURCE_ID;
$this->modifiedColumns[] = ProfileResourceTableMap::RESOURCE_ID;
}
if ($this->aResource !== null && $this->aResource->getId() !== $v) {
@@ -562,7 +562,7 @@ abstract class GroupResource implements ActiveRecordInterface
* Set the value of [read] column.
*
* @param int $v new value
* @return \Thelia\Model\GroupResource The current object (for fluent API support)
* @return \Thelia\Model\ProfileResource The current object (for fluent API support)
*/
public function setRead($v)
{
@@ -572,7 +572,7 @@ abstract class GroupResource implements ActiveRecordInterface
if ($this->read !== $v) {
$this->read = $v;
$this->modifiedColumns[] = GroupResourceTableMap::READ;
$this->modifiedColumns[] = ProfileResourceTableMap::READ;
}
@@ -583,7 +583,7 @@ abstract class GroupResource implements ActiveRecordInterface
* Set the value of [write] column.
*
* @param int $v new value
* @return \Thelia\Model\GroupResource The current object (for fluent API support)
* @return \Thelia\Model\ProfileResource The current object (for fluent API support)
*/
public function setWrite($v)
{
@@ -593,7 +593,7 @@ abstract class GroupResource implements ActiveRecordInterface
if ($this->write !== $v) {
$this->write = $v;
$this->modifiedColumns[] = GroupResourceTableMap::WRITE;
$this->modifiedColumns[] = ProfileResourceTableMap::WRITE;
}
@@ -605,7 +605,7 @@ abstract class GroupResource implements ActiveRecordInterface
*
* @param mixed $v string, integer (timestamp), or \DateTime value.
* Empty strings are treated as NULL.
* @return \Thelia\Model\GroupResource The current object (for fluent API support)
* @return \Thelia\Model\ProfileResource The current object (for fluent API support)
*/
public function setCreatedAt($v)
{
@@ -613,7 +613,7 @@ abstract class GroupResource implements ActiveRecordInterface
if ($this->created_at !== null || $dt !== null) {
if ($dt !== $this->created_at) {
$this->created_at = $dt;
$this->modifiedColumns[] = GroupResourceTableMap::CREATED_AT;
$this->modifiedColumns[] = ProfileResourceTableMap::CREATED_AT;
}
} // if either are not null
@@ -626,7 +626,7 @@ abstract class GroupResource implements ActiveRecordInterface
*
* @param mixed $v string, integer (timestamp), or \DateTime value.
* Empty strings are treated as NULL.
* @return \Thelia\Model\GroupResource The current object (for fluent API support)
* @return \Thelia\Model\ProfileResource The current object (for fluent API support)
*/
public function setUpdatedAt($v)
{
@@ -634,7 +634,7 @@ abstract class GroupResource implements ActiveRecordInterface
if ($this->updated_at !== null || $dt !== null) {
if ($dt !== $this->updated_at) {
$this->updated_at = $dt;
$this->modifiedColumns[] = GroupResourceTableMap::UPDATED_AT;
$this->modifiedColumns[] = ProfileResourceTableMap::UPDATED_AT;
}
} // if either are not null
@@ -687,28 +687,28 @@ abstract class GroupResource implements ActiveRecordInterface
try {
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : GroupResourceTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : ProfileResourceTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$this->id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : GroupResourceTableMap::translateFieldName('GroupId', TableMap::TYPE_PHPNAME, $indexType)];
$this->group_id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ProfileResourceTableMap::translateFieldName('ProfileId', TableMap::TYPE_PHPNAME, $indexType)];
$this->profile_id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : GroupResourceTableMap::translateFieldName('ResourceId', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ProfileResourceTableMap::translateFieldName('ResourceId', TableMap::TYPE_PHPNAME, $indexType)];
$this->resource_id = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : GroupResourceTableMap::translateFieldName('Read', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ProfileResourceTableMap::translateFieldName('Read', TableMap::TYPE_PHPNAME, $indexType)];
$this->read = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : GroupResourceTableMap::translateFieldName('Write', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ProfileResourceTableMap::translateFieldName('Write', TableMap::TYPE_PHPNAME, $indexType)];
$this->write = (null !== $col) ? (int) $col : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : GroupResourceTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : ProfileResourceTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
$this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : GroupResourceTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : ProfileResourceTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
if ($col === '0000-00-00 00:00:00') {
$col = null;
}
@@ -721,10 +721,10 @@ abstract class GroupResource implements ActiveRecordInterface
$this->ensureConsistency();
}
return $startcol + 7; // 7 = GroupResourceTableMap::NUM_HYDRATE_COLUMNS.
return $startcol + 7; // 7 = ProfileResourceTableMap::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating \Thelia\Model\GroupResource object", 0, $e);
throw new PropelException("Error populating \Thelia\Model\ProfileResource object", 0, $e);
}
}
@@ -743,8 +743,8 @@ abstract class GroupResource implements ActiveRecordInterface
*/
public function ensureConsistency()
{
if ($this->aGroup !== null && $this->group_id !== $this->aGroup->getId()) {
$this->aGroup = null;
if ($this->aProfile !== null && $this->profile_id !== $this->aProfile->getId()) {
$this->aProfile = null;
}
if ($this->aResource !== null && $this->resource_id !== $this->aResource->getId()) {
$this->aResource = null;
@@ -772,13 +772,13 @@ abstract class GroupResource implements ActiveRecordInterface
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(GroupResourceTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getReadConnection(ProfileResourceTableMap::DATABASE_NAME);
}
// We don't need to alter the object instance pool; we're just modifying this instance
// already in the pool.
$dataFetcher = ChildGroupResourceQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
$dataFetcher = ChildProfileResourceQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
$row = $dataFetcher->fetch();
$dataFetcher->close();
if (!$row) {
@@ -788,7 +788,7 @@ abstract class GroupResource implements ActiveRecordInterface
if ($deep) { // also de-associate any related objects?
$this->aGroup = null;
$this->aProfile = null;
$this->aResource = null;
} // if (deep)
}
@@ -799,8 +799,8 @@ abstract class GroupResource implements ActiveRecordInterface
* @param ConnectionInterface $con
* @return void
* @throws PropelException
* @see GroupResource::setDeleted()
* @see GroupResource::isDeleted()
* @see ProfileResource::setDeleted()
* @see ProfileResource::isDeleted()
*/
public function delete(ConnectionInterface $con = null)
{
@@ -809,12 +809,12 @@ abstract class GroupResource implements ActiveRecordInterface
}
if ($con === null) {
$con = Propel::getServiceContainer()->getWriteConnection(GroupResourceTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProfileResourceTableMap::DATABASE_NAME);
}
$con->beginTransaction();
try {
$deleteQuery = ChildGroupResourceQuery::create()
$deleteQuery = ChildProfileResourceQuery::create()
->filterByPrimaryKey($this->getPrimaryKey());
$ret = $this->preDelete($con);
if ($ret) {
@@ -851,7 +851,7 @@ abstract class GroupResource implements ActiveRecordInterface
}
if ($con === null) {
$con = Propel::getServiceContainer()->getWriteConnection(GroupResourceTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProfileResourceTableMap::DATABASE_NAME);
}
$con->beginTransaction();
@@ -861,16 +861,16 @@ abstract class GroupResource implements ActiveRecordInterface
if ($isInsert) {
$ret = $ret && $this->preInsert($con);
// timestampable behavior
if (!$this->isColumnModified(GroupResourceTableMap::CREATED_AT)) {
if (!$this->isColumnModified(ProfileResourceTableMap::CREATED_AT)) {
$this->setCreatedAt(time());
}
if (!$this->isColumnModified(GroupResourceTableMap::UPDATED_AT)) {
if (!$this->isColumnModified(ProfileResourceTableMap::UPDATED_AT)) {
$this->setUpdatedAt(time());
}
} else {
$ret = $ret && $this->preUpdate($con);
// timestampable behavior
if ($this->isModified() && !$this->isColumnModified(GroupResourceTableMap::UPDATED_AT)) {
if ($this->isModified() && !$this->isColumnModified(ProfileResourceTableMap::UPDATED_AT)) {
$this->setUpdatedAt(time());
}
}
@@ -882,7 +882,7 @@ abstract class GroupResource implements ActiveRecordInterface
$this->postUpdate($con);
}
$this->postSave($con);
GroupResourceTableMap::addInstanceToPool($this);
ProfileResourceTableMap::addInstanceToPool($this);
} else {
$affectedRows = 0;
}
@@ -917,11 +917,11 @@ abstract class GroupResource implements ActiveRecordInterface
// method. This object relates to these object(s) by a
// foreign key reference.
if ($this->aGroup !== null) {
if ($this->aGroup->isModified() || $this->aGroup->isNew()) {
$affectedRows += $this->aGroup->save($con);
if ($this->aProfile !== null) {
if ($this->aProfile->isModified() || $this->aProfile->isNew()) {
$affectedRows += $this->aProfile->save($con);
}
$this->setGroup($this->aGroup);
$this->setProfile($this->aProfile);
}
if ($this->aResource !== null) {
@@ -962,36 +962,36 @@ abstract class GroupResource implements ActiveRecordInterface
$modifiedColumns = array();
$index = 0;
$this->modifiedColumns[] = GroupResourceTableMap::ID;
$this->modifiedColumns[] = ProfileResourceTableMap::ID;
if (null !== $this->id) {
throw new PropelException('Cannot insert a value for auto-increment primary key (' . GroupResourceTableMap::ID . ')');
throw new PropelException('Cannot insert a value for auto-increment primary key (' . ProfileResourceTableMap::ID . ')');
}
// check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(GroupResourceTableMap::ID)) {
if ($this->isColumnModified(ProfileResourceTableMap::ID)) {
$modifiedColumns[':p' . $index++] = 'ID';
}
if ($this->isColumnModified(GroupResourceTableMap::GROUP_ID)) {
$modifiedColumns[':p' . $index++] = 'GROUP_ID';
if ($this->isColumnModified(ProfileResourceTableMap::PROFILE_ID)) {
$modifiedColumns[':p' . $index++] = 'PROFILE_ID';
}
if ($this->isColumnModified(GroupResourceTableMap::RESOURCE_ID)) {
if ($this->isColumnModified(ProfileResourceTableMap::RESOURCE_ID)) {
$modifiedColumns[':p' . $index++] = 'RESOURCE_ID';
}
if ($this->isColumnModified(GroupResourceTableMap::READ)) {
if ($this->isColumnModified(ProfileResourceTableMap::READ)) {
$modifiedColumns[':p' . $index++] = 'READ';
}
if ($this->isColumnModified(GroupResourceTableMap::WRITE)) {
if ($this->isColumnModified(ProfileResourceTableMap::WRITE)) {
$modifiedColumns[':p' . $index++] = 'WRITE';
}
if ($this->isColumnModified(GroupResourceTableMap::CREATED_AT)) {
if ($this->isColumnModified(ProfileResourceTableMap::CREATED_AT)) {
$modifiedColumns[':p' . $index++] = 'CREATED_AT';
}
if ($this->isColumnModified(GroupResourceTableMap::UPDATED_AT)) {
if ($this->isColumnModified(ProfileResourceTableMap::UPDATED_AT)) {
$modifiedColumns[':p' . $index++] = 'UPDATED_AT';
}
$sql = sprintf(
'INSERT INTO group_resource (%s) VALUES (%s)',
'INSERT INTO profile_resource (%s) VALUES (%s)',
implode(', ', $modifiedColumns),
implode(', ', array_keys($modifiedColumns))
);
@@ -1003,8 +1003,8 @@ abstract class GroupResource implements ActiveRecordInterface
case 'ID':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break;
case 'GROUP_ID':
$stmt->bindValue($identifier, $this->group_id, PDO::PARAM_INT);
case 'PROFILE_ID':
$stmt->bindValue($identifier, $this->profile_id, PDO::PARAM_INT);
break;
case 'RESOURCE_ID':
$stmt->bindValue($identifier, $this->resource_id, PDO::PARAM_INT);
@@ -1067,7 +1067,7 @@ abstract class GroupResource implements ActiveRecordInterface
*/
public function getByName($name, $type = TableMap::TYPE_PHPNAME)
{
$pos = GroupResourceTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
$pos = ProfileResourceTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
$field = $this->getByPosition($pos);
return $field;
@@ -1087,7 +1087,7 @@ abstract class GroupResource implements ActiveRecordInterface
return $this->getId();
break;
case 1:
return $this->getGroupId();
return $this->getProfileId();
break;
case 2:
return $this->getResourceId();
@@ -1127,14 +1127,14 @@ abstract class GroupResource implements ActiveRecordInterface
*/
public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['GroupResource'][serialize($this->getPrimaryKey())])) {
if (isset($alreadyDumpedObjects['ProfileResource'][serialize($this->getPrimaryKey())])) {
return '*RECURSION*';
}
$alreadyDumpedObjects['GroupResource'][serialize($this->getPrimaryKey())] = true;
$keys = GroupResourceTableMap::getFieldNames($keyType);
$alreadyDumpedObjects['ProfileResource'][serialize($this->getPrimaryKey())] = true;
$keys = ProfileResourceTableMap::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getGroupId(),
$keys[1] => $this->getProfileId(),
$keys[2] => $this->getResourceId(),
$keys[3] => $this->getRead(),
$keys[4] => $this->getWrite(),
@@ -1147,8 +1147,8 @@ abstract class GroupResource implements ActiveRecordInterface
}
if ($includeForeignObjects) {
if (null !== $this->aGroup) {
$result['Group'] = $this->aGroup->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
if (null !== $this->aProfile) {
$result['Profile'] = $this->aProfile->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
if (null !== $this->aResource) {
$result['Resource'] = $this->aResource->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
@@ -1171,7 +1171,7 @@ abstract class GroupResource implements ActiveRecordInterface
*/
public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)
{
$pos = GroupResourceTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
$pos = ProfileResourceTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
@@ -1191,7 +1191,7 @@ abstract class GroupResource implements ActiveRecordInterface
$this->setId($value);
break;
case 1:
$this->setGroupId($value);
$this->setProfileId($value);
break;
case 2:
$this->setResourceId($value);
@@ -1230,10 +1230,10 @@ abstract class GroupResource implements ActiveRecordInterface
*/
public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
{
$keys = GroupResourceTableMap::getFieldNames($keyType);
$keys = ProfileResourceTableMap::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setGroupId($arr[$keys[1]]);
if (array_key_exists($keys[1], $arr)) $this->setProfileId($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setResourceId($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setRead($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setWrite($arr[$keys[4]]);
@@ -1248,15 +1248,15 @@ abstract class GroupResource implements ActiveRecordInterface
*/
public function buildCriteria()
{
$criteria = new Criteria(GroupResourceTableMap::DATABASE_NAME);
$criteria = new Criteria(ProfileResourceTableMap::DATABASE_NAME);
if ($this->isColumnModified(GroupResourceTableMap::ID)) $criteria->add(GroupResourceTableMap::ID, $this->id);
if ($this->isColumnModified(GroupResourceTableMap::GROUP_ID)) $criteria->add(GroupResourceTableMap::GROUP_ID, $this->group_id);
if ($this->isColumnModified(GroupResourceTableMap::RESOURCE_ID)) $criteria->add(GroupResourceTableMap::RESOURCE_ID, $this->resource_id);
if ($this->isColumnModified(GroupResourceTableMap::READ)) $criteria->add(GroupResourceTableMap::READ, $this->read);
if ($this->isColumnModified(GroupResourceTableMap::WRITE)) $criteria->add(GroupResourceTableMap::WRITE, $this->write);
if ($this->isColumnModified(GroupResourceTableMap::CREATED_AT)) $criteria->add(GroupResourceTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(GroupResourceTableMap::UPDATED_AT)) $criteria->add(GroupResourceTableMap::UPDATED_AT, $this->updated_at);
if ($this->isColumnModified(ProfileResourceTableMap::ID)) $criteria->add(ProfileResourceTableMap::ID, $this->id);
if ($this->isColumnModified(ProfileResourceTableMap::PROFILE_ID)) $criteria->add(ProfileResourceTableMap::PROFILE_ID, $this->profile_id);
if ($this->isColumnModified(ProfileResourceTableMap::RESOURCE_ID)) $criteria->add(ProfileResourceTableMap::RESOURCE_ID, $this->resource_id);
if ($this->isColumnModified(ProfileResourceTableMap::READ)) $criteria->add(ProfileResourceTableMap::READ, $this->read);
if ($this->isColumnModified(ProfileResourceTableMap::WRITE)) $criteria->add(ProfileResourceTableMap::WRITE, $this->write);
if ($this->isColumnModified(ProfileResourceTableMap::CREATED_AT)) $criteria->add(ProfileResourceTableMap::CREATED_AT, $this->created_at);
if ($this->isColumnModified(ProfileResourceTableMap::UPDATED_AT)) $criteria->add(ProfileResourceTableMap::UPDATED_AT, $this->updated_at);
return $criteria;
}
@@ -1271,10 +1271,10 @@ abstract class GroupResource implements ActiveRecordInterface
*/
public function buildPkeyCriteria()
{
$criteria = new Criteria(GroupResourceTableMap::DATABASE_NAME);
$criteria->add(GroupResourceTableMap::ID, $this->id);
$criteria->add(GroupResourceTableMap::GROUP_ID, $this->group_id);
$criteria->add(GroupResourceTableMap::RESOURCE_ID, $this->resource_id);
$criteria = new Criteria(ProfileResourceTableMap::DATABASE_NAME);
$criteria->add(ProfileResourceTableMap::ID, $this->id);
$criteria->add(ProfileResourceTableMap::PROFILE_ID, $this->profile_id);
$criteria->add(ProfileResourceTableMap::RESOURCE_ID, $this->resource_id);
return $criteria;
}
@@ -1288,7 +1288,7 @@ abstract class GroupResource implements ActiveRecordInterface
{
$pks = array();
$pks[0] = $this->getId();
$pks[1] = $this->getGroupId();
$pks[1] = $this->getProfileId();
$pks[2] = $this->getResourceId();
return $pks;
@@ -1303,7 +1303,7 @@ abstract class GroupResource implements ActiveRecordInterface
public function setPrimaryKey($keys)
{
$this->setId($keys[0]);
$this->setGroupId($keys[1]);
$this->setProfileId($keys[1]);
$this->setResourceId($keys[2]);
}
@@ -1314,7 +1314,7 @@ abstract class GroupResource implements ActiveRecordInterface
public function isPrimaryKeyNull()
{
return (null === $this->getId()) && (null === $this->getGroupId()) && (null === $this->getResourceId());
return (null === $this->getId()) && (null === $this->getProfileId()) && (null === $this->getResourceId());
}
/**
@@ -1323,14 +1323,14 @@ abstract class GroupResource implements ActiveRecordInterface
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
* @param object $copyObj An object of \Thelia\Model\GroupResource (or compatible) type.
* @param object $copyObj An object of \Thelia\Model\ProfileResource (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->setGroupId($this->getGroupId());
$copyObj->setProfileId($this->getProfileId());
$copyObj->setResourceId($this->getResourceId());
$copyObj->setRead($this->getRead());
$copyObj->setWrite($this->getWrite());
@@ -1351,7 +1351,7 @@ abstract class GroupResource implements ActiveRecordInterface
* objects.
*
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @return \Thelia\Model\GroupResource Clone of current object.
* @return \Thelia\Model\ProfileResource Clone of current object.
* @throws PropelException
*/
public function copy($deepCopy = false)
@@ -1365,26 +1365,26 @@ abstract class GroupResource implements ActiveRecordInterface
}
/**
* Declares an association between this object and a ChildGroup object.
* Declares an association between this object and a ChildProfile object.
*
* @param ChildGroup $v
* @return \Thelia\Model\GroupResource The current object (for fluent API support)
* @param ChildProfile $v
* @return \Thelia\Model\ProfileResource The current object (for fluent API support)
* @throws PropelException
*/
public function setGroup(ChildGroup $v = null)
public function setProfile(ChildProfile $v = null)
{
if ($v === null) {
$this->setGroupId(NULL);
$this->setProfileId(NULL);
} else {
$this->setGroupId($v->getId());
$this->setProfileId($v->getId());
}
$this->aGroup = $v;
$this->aProfile = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the ChildGroup object, it will not be re-added.
// If this object has already been added to the ChildProfile object, it will not be re-added.
if ($v !== null) {
$v->addGroupResource($this);
$v->addProfileResource($this);
}
@@ -1393,33 +1393,33 @@ abstract class GroupResource implements ActiveRecordInterface
/**
* Get the associated ChildGroup object
* Get the associated ChildProfile object
*
* @param ConnectionInterface $con Optional Connection object.
* @return ChildGroup The associated ChildGroup object.
* @return ChildProfile The associated ChildProfile object.
* @throws PropelException
*/
public function getGroup(ConnectionInterface $con = null)
public function getProfile(ConnectionInterface $con = null)
{
if ($this->aGroup === null && ($this->group_id !== null)) {
$this->aGroup = ChildGroupQuery::create()->findPk($this->group_id, $con);
if ($this->aProfile === null && ($this->profile_id !== null)) {
$this->aProfile = ChildProfileQuery::create()->findPk($this->profile_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->addGroupResources($this);
$this->aProfile->addProfileResources($this);
*/
}
return $this->aGroup;
return $this->aProfile;
}
/**
* Declares an association between this object and a ChildResource object.
*
* @param ChildResource $v
* @return \Thelia\Model\GroupResource The current object (for fluent API support)
* @return \Thelia\Model\ProfileResource The current object (for fluent API support)
* @throws PropelException
*/
public function setResource(ChildResource $v = null)
@@ -1435,7 +1435,7 @@ abstract class GroupResource implements ActiveRecordInterface
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the ChildResource object, it will not be re-added.
if ($v !== null) {
$v->addGroupResource($this);
$v->addProfileResource($this);
}
@@ -1459,7 +1459,7 @@ abstract class GroupResource implements ActiveRecordInterface
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->aResource->addGroupResources($this);
$this->aResource->addProfileResources($this);
*/
}
@@ -1472,7 +1472,7 @@ abstract class GroupResource implements ActiveRecordInterface
public function clear()
{
$this->id = null;
$this->group_id = null;
$this->profile_id = null;
$this->resource_id = null;
$this->read = null;
$this->write = null;
@@ -1500,7 +1500,7 @@ abstract class GroupResource implements ActiveRecordInterface
if ($deep) {
} // if ($deep)
$this->aGroup = null;
$this->aProfile = null;
$this->aResource = null;
}
@@ -1511,7 +1511,7 @@ abstract class GroupResource implements ActiveRecordInterface
*/
public function __toString()
{
return (string) $this->exportTo(GroupResourceTableMap::DEFAULT_STRING_FORMAT);
return (string) $this->exportTo(ProfileResourceTableMap::DEFAULT_STRING_FORMAT);
}
// timestampable behavior
@@ -1519,11 +1519,11 @@ abstract class GroupResource implements ActiveRecordInterface
/**
* Mark the current object so that the update date doesn't get updated during next save
*
* @return ChildGroupResource The current object (for fluent API support)
* @return ChildProfileResource The current object (for fluent API support)
*/
public function keepUpdateDateUnchanged()
{
$this->modifiedColumns[] = GroupResourceTableMap::UPDATED_AT;
$this->modifiedColumns[] = ProfileResourceTableMap::UPDATED_AT;
return $this;
}

View File

@@ -12,92 +12,92 @@ use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
use Thelia\Model\GroupResource as ChildGroupResource;
use Thelia\Model\GroupResourceQuery as ChildGroupResourceQuery;
use Thelia\Model\Map\GroupResourceTableMap;
use Thelia\Model\ProfileResource as ChildProfileResource;
use Thelia\Model\ProfileResourceQuery as ChildProfileResourceQuery;
use Thelia\Model\Map\ProfileResourceTableMap;
/**
* Base class that represents a query for the 'group_resource' table.
* Base class that represents a query for the 'profile_resource' table.
*
*
*
* @method ChildGroupResourceQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildGroupResourceQuery orderByGroupId($order = Criteria::ASC) Order by the group_id column
* @method ChildGroupResourceQuery orderByResourceId($order = Criteria::ASC) Order by the resource_id column
* @method ChildGroupResourceQuery orderByRead($order = Criteria::ASC) Order by the read column
* @method ChildGroupResourceQuery orderByWrite($order = Criteria::ASC) Order by the write column
* @method ChildGroupResourceQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildGroupResourceQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
* @method ChildProfileResourceQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildProfileResourceQuery orderByProfileId($order = Criteria::ASC) Order by the profile_id column
* @method ChildProfileResourceQuery orderByResourceId($order = Criteria::ASC) Order by the resource_id column
* @method ChildProfileResourceQuery orderByRead($order = Criteria::ASC) Order by the read column
* @method ChildProfileResourceQuery orderByWrite($order = Criteria::ASC) Order by the write column
* @method ChildProfileResourceQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildProfileResourceQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildGroupResourceQuery groupById() Group by the id column
* @method ChildGroupResourceQuery groupByGroupId() Group by the group_id column
* @method ChildGroupResourceQuery groupByResourceId() Group by the resource_id column
* @method ChildGroupResourceQuery groupByRead() Group by the read column
* @method ChildGroupResourceQuery groupByWrite() Group by the write column
* @method ChildGroupResourceQuery groupByCreatedAt() Group by the created_at column
* @method ChildGroupResourceQuery groupByUpdatedAt() Group by the updated_at column
* @method ChildProfileResourceQuery groupById() Group by the id column
* @method ChildProfileResourceQuery groupByProfileId() Group by the profile_id column
* @method ChildProfileResourceQuery groupByResourceId() Group by the resource_id column
* @method ChildProfileResourceQuery groupByRead() Group by the read column
* @method ChildProfileResourceQuery groupByWrite() Group by the write column
* @method ChildProfileResourceQuery groupByCreatedAt() Group by the created_at column
* @method ChildProfileResourceQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildGroupResourceQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildGroupResourceQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildGroupResourceQuery innerJoin($relation) Adds a INNER JOIN clause to the query
* @method ChildProfileResourceQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildProfileResourceQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildProfileResourceQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildGroupResourceQuery leftJoinGroup($relationAlias = null) Adds a LEFT JOIN clause to the query using the Group relation
* @method ChildGroupResourceQuery rightJoinGroup($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Group relation
* @method ChildGroupResourceQuery innerJoinGroup($relationAlias = null) Adds a INNER JOIN clause to the query using the Group relation
* @method ChildProfileResourceQuery leftJoinProfile($relationAlias = null) Adds a LEFT JOIN clause to the query using the Profile relation
* @method ChildProfileResourceQuery rightJoinProfile($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Profile relation
* @method ChildProfileResourceQuery innerJoinProfile($relationAlias = null) Adds a INNER JOIN clause to the query using the Profile relation
*
* @method ChildGroupResourceQuery leftJoinResource($relationAlias = null) Adds a LEFT JOIN clause to the query using the Resource relation
* @method ChildGroupResourceQuery rightJoinResource($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Resource relation
* @method ChildGroupResourceQuery innerJoinResource($relationAlias = null) Adds a INNER JOIN clause to the query using the Resource relation
* @method ChildProfileResourceQuery leftJoinResource($relationAlias = null) Adds a LEFT JOIN clause to the query using the Resource relation
* @method ChildProfileResourceQuery rightJoinResource($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Resource relation
* @method ChildProfileResourceQuery innerJoinResource($relationAlias = null) Adds a INNER JOIN clause to the query using the Resource relation
*
* @method ChildGroupResource findOne(ConnectionInterface $con = null) Return the first ChildGroupResource matching the query
* @method ChildGroupResource findOneOrCreate(ConnectionInterface $con = null) Return the first ChildGroupResource matching the query, or a new ChildGroupResource object populated from the query conditions when no match is found
* @method ChildProfileResource findOne(ConnectionInterface $con = null) Return the first ChildProfileResource matching the query
* @method ChildProfileResource findOneOrCreate(ConnectionInterface $con = null) Return the first ChildProfileResource matching the query, or a new ChildProfileResource object populated from the query conditions when no match is found
*
* @method ChildGroupResource findOneById(int $id) Return the first ChildGroupResource filtered by the id column
* @method ChildGroupResource findOneByGroupId(int $group_id) Return the first ChildGroupResource filtered by the group_id column
* @method ChildGroupResource findOneByResourceId(int $resource_id) Return the first ChildGroupResource filtered by the resource_id column
* @method ChildGroupResource findOneByRead(int $read) Return the first ChildGroupResource filtered by the read column
* @method ChildGroupResource findOneByWrite(int $write) Return the first ChildGroupResource filtered by the write column
* @method ChildGroupResource findOneByCreatedAt(string $created_at) Return the first ChildGroupResource filtered by the created_at column
* @method ChildGroupResource findOneByUpdatedAt(string $updated_at) Return the first ChildGroupResource filtered by the updated_at column
* @method ChildProfileResource findOneById(int $id) Return the first ChildProfileResource filtered by the id column
* @method ChildProfileResource findOneByProfileId(int $profile_id) Return the first ChildProfileResource filtered by the profile_id column
* @method ChildProfileResource findOneByResourceId(int $resource_id) Return the first ChildProfileResource filtered by the resource_id column
* @method ChildProfileResource findOneByRead(int $read) Return the first ChildProfileResource filtered by the read column
* @method ChildProfileResource findOneByWrite(int $write) Return the first ChildProfileResource filtered by the write column
* @method ChildProfileResource findOneByCreatedAt(string $created_at) Return the first ChildProfileResource filtered by the created_at column
* @method ChildProfileResource findOneByUpdatedAt(string $updated_at) Return the first ChildProfileResource filtered by the updated_at column
*
* @method array findById(int $id) Return ChildGroupResource objects filtered by the id column
* @method array findByGroupId(int $group_id) Return ChildGroupResource objects filtered by the group_id column
* @method array findByResourceId(int $resource_id) Return ChildGroupResource objects filtered by the resource_id column
* @method array findByRead(int $read) Return ChildGroupResource objects filtered by the read column
* @method array findByWrite(int $write) Return ChildGroupResource objects filtered by the write column
* @method array findByCreatedAt(string $created_at) Return ChildGroupResource objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildGroupResource objects filtered by the updated_at column
* @method array findById(int $id) Return ChildProfileResource objects filtered by the id column
* @method array findByProfileId(int $profile_id) Return ChildProfileResource objects filtered by the profile_id column
* @method array findByResourceId(int $resource_id) Return ChildProfileResource objects filtered by the resource_id column
* @method array findByRead(int $read) Return ChildProfileResource objects filtered by the read column
* @method array findByWrite(int $write) Return ChildProfileResource objects filtered by the write column
* @method array findByCreatedAt(string $created_at) Return ChildProfileResource objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildProfileResource objects filtered by the updated_at column
*
*/
abstract class GroupResourceQuery extends ModelCriteria
abstract class ProfileResourceQuery extends ModelCriteria
{
/**
* Initializes internal state of \Thelia\Model\Base\GroupResourceQuery object.
* Initializes internal state of \Thelia\Model\Base\ProfileResourceQuery object.
*
* @param string $dbName The database name
* @param string $modelName The phpName of a model, e.g. 'Book'
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
*/
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\GroupResource', $modelAlias = null)
public function __construct($dbName = 'thelia', $modelName = '\\Thelia\\Model\\ProfileResource', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildGroupResourceQuery object.
* Returns a new ChildProfileResourceQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildGroupResourceQuery
* @return ChildProfileResourceQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \Thelia\Model\GroupResourceQuery) {
if ($criteria instanceof \Thelia\Model\ProfileResourceQuery) {
return $criteria;
}
$query = new \Thelia\Model\GroupResourceQuery();
$query = new \Thelia\Model\ProfileResourceQuery();
if (null !== $modelAlias) {
$query->setModelAlias($modelAlias);
}
@@ -117,22 +117,22 @@ abstract class GroupResourceQuery extends ModelCriteria
* $obj = $c->findPk(array(12, 34, 56), $con);
* </code>
*
* @param array[$id, $group_id, $resource_id] $key Primary key to use for the query
* @param array[$id, $profile_id, $resource_id] $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildGroupResource|array|mixed the result, formatted by the current formatter
* @return ChildProfileResource|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = GroupResourceTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1], (string) $key[2]))))) && !$this->formatter) {
if ((null !== ($obj = ProfileResourceTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1], (string) $key[2]))))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(GroupResourceTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getReadConnection(ProfileResourceTableMap::DATABASE_NAME);
}
$this->basePreSelect($con);
if ($this->formatter || $this->modelAlias || $this->with || $this->select
@@ -151,11 +151,11 @@ abstract class GroupResourceQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
* @return ChildGroupResource A model object, or null if the key is not found
* @return ChildProfileResource A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, GROUP_ID, RESOURCE_ID, READ, WRITE, CREATED_AT, UPDATED_AT FROM group_resource WHERE ID = :p0 AND GROUP_ID = :p1 AND RESOURCE_ID = :p2';
$sql = 'SELECT ID, PROFILE_ID, RESOURCE_ID, READ, WRITE, CREATED_AT, UPDATED_AT FROM profile_resource WHERE ID = :p0 AND PROFILE_ID = :p1 AND RESOURCE_ID = :p2';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
@@ -168,9 +168,9 @@ abstract class GroupResourceQuery extends ModelCriteria
}
$obj = null;
if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
$obj = new ChildGroupResource();
$obj = new ChildProfileResource();
$obj->hydrate($row);
GroupResourceTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1], (string) $key[2])));
ProfileResourceTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1], (string) $key[2])));
}
$stmt->closeCursor();
@@ -183,7 +183,7 @@ abstract class GroupResourceQuery extends ModelCriteria
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con A connection object
*
* @return ChildGroupResource|array|mixed the result, formatted by the current formatter
* @return ChildProfileResource|array|mixed the result, formatted by the current formatter
*/
protected function findPkComplex($key, $con)
{
@@ -225,13 +225,13 @@ abstract class GroupResourceQuery extends ModelCriteria
*
* @param mixed $key Primary key to use for the query
*
* @return ChildGroupResourceQuery The current query, for fluid interface
* @return ChildProfileResourceQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
$this->addUsingAlias(GroupResourceTableMap::ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(GroupResourceTableMap::GROUP_ID, $key[1], Criteria::EQUAL);
$this->addUsingAlias(GroupResourceTableMap::RESOURCE_ID, $key[2], Criteria::EQUAL);
$this->addUsingAlias(ProfileResourceTableMap::ID, $key[0], Criteria::EQUAL);
$this->addUsingAlias(ProfileResourceTableMap::PROFILE_ID, $key[1], Criteria::EQUAL);
$this->addUsingAlias(ProfileResourceTableMap::RESOURCE_ID, $key[2], Criteria::EQUAL);
return $this;
}
@@ -241,7 +241,7 @@ abstract class GroupResourceQuery extends ModelCriteria
*
* @param array $keys The list of primary key to use for the query
*
* @return ChildGroupResourceQuery The current query, for fluid interface
* @return ChildProfileResourceQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
@@ -249,10 +249,10 @@ abstract class GroupResourceQuery extends ModelCriteria
return $this->add(null, '1<>1', Criteria::CUSTOM);
}
foreach ($keys as $key) {
$cton0 = $this->getNewCriterion(GroupResourceTableMap::ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(GroupResourceTableMap::GROUP_ID, $key[1], Criteria::EQUAL);
$cton0 = $this->getNewCriterion(ProfileResourceTableMap::ID, $key[0], Criteria::EQUAL);
$cton1 = $this->getNewCriterion(ProfileResourceTableMap::PROFILE_ID, $key[1], Criteria::EQUAL);
$cton0->addAnd($cton1);
$cton2 = $this->getNewCriterion(GroupResourceTableMap::RESOURCE_ID, $key[2], Criteria::EQUAL);
$cton2 = $this->getNewCriterion(ProfileResourceTableMap::RESOURCE_ID, $key[2], Criteria::EQUAL);
$cton0->addAnd($cton2);
$this->addOr($cton0);
}
@@ -276,18 +276,18 @@ abstract class GroupResourceQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupResourceQuery The current query, for fluid interface
* @return ChildProfileResourceQuery 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(GroupResourceTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$this->addUsingAlias(ProfileResourceTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(GroupResourceTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$this->addUsingAlias(ProfileResourceTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -298,39 +298,39 @@ abstract class GroupResourceQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupResourceTableMap::ID, $id, $comparison);
return $this->addUsingAlias(ProfileResourceTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the group_id column
* Filter the query on the profile_id column
*
* Example usage:
* <code>
* $query->filterByGroupId(1234); // WHERE group_id = 1234
* $query->filterByGroupId(array(12, 34)); // WHERE group_id IN (12, 34)
* $query->filterByGroupId(array('min' => 12)); // WHERE group_id > 12
* $query->filterByProfileId(1234); // WHERE profile_id = 1234
* $query->filterByProfileId(array(12, 34)); // WHERE profile_id IN (12, 34)
* $query->filterByProfileId(array('min' => 12)); // WHERE profile_id > 12
* </code>
*
* @see filterByGroup()
* @see filterByProfile()
*
* @param mixed $groupId The value to use as filter.
* @param mixed $profileId 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 ChildGroupResourceQuery The current query, for fluid interface
* @return ChildProfileResourceQuery The current query, for fluid interface
*/
public function filterByGroupId($groupId = null, $comparison = null)
public function filterByProfileId($profileId = null, $comparison = null)
{
if (is_array($groupId)) {
if (is_array($profileId)) {
$useMinMax = false;
if (isset($groupId['min'])) {
$this->addUsingAlias(GroupResourceTableMap::GROUP_ID, $groupId['min'], Criteria::GREATER_EQUAL);
if (isset($profileId['min'])) {
$this->addUsingAlias(ProfileResourceTableMap::PROFILE_ID, $profileId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($groupId['max'])) {
$this->addUsingAlias(GroupResourceTableMap::GROUP_ID, $groupId['max'], Criteria::LESS_EQUAL);
if (isset($profileId['max'])) {
$this->addUsingAlias(ProfileResourceTableMap::PROFILE_ID, $profileId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -341,7 +341,7 @@ abstract class GroupResourceQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupResourceTableMap::GROUP_ID, $groupId, $comparison);
return $this->addUsingAlias(ProfileResourceTableMap::PROFILE_ID, $profileId, $comparison);
}
/**
@@ -362,18 +362,18 @@ abstract class GroupResourceQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupResourceQuery The current query, for fluid interface
* @return ChildProfileResourceQuery The current query, for fluid interface
*/
public function filterByResourceId($resourceId = null, $comparison = null)
{
if (is_array($resourceId)) {
$useMinMax = false;
if (isset($resourceId['min'])) {
$this->addUsingAlias(GroupResourceTableMap::RESOURCE_ID, $resourceId['min'], Criteria::GREATER_EQUAL);
$this->addUsingAlias(ProfileResourceTableMap::RESOURCE_ID, $resourceId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($resourceId['max'])) {
$this->addUsingAlias(GroupResourceTableMap::RESOURCE_ID, $resourceId['max'], Criteria::LESS_EQUAL);
$this->addUsingAlias(ProfileResourceTableMap::RESOURCE_ID, $resourceId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -384,7 +384,7 @@ abstract class GroupResourceQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupResourceTableMap::RESOURCE_ID, $resourceId, $comparison);
return $this->addUsingAlias(ProfileResourceTableMap::RESOURCE_ID, $resourceId, $comparison);
}
/**
@@ -403,18 +403,18 @@ abstract class GroupResourceQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupResourceQuery The current query, for fluid interface
* @return ChildProfileResourceQuery The current query, for fluid interface
*/
public function filterByRead($read = null, $comparison = null)
{
if (is_array($read)) {
$useMinMax = false;
if (isset($read['min'])) {
$this->addUsingAlias(GroupResourceTableMap::READ, $read['min'], Criteria::GREATER_EQUAL);
$this->addUsingAlias(ProfileResourceTableMap::READ, $read['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($read['max'])) {
$this->addUsingAlias(GroupResourceTableMap::READ, $read['max'], Criteria::LESS_EQUAL);
$this->addUsingAlias(ProfileResourceTableMap::READ, $read['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -425,7 +425,7 @@ abstract class GroupResourceQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupResourceTableMap::READ, $read, $comparison);
return $this->addUsingAlias(ProfileResourceTableMap::READ, $read, $comparison);
}
/**
@@ -444,18 +444,18 @@ abstract class GroupResourceQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupResourceQuery The current query, for fluid interface
* @return ChildProfileResourceQuery The current query, for fluid interface
*/
public function filterByWrite($write = null, $comparison = null)
{
if (is_array($write)) {
$useMinMax = false;
if (isset($write['min'])) {
$this->addUsingAlias(GroupResourceTableMap::WRITE, $write['min'], Criteria::GREATER_EQUAL);
$this->addUsingAlias(ProfileResourceTableMap::WRITE, $write['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($write['max'])) {
$this->addUsingAlias(GroupResourceTableMap::WRITE, $write['max'], Criteria::LESS_EQUAL);
$this->addUsingAlias(ProfileResourceTableMap::WRITE, $write['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -466,7 +466,7 @@ abstract class GroupResourceQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupResourceTableMap::WRITE, $write, $comparison);
return $this->addUsingAlias(ProfileResourceTableMap::WRITE, $write, $comparison);
}
/**
@@ -487,18 +487,18 @@ abstract class GroupResourceQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupResourceQuery The current query, for fluid interface
* @return ChildProfileResourceQuery 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(GroupResourceTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$this->addUsingAlias(ProfileResourceTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(GroupResourceTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$this->addUsingAlias(ProfileResourceTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -509,7 +509,7 @@ abstract class GroupResourceQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupResourceTableMap::CREATED_AT, $createdAt, $comparison);
return $this->addUsingAlias(ProfileResourceTableMap::CREATED_AT, $createdAt, $comparison);
}
/**
@@ -530,18 +530,18 @@ abstract class GroupResourceQuery extends ModelCriteria
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupResourceQuery The current query, for fluid interface
* @return ChildProfileResourceQuery 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(GroupResourceTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$this->addUsingAlias(ProfileResourceTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(GroupResourceTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$this->addUsingAlias(ProfileResourceTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
@@ -552,46 +552,46 @@ abstract class GroupResourceQuery extends ModelCriteria
}
}
return $this->addUsingAlias(GroupResourceTableMap::UPDATED_AT, $updatedAt, $comparison);
return $this->addUsingAlias(ProfileResourceTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Filter the query by a related \Thelia\Model\Group object
* Filter the query by a related \Thelia\Model\Profile object
*
* @param \Thelia\Model\Group|ObjectCollection $group The related object(s) to use as filter
* @param \Thelia\Model\Profile|ObjectCollection $profile The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupResourceQuery The current query, for fluid interface
* @return ChildProfileResourceQuery The current query, for fluid interface
*/
public function filterByGroup($group, $comparison = null)
public function filterByProfile($profile, $comparison = null)
{
if ($group instanceof \Thelia\Model\Group) {
if ($profile instanceof \Thelia\Model\Profile) {
return $this
->addUsingAlias(GroupResourceTableMap::GROUP_ID, $group->getId(), $comparison);
} elseif ($group instanceof ObjectCollection) {
->addUsingAlias(ProfileResourceTableMap::PROFILE_ID, $profile->getId(), $comparison);
} elseif ($profile instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(GroupResourceTableMap::GROUP_ID, $group->toKeyValue('PrimaryKey', 'Id'), $comparison);
->addUsingAlias(ProfileResourceTableMap::PROFILE_ID, $profile->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByGroup() only accepts arguments of type \Thelia\Model\Group or Collection');
throw new PropelException('filterByProfile() only accepts arguments of type \Thelia\Model\Profile or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Group relation
* Adds a JOIN clause to the query using the Profile relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildGroupResourceQuery The current query, for fluid interface
* @return ChildProfileResourceQuery The current query, for fluid interface
*/
public function joinGroup($relationAlias = null, $joinType = Criteria::INNER_JOIN)
public function joinProfile($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Group');
$relationMap = $tableMap->getRelation('Profile');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -606,14 +606,14 @@ abstract class GroupResourceQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'Group');
$this->addJoinObject($join, 'Profile');
}
return $this;
}
/**
* Use the Group relation Group object
* Use the Profile relation Profile object
*
* @see useQuery()
*
@@ -621,13 +621,13 @@ abstract class GroupResourceQuery extends ModelCriteria
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \Thelia\Model\GroupQuery A secondary query class using the current class as primary query
* @return \Thelia\Model\ProfileQuery A secondary query class using the current class as primary query
*/
public function useGroupQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
public function useProfileQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinGroup($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Group', '\Thelia\Model\GroupQuery');
->joinProfile($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Profile', '\Thelia\Model\ProfileQuery');
}
/**
@@ -636,20 +636,20 @@ abstract class GroupResourceQuery extends ModelCriteria
* @param \Thelia\Model\Resource|ObjectCollection $resource The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildGroupResourceQuery The current query, for fluid interface
* @return ChildProfileResourceQuery The current query, for fluid interface
*/
public function filterByResource($resource, $comparison = null)
{
if ($resource instanceof \Thelia\Model\Resource) {
return $this
->addUsingAlias(GroupResourceTableMap::RESOURCE_ID, $resource->getId(), $comparison);
->addUsingAlias(ProfileResourceTableMap::RESOURCE_ID, $resource->getId(), $comparison);
} elseif ($resource instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(GroupResourceTableMap::RESOURCE_ID, $resource->toKeyValue('PrimaryKey', 'Id'), $comparison);
->addUsingAlias(ProfileResourceTableMap::RESOURCE_ID, $resource->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByResource() only accepts arguments of type \Thelia\Model\Resource or Collection');
}
@@ -661,7 +661,7 @@ abstract class GroupResourceQuery extends ModelCriteria
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildGroupResourceQuery The current query, for fluid interface
* @return ChildProfileResourceQuery The current query, for fluid interface
*/
public function joinResource($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
@@ -708,16 +708,16 @@ abstract class GroupResourceQuery extends ModelCriteria
/**
* Exclude object from result
*
* @param ChildGroupResource $groupResource Object to remove from the list of results
* @param ChildProfileResource $profileResource Object to remove from the list of results
*
* @return ChildGroupResourceQuery The current query, for fluid interface
* @return ChildProfileResourceQuery The current query, for fluid interface
*/
public function prune($groupResource = null)
public function prune($profileResource = null)
{
if ($groupResource) {
$this->addCond('pruneCond0', $this->getAliasedColName(GroupResourceTableMap::ID), $groupResource->getId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(GroupResourceTableMap::GROUP_ID), $groupResource->getGroupId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond2', $this->getAliasedColName(GroupResourceTableMap::RESOURCE_ID), $groupResource->getResourceId(), Criteria::NOT_EQUAL);
if ($profileResource) {
$this->addCond('pruneCond0', $this->getAliasedColName(ProfileResourceTableMap::ID), $profileResource->getId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond1', $this->getAliasedColName(ProfileResourceTableMap::PROFILE_ID), $profileResource->getProfileId(), Criteria::NOT_EQUAL);
$this->addCond('pruneCond2', $this->getAliasedColName(ProfileResourceTableMap::RESOURCE_ID), $profileResource->getResourceId(), Criteria::NOT_EQUAL);
$this->combine(array('pruneCond0', 'pruneCond1', 'pruneCond2'), Criteria::LOGICAL_OR);
}
@@ -725,7 +725,7 @@ abstract class GroupResourceQuery extends ModelCriteria
}
/**
* Deletes all rows from the group_resource table.
* Deletes all rows from the profile_resource table.
*
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
@@ -733,7 +733,7 @@ abstract class GroupResourceQuery extends ModelCriteria
public function doDeleteAll(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(GroupResourceTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProfileResourceTableMap::DATABASE_NAME);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
@@ -744,8 +744,8 @@ abstract class GroupResourceQuery extends ModelCriteria
// 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).
GroupResourceTableMap::clearInstancePool();
GroupResourceTableMap::clearRelatedInstancePool();
ProfileResourceTableMap::clearInstancePool();
ProfileResourceTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
@@ -757,9 +757,9 @@ abstract class GroupResourceQuery extends ModelCriteria
}
/**
* Performs a DELETE on the database, given a ChildGroupResource or Criteria object OR a primary key value.
* Performs a DELETE on the database, given a ChildProfileResource or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildGroupResource object or primary key or array of primary keys
* @param mixed $values Criteria or ChildProfileResource object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
@@ -770,13 +770,13 @@ abstract class GroupResourceQuery extends ModelCriteria
public function delete(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(GroupResourceTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProfileResourceTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(GroupResourceTableMap::DATABASE_NAME);
$criteria->setDbName(ProfileResourceTableMap::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
@@ -786,10 +786,10 @@ abstract class GroupResourceQuery extends ModelCriteria
$con->beginTransaction();
GroupResourceTableMap::removeInstanceFromPool($criteria);
ProfileResourceTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
GroupResourceTableMap::clearRelatedInstancePool();
ProfileResourceTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
@@ -806,11 +806,11 @@ abstract class GroupResourceQuery extends ModelCriteria
*
* @param int $nbDays Maximum age of the latest update in days
*
* @return ChildGroupResourceQuery The current query, for fluid interface
* @return ChildProfileResourceQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(GroupResourceTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
return $this->addUsingAlias(ProfileResourceTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
@@ -818,51 +818,51 @@ abstract class GroupResourceQuery extends ModelCriteria
*
* @param int $nbDays Maximum age of in days
*
* @return ChildGroupResourceQuery The current query, for fluid interface
* @return ChildProfileResourceQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(GroupResourceTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
return $this->addUsingAlias(ProfileResourceTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildGroupResourceQuery The current query, for fluid interface
* @return ChildProfileResourceQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(GroupResourceTableMap::UPDATED_AT);
return $this->addDescendingOrderByColumn(ProfileResourceTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildGroupResourceQuery The current query, for fluid interface
* @return ChildProfileResourceQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(GroupResourceTableMap::UPDATED_AT);
return $this->addAscendingOrderByColumn(ProfileResourceTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildGroupResourceQuery The current query, for fluid interface
* @return ChildProfileResourceQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(GroupResourceTableMap::CREATED_AT);
return $this->addDescendingOrderByColumn(ProfileResourceTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildGroupResourceQuery The current query, for fluid interface
* @return ChildProfileResourceQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(GroupResourceTableMap::CREATED_AT);
return $this->addAscendingOrderByColumn(ProfileResourceTableMap::CREATED_AT);
}
} // GroupResourceQuery
} // ProfileResourceQuery

View File

@@ -17,10 +17,10 @@ use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Parser\AbstractParser;
use Propel\Runtime\Util\PropelDateTime;
use Thelia\Model\Group as ChildGroup;
use Thelia\Model\GroupQuery as ChildGroupQuery;
use Thelia\Model\GroupResource as ChildGroupResource;
use Thelia\Model\GroupResourceQuery as ChildGroupResourceQuery;
use Thelia\Model\Profile as ChildProfile;
use Thelia\Model\ProfileQuery as ChildProfileQuery;
use Thelia\Model\ProfileResource as ChildProfileResource;
use Thelia\Model\ProfileResourceQuery as ChildProfileResourceQuery;
use Thelia\Model\Resource as ChildResource;
use Thelia\Model\ResourceI18n as ChildResourceI18n;
use Thelia\Model\ResourceI18nQuery as ChildResourceI18nQuery;
@@ -86,10 +86,10 @@ abstract class Resource implements ActiveRecordInterface
protected $updated_at;
/**
* @var ObjectCollection|ChildGroupResource[] Collection to store aggregation of ChildGroupResource objects.
* @var ObjectCollection|ChildProfileResource[] Collection to store aggregation of ChildProfileResource objects.
*/
protected $collGroupResources;
protected $collGroupResourcesPartial;
protected $collProfileResources;
protected $collProfileResourcesPartial;
/**
* @var ObjectCollection|ChildResourceI18n[] Collection to store aggregation of ChildResourceI18n objects.
@@ -98,9 +98,9 @@ abstract class Resource implements ActiveRecordInterface
protected $collResourceI18nsPartial;
/**
* @var ChildGroup[] Collection to store aggregation of ChildGroup objects.
* @var ChildProfile[] Collection to store aggregation of ChildProfile objects.
*/
protected $collGroups;
protected $collProfiles;
/**
* Flag to prevent endless save loop, if this object is referenced
@@ -128,13 +128,13 @@ abstract class Resource implements ActiveRecordInterface
* An array of objects scheduled for deletion.
* @var ObjectCollection
*/
protected $groupsScheduledForDeletion = null;
protected $profilesScheduledForDeletion = null;
/**
* An array of objects scheduled for deletion.
* @var ObjectCollection
*/
protected $groupResourcesScheduledForDeletion = null;
protected $profileResourcesScheduledForDeletion = null;
/**
* An array of objects scheduled for deletion.
@@ -669,11 +669,11 @@ abstract class Resource implements ActiveRecordInterface
if ($deep) { // also de-associate any related objects?
$this->collGroupResources = null;
$this->collProfileResources = null;
$this->collResourceI18ns = null;
$this->collGroups = null;
$this->collProfiles = null;
} // if (deep)
}
@@ -807,44 +807,44 @@ abstract class Resource implements ActiveRecordInterface
$this->resetModified();
}
if ($this->groupsScheduledForDeletion !== null) {
if (!$this->groupsScheduledForDeletion->isEmpty()) {
if ($this->profilesScheduledForDeletion !== null) {
if (!$this->profilesScheduledForDeletion->isEmpty()) {
$pks = array();
$pk = $this->getPrimaryKey();
foreach ($this->groupsScheduledForDeletion->getPrimaryKeys(false) as $remotePk) {
foreach ($this->profilesScheduledForDeletion->getPrimaryKeys(false) as $remotePk) {
$pks[] = array($remotePk, $pk);
}
GroupResourceQuery::create()
ProfileResourceQuery::create()
->filterByPrimaryKeys($pks)
->delete($con);
$this->groupsScheduledForDeletion = null;
$this->profilesScheduledForDeletion = null;
}
foreach ($this->getGroups() as $group) {
if ($group->isModified()) {
$group->save($con);
foreach ($this->getProfiles() as $profile) {
if ($profile->isModified()) {
$profile->save($con);
}
}
} elseif ($this->collGroups) {
foreach ($this->collGroups as $group) {
if ($group->isModified()) {
$group->save($con);
} elseif ($this->collProfiles) {
foreach ($this->collProfiles as $profile) {
if ($profile->isModified()) {
$profile->save($con);
}
}
}
if ($this->groupResourcesScheduledForDeletion !== null) {
if (!$this->groupResourcesScheduledForDeletion->isEmpty()) {
\Thelia\Model\GroupResourceQuery::create()
->filterByPrimaryKeys($this->groupResourcesScheduledForDeletion->getPrimaryKeys(false))
if ($this->profileResourcesScheduledForDeletion !== null) {
if (!$this->profileResourcesScheduledForDeletion->isEmpty()) {
\Thelia\Model\ProfileResourceQuery::create()
->filterByPrimaryKeys($this->profileResourcesScheduledForDeletion->getPrimaryKeys(false))
->delete($con);
$this->groupResourcesScheduledForDeletion = null;
$this->profileResourcesScheduledForDeletion = null;
}
}
if ($this->collGroupResources !== null) {
foreach ($this->collGroupResources as $referrerFK) {
if ($this->collProfileResources !== null) {
foreach ($this->collProfileResources as $referrerFK) {
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
$affectedRows += $referrerFK->save($con);
}
@@ -1043,8 +1043,8 @@ abstract class Resource implements ActiveRecordInterface
}
if ($includeForeignObjects) {
if (null !== $this->collGroupResources) {
$result['GroupResources'] = $this->collGroupResources->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
if (null !== $this->collProfileResources) {
$result['ProfileResources'] = $this->collProfileResources->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collResourceI18ns) {
$result['ResourceI18ns'] = $this->collResourceI18ns->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
@@ -1210,9 +1210,9 @@ abstract class Resource implements ActiveRecordInterface
// the getter/setter methods for fkey referrer objects.
$copyObj->setNew(false);
foreach ($this->getGroupResources() as $relObj) {
foreach ($this->getProfileResources() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addGroupResource($relObj->copy($deepCopy));
$copyObj->addProfileResource($relObj->copy($deepCopy));
}
}
@@ -1263,8 +1263,8 @@ abstract class Resource implements ActiveRecordInterface
*/
public function initRelation($relationName)
{
if ('GroupResource' == $relationName) {
return $this->initGroupResources();
if ('ProfileResource' == $relationName) {
return $this->initProfileResources();
}
if ('ResourceI18n' == $relationName) {
return $this->initResourceI18ns();
@@ -1272,31 +1272,31 @@ abstract class Resource implements ActiveRecordInterface
}
/**
* Clears out the collGroupResources collection
* Clears out the collProfileResources 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 void
* @see addGroupResources()
* @see addProfileResources()
*/
public function clearGroupResources()
public function clearProfileResources()
{
$this->collGroupResources = null; // important to set this to NULL since that means it is uninitialized
$this->collProfileResources = null; // important to set this to NULL since that means it is uninitialized
}
/**
* Reset is the collGroupResources collection loaded partially.
* Reset is the collProfileResources collection loaded partially.
*/
public function resetPartialGroupResources($v = true)
public function resetPartialProfileResources($v = true)
{
$this->collGroupResourcesPartial = $v;
$this->collProfileResourcesPartial = $v;
}
/**
* Initializes the collGroupResources collection.
* Initializes the collProfileResources collection.
*
* By default this just sets the collGroupResources collection to an empty array (like clearcollGroupResources());
* By default this just sets the collProfileResources collection to an empty array (like clearcollProfileResources());
* 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.
*
@@ -1305,17 +1305,17 @@ abstract class Resource implements ActiveRecordInterface
*
* @return void
*/
public function initGroupResources($overrideExisting = true)
public function initProfileResources($overrideExisting = true)
{
if (null !== $this->collGroupResources && !$overrideExisting) {
if (null !== $this->collProfileResources && !$overrideExisting) {
return;
}
$this->collGroupResources = new ObjectCollection();
$this->collGroupResources->setModel('\Thelia\Model\GroupResource');
$this->collProfileResources = new ObjectCollection();
$this->collProfileResources->setModel('\Thelia\Model\ProfileResource');
}
/**
* Gets an array of ChildGroupResource objects which contain a foreign key that references this object.
* Gets an array of ChildProfileResource 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.
@@ -1325,112 +1325,112 @@ abstract class Resource implements ActiveRecordInterface
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @return Collection|ChildGroupResource[] List of ChildGroupResource objects
* @return Collection|ChildProfileResource[] List of ChildProfileResource objects
* @throws PropelException
*/
public function getGroupResources($criteria = null, ConnectionInterface $con = null)
public function getProfileResources($criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collGroupResourcesPartial && !$this->isNew();
if (null === $this->collGroupResources || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collGroupResources) {
$partial = $this->collProfileResourcesPartial && !$this->isNew();
if (null === $this->collProfileResources || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collProfileResources) {
// return empty collection
$this->initGroupResources();
$this->initProfileResources();
} else {
$collGroupResources = ChildGroupResourceQuery::create(null, $criteria)
$collProfileResources = ChildProfileResourceQuery::create(null, $criteria)
->filterByResource($this)
->find($con);
if (null !== $criteria) {
if (false !== $this->collGroupResourcesPartial && count($collGroupResources)) {
$this->initGroupResources(false);
if (false !== $this->collProfileResourcesPartial && count($collProfileResources)) {
$this->initProfileResources(false);
foreach ($collGroupResources as $obj) {
if (false == $this->collGroupResources->contains($obj)) {
$this->collGroupResources->append($obj);
foreach ($collProfileResources as $obj) {
if (false == $this->collProfileResources->contains($obj)) {
$this->collProfileResources->append($obj);
}
}
$this->collGroupResourcesPartial = true;
$this->collProfileResourcesPartial = true;
}
$collGroupResources->getInternalIterator()->rewind();
$collProfileResources->getInternalIterator()->rewind();
return $collGroupResources;
return $collProfileResources;
}
if ($partial && $this->collGroupResources) {
foreach ($this->collGroupResources as $obj) {
if ($partial && $this->collProfileResources) {
foreach ($this->collProfileResources as $obj) {
if ($obj->isNew()) {
$collGroupResources[] = $obj;
$collProfileResources[] = $obj;
}
}
}
$this->collGroupResources = $collGroupResources;
$this->collGroupResourcesPartial = false;
$this->collProfileResources = $collProfileResources;
$this->collProfileResourcesPartial = false;
}
}
return $this->collGroupResources;
return $this->collProfileResources;
}
/**
* Sets a collection of GroupResource objects related by a one-to-many relationship
* Sets a collection of ProfileResource 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 Collection $groupResources A Propel collection.
* @param Collection $profileResources A Propel collection.
* @param ConnectionInterface $con Optional connection object
* @return ChildResource The current object (for fluent API support)
*/
public function setGroupResources(Collection $groupResources, ConnectionInterface $con = null)
public function setProfileResources(Collection $profileResources, ConnectionInterface $con = null)
{
$groupResourcesToDelete = $this->getGroupResources(new Criteria(), $con)->diff($groupResources);
$profileResourcesToDelete = $this->getProfileResources(new Criteria(), $con)->diff($profileResources);
//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->groupResourcesScheduledForDeletion = clone $groupResourcesToDelete;
$this->profileResourcesScheduledForDeletion = clone $profileResourcesToDelete;
foreach ($groupResourcesToDelete as $groupResourceRemoved) {
$groupResourceRemoved->setResource(null);
foreach ($profileResourcesToDelete as $profileResourceRemoved) {
$profileResourceRemoved->setResource(null);
}
$this->collGroupResources = null;
foreach ($groupResources as $groupResource) {
$this->addGroupResource($groupResource);
$this->collProfileResources = null;
foreach ($profileResources as $profileResource) {
$this->addProfileResource($profileResource);
}
$this->collGroupResources = $groupResources;
$this->collGroupResourcesPartial = false;
$this->collProfileResources = $profileResources;
$this->collProfileResourcesPartial = false;
return $this;
}
/**
* Returns the number of related GroupResource objects.
* Returns the number of related ProfileResource objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param ConnectionInterface $con
* @return int Count of related GroupResource objects.
* @return int Count of related ProfileResource objects.
* @throws PropelException
*/
public function countGroupResources(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
public function countProfileResources(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collGroupResourcesPartial && !$this->isNew();
if (null === $this->collGroupResources || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collGroupResources) {
$partial = $this->collProfileResourcesPartial && !$this->isNew();
if (null === $this->collProfileResources || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collProfileResources) {
return 0;
}
if ($partial && !$criteria) {
return count($this->getGroupResources());
return count($this->getProfileResources());
}
$query = ChildGroupResourceQuery::create(null, $criteria);
$query = ChildProfileResourceQuery::create(null, $criteria);
if ($distinct) {
$query->distinct();
}
@@ -1440,53 +1440,53 @@ abstract class Resource implements ActiveRecordInterface
->count($con);
}
return count($this->collGroupResources);
return count($this->collProfileResources);
}
/**
* Method called to associate a ChildGroupResource object to this object
* through the ChildGroupResource foreign key attribute.
* Method called to associate a ChildProfileResource object to this object
* through the ChildProfileResource foreign key attribute.
*
* @param ChildGroupResource $l ChildGroupResource
* @param ChildProfileResource $l ChildProfileResource
* @return \Thelia\Model\Resource The current object (for fluent API support)
*/
public function addGroupResource(ChildGroupResource $l)
public function addProfileResource(ChildProfileResource $l)
{
if ($this->collGroupResources === null) {
$this->initGroupResources();
$this->collGroupResourcesPartial = true;
if ($this->collProfileResources === null) {
$this->initProfileResources();
$this->collProfileResourcesPartial = true;
}
if (!in_array($l, $this->collGroupResources->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddGroupResource($l);
if (!in_array($l, $this->collProfileResources->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
$this->doAddProfileResource($l);
}
return $this;
}
/**
* @param GroupResource $groupResource The groupResource object to add.
* @param ProfileResource $profileResource The profileResource object to add.
*/
protected function doAddGroupResource($groupResource)
protected function doAddProfileResource($profileResource)
{
$this->collGroupResources[]= $groupResource;
$groupResource->setResource($this);
$this->collProfileResources[]= $profileResource;
$profileResource->setResource($this);
}
/**
* @param GroupResource $groupResource The groupResource object to remove.
* @param ProfileResource $profileResource The profileResource object to remove.
* @return ChildResource The current object (for fluent API support)
*/
public function removeGroupResource($groupResource)
public function removeProfileResource($profileResource)
{
if ($this->getGroupResources()->contains($groupResource)) {
$this->collGroupResources->remove($this->collGroupResources->search($groupResource));
if (null === $this->groupResourcesScheduledForDeletion) {
$this->groupResourcesScheduledForDeletion = clone $this->collGroupResources;
$this->groupResourcesScheduledForDeletion->clear();
if ($this->getProfileResources()->contains($profileResource)) {
$this->collProfileResources->remove($this->collProfileResources->search($profileResource));
if (null === $this->profileResourcesScheduledForDeletion) {
$this->profileResourcesScheduledForDeletion = clone $this->collProfileResources;
$this->profileResourcesScheduledForDeletion->clear();
}
$this->groupResourcesScheduledForDeletion[]= clone $groupResource;
$groupResource->setResource(null);
$this->profileResourcesScheduledForDeletion[]= clone $profileResource;
$profileResource->setResource(null);
}
return $this;
@@ -1498,7 +1498,7 @@ abstract class Resource implements ActiveRecordInterface
* an identical criteria, it returns the collection.
* Otherwise if this Resource is new, it will return
* an empty collection; or if this Resource has previously
* been saved, it will retrieve related GroupResources from storage.
* been saved, it will retrieve related ProfileResources from storage.
*
* This method is protected by default in order to keep the public
* api reasonable. You can provide public methods for those you
@@ -1507,14 +1507,14 @@ abstract class Resource implements ActiveRecordInterface
* @param Criteria $criteria optional Criteria object to narrow the query
* @param ConnectionInterface $con optional connection object
* @param string $joinBehavior optional join type to use (defaults to Criteria::LEFT_JOIN)
* @return Collection|ChildGroupResource[] List of ChildGroupResource objects
* @return Collection|ChildProfileResource[] List of ChildProfileResource objects
*/
public function getGroupResourcesJoinGroup($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
public function getProfileResourcesJoinProfile($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildGroupResourceQuery::create(null, $criteria);
$query->joinWith('Group', $joinBehavior);
$query = ChildProfileResourceQuery::create(null, $criteria);
$query->joinWith('Profile', $joinBehavior);
return $this->getGroupResources($query, $con);
return $this->getProfileResources($query, $con);
}
/**
@@ -1743,38 +1743,38 @@ abstract class Resource implements ActiveRecordInterface
}
/**
* Clears out the collGroups collection
* Clears out the collProfiles 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 void
* @see addGroups()
* @see addProfiles()
*/
public function clearGroups()
public function clearProfiles()
{
$this->collGroups = null; // important to set this to NULL since that means it is uninitialized
$this->collGroupsPartial = null;
$this->collProfiles = null; // important to set this to NULL since that means it is uninitialized
$this->collProfilesPartial = null;
}
/**
* Initializes the collGroups collection.
* Initializes the collProfiles collection.
*
* By default this just sets the collGroups collection to an empty collection (like clearGroups());
* By default this just sets the collProfiles collection to an empty collection (like clearProfiles());
* 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()
public function initProfiles()
{
$this->collGroups = new ObjectCollection();
$this->collGroups->setModel('\Thelia\Model\Group');
$this->collProfiles = new ObjectCollection();
$this->collProfiles->setModel('\Thelia\Model\Profile');
}
/**
* Gets a collection of ChildGroup objects related by a many-to-many relationship
* to the current object by way of the group_resource cross-reference table.
* Gets a collection of ChildProfile objects related by a many-to-many relationship
* to the current object by way of the profile_resource 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.
@@ -1785,73 +1785,73 @@ abstract class Resource implements ActiveRecordInterface
* @param Criteria $criteria Optional query object to filter the query
* @param ConnectionInterface $con Optional connection object
*
* @return ObjectCollection|ChildGroup[] List of ChildGroup objects
* @return ObjectCollection|ChildProfile[] List of ChildProfile objects
*/
public function getGroups($criteria = null, ConnectionInterface $con = null)
public function getProfiles($criteria = null, ConnectionInterface $con = null)
{
if (null === $this->collGroups || null !== $criteria) {
if ($this->isNew() && null === $this->collGroups) {
if (null === $this->collProfiles || null !== $criteria) {
if ($this->isNew() && null === $this->collProfiles) {
// return empty collection
$this->initGroups();
$this->initProfiles();
} else {
$collGroups = ChildGroupQuery::create(null, $criteria)
$collProfiles = ChildProfileQuery::create(null, $criteria)
->filterByResource($this)
->find($con);
if (null !== $criteria) {
return $collGroups;
return $collProfiles;
}
$this->collGroups = $collGroups;
$this->collProfiles = $collProfiles;
}
}
return $this->collGroups;
return $this->collProfiles;
}
/**
* Sets a collection of Group objects related by a many-to-many relationship
* to the current object by way of the group_resource cross-reference table.
* Sets a collection of Profile objects related by a many-to-many relationship
* to the current object by way of the profile_resource 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 Collection $groups A Propel collection.
* @param Collection $profiles A Propel collection.
* @param ConnectionInterface $con Optional connection object
* @return ChildResource The current object (for fluent API support)
*/
public function setGroups(Collection $groups, ConnectionInterface $con = null)
public function setProfiles(Collection $profiles, ConnectionInterface $con = null)
{
$this->clearGroups();
$currentGroups = $this->getGroups();
$this->clearProfiles();
$currentProfiles = $this->getProfiles();
$this->groupsScheduledForDeletion = $currentGroups->diff($groups);
$this->profilesScheduledForDeletion = $currentProfiles->diff($profiles);
foreach ($groups as $group) {
if (!$currentGroups->contains($group)) {
$this->doAddGroup($group);
foreach ($profiles as $profile) {
if (!$currentProfiles->contains($profile)) {
$this->doAddProfile($profile);
}
}
$this->collGroups = $groups;
$this->collProfiles = $profiles;
return $this;
}
/**
* Gets the number of ChildGroup objects related by a many-to-many relationship
* to the current object by way of the group_resource cross-reference table.
* Gets the number of ChildProfile objects related by a many-to-many relationship
* to the current object by way of the profile_resource cross-reference table.
*
* @param Criteria $criteria Optional query object to filter the query
* @param boolean $distinct Set to true to force count distinct
* @param ConnectionInterface $con Optional connection object
*
* @return int the number of related ChildGroup objects
* @return int the number of related ChildProfile objects
*/
public function countGroups($criteria = null, $distinct = false, ConnectionInterface $con = null)
public function countProfiles($criteria = null, $distinct = false, ConnectionInterface $con = null)
{
if (null === $this->collGroups || null !== $criteria) {
if ($this->isNew() && null === $this->collGroups) {
if (null === $this->collProfiles || null !== $criteria) {
if ($this->isNew() && null === $this->collProfiles) {
return 0;
} else {
$query = ChildGroupQuery::create(null, $criteria);
$query = ChildProfileQuery::create(null, $criteria);
if ($distinct) {
$query->distinct();
}
@@ -1861,65 +1861,65 @@ abstract class Resource implements ActiveRecordInterface
->count($con);
}
} else {
return count($this->collGroups);
return count($this->collProfiles);
}
}
/**
* Associate a ChildGroup object to this object
* through the group_resource cross reference table.
* Associate a ChildProfile object to this object
* through the profile_resource cross reference table.
*
* @param ChildGroup $group The ChildGroupResource object to relate
* @param ChildProfile $profile The ChildProfileResource object to relate
* @return ChildResource The current object (for fluent API support)
*/
public function addGroup(ChildGroup $group)
public function addProfile(ChildProfile $profile)
{
if ($this->collGroups === null) {
$this->initGroups();
if ($this->collProfiles === null) {
$this->initProfiles();
}
if (!$this->collGroups->contains($group)) { // only add it if the **same** object is not already associated
$this->doAddGroup($group);
$this->collGroups[] = $group;
if (!$this->collProfiles->contains($profile)) { // only add it if the **same** object is not already associated
$this->doAddProfile($profile);
$this->collProfiles[] = $profile;
}
return $this;
}
/**
* @param Group $group The group object to add.
* @param Profile $profile The profile object to add.
*/
protected function doAddGroup($group)
protected function doAddProfile($profile)
{
$groupResource = new ChildGroupResource();
$groupResource->setGroup($group);
$this->addGroupResource($groupResource);
$profileResource = new ChildProfileResource();
$profileResource->setProfile($profile);
$this->addProfileResource($profileResource);
// set the back reference to this object directly as using provided method either results
// in endless loop or in multiple relations
if (!$group->getResources()->contains($this)) {
$foreignCollection = $group->getResources();
if (!$profile->getResources()->contains($this)) {
$foreignCollection = $profile->getResources();
$foreignCollection[] = $this;
}
}
/**
* Remove a ChildGroup object to this object
* through the group_resource cross reference table.
* Remove a ChildProfile object to this object
* through the profile_resource cross reference table.
*
* @param ChildGroup $group The ChildGroupResource object to relate
* @param ChildProfile $profile The ChildProfileResource object to relate
* @return ChildResource The current object (for fluent API support)
*/
public function removeGroup(ChildGroup $group)
public function removeProfile(ChildProfile $profile)
{
if ($this->getGroups()->contains($group)) {
$this->collGroups->remove($this->collGroups->search($group));
if ($this->getProfiles()->contains($profile)) {
$this->collProfiles->remove($this->collProfiles->search($profile));
if (null === $this->groupsScheduledForDeletion) {
$this->groupsScheduledForDeletion = clone $this->collGroups;
$this->groupsScheduledForDeletion->clear();
if (null === $this->profilesScheduledForDeletion) {
$this->profilesScheduledForDeletion = clone $this->collProfiles;
$this->profilesScheduledForDeletion->clear();
}
$this->groupsScheduledForDeletion[] = $group;
$this->profilesScheduledForDeletion[] = $profile;
}
return $this;
@@ -1953,8 +1953,8 @@ abstract class Resource implements ActiveRecordInterface
public function clearAllReferences($deep = false)
{
if ($deep) {
if ($this->collGroupResources) {
foreach ($this->collGroupResources as $o) {
if ($this->collProfileResources) {
foreach ($this->collProfileResources as $o) {
$o->clearAllReferences($deep);
}
}
@@ -1963,8 +1963,8 @@ abstract class Resource implements ActiveRecordInterface
$o->clearAllReferences($deep);
}
}
if ($this->collGroups) {
foreach ($this->collGroups as $o) {
if ($this->collProfiles) {
foreach ($this->collProfiles as $o) {
$o->clearAllReferences($deep);
}
}
@@ -1974,18 +1974,18 @@ abstract class Resource implements ActiveRecordInterface
$this->currentLocale = 'en_US';
$this->currentTranslations = null;
if ($this->collGroupResources instanceof Collection) {
$this->collGroupResources->clearIterator();
if ($this->collProfileResources instanceof Collection) {
$this->collProfileResources->clearIterator();
}
$this->collGroupResources = null;
$this->collProfileResources = null;
if ($this->collResourceI18ns instanceof Collection) {
$this->collResourceI18ns->clearIterator();
}
$this->collResourceI18ns = null;
if ($this->collGroups instanceof Collection) {
$this->collGroups->clearIterator();
if ($this->collProfiles instanceof Collection) {
$this->collProfiles->clearIterator();
}
$this->collGroups = null;
$this->collProfiles = null;
}
/**

View File

@@ -36,9 +36,9 @@ use Thelia\Model\Map\ResourceTableMap;
* @method ChildResourceQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildResourceQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildResourceQuery leftJoinGroupResource($relationAlias = null) Adds a LEFT JOIN clause to the query using the GroupResource relation
* @method ChildResourceQuery rightJoinGroupResource($relationAlias = null) Adds a RIGHT JOIN clause to the query using the GroupResource relation
* @method ChildResourceQuery innerJoinGroupResource($relationAlias = null) Adds a INNER JOIN clause to the query using the GroupResource relation
* @method ChildResourceQuery leftJoinProfileResource($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProfileResource relation
* @method ChildResourceQuery rightJoinProfileResource($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProfileResource relation
* @method ChildResourceQuery innerJoinProfileResource($relationAlias = null) Adds a INNER JOIN clause to the query using the ProfileResource relation
*
* @method ChildResourceQuery leftJoinResourceI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the ResourceI18n relation
* @method ChildResourceQuery rightJoinResourceI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ResourceI18n relation
@@ -390,40 +390,40 @@ abstract class ResourceQuery extends ModelCriteria
}
/**
* Filter the query by a related \Thelia\Model\GroupResource object
* Filter the query by a related \Thelia\Model\ProfileResource object
*
* @param \Thelia\Model\GroupResource|ObjectCollection $groupResource the related object to use as filter
* @param \Thelia\Model\ProfileResource|ObjectCollection $profileResource the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildResourceQuery The current query, for fluid interface
*/
public function filterByGroupResource($groupResource, $comparison = null)
public function filterByProfileResource($profileResource, $comparison = null)
{
if ($groupResource instanceof \Thelia\Model\GroupResource) {
if ($profileResource instanceof \Thelia\Model\ProfileResource) {
return $this
->addUsingAlias(ResourceTableMap::ID, $groupResource->getResourceId(), $comparison);
} elseif ($groupResource instanceof ObjectCollection) {
->addUsingAlias(ResourceTableMap::ID, $profileResource->getResourceId(), $comparison);
} elseif ($profileResource instanceof ObjectCollection) {
return $this
->useGroupResourceQuery()
->filterByPrimaryKeys($groupResource->getPrimaryKeys())
->useProfileResourceQuery()
->filterByPrimaryKeys($profileResource->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByGroupResource() only accepts arguments of type \Thelia\Model\GroupResource or Collection');
throw new PropelException('filterByProfileResource() only accepts arguments of type \Thelia\Model\ProfileResource or Collection');
}
}
/**
* Adds a JOIN clause to the query using the GroupResource relation
* Adds a JOIN clause to the query using the ProfileResource relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildResourceQuery The current query, for fluid interface
*/
public function joinGroupResource($relationAlias = null, $joinType = Criteria::INNER_JOIN)
public function joinProfileResource($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('GroupResource');
$relationMap = $tableMap->getRelation('ProfileResource');
// create a ModelJoin object for this join
$join = new ModelJoin();
@@ -438,14 +438,14 @@ abstract class ResourceQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'GroupResource');
$this->addJoinObject($join, 'ProfileResource');
}
return $this;
}
/**
* Use the GroupResource relation GroupResource object
* Use the ProfileResource relation ProfileResource object
*
* @see useQuery()
*
@@ -453,13 +453,13 @@ abstract class ResourceQuery extends ModelCriteria
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \Thelia\Model\GroupResourceQuery A secondary query class using the current class as primary query
* @return \Thelia\Model\ProfileResourceQuery A secondary query class using the current class as primary query
*/
public function useGroupResourceQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
public function useProfileResourceQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinGroupResource($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'GroupResource', '\Thelia\Model\GroupResourceQuery');
->joinProfileResource($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'ProfileResource', '\Thelia\Model\ProfileResourceQuery');
}
/**
@@ -536,19 +536,19 @@ abstract class ResourceQuery extends ModelCriteria
}
/**
* Filter the query by a related Group object
* using the group_resource table as cross reference
* Filter the query by a related Profile object
* using the profile_resource table as cross reference
*
* @param Group $group the related object to use as filter
* @param Profile $profile the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildResourceQuery The current query, for fluid interface
*/
public function filterByGroup($group, $comparison = Criteria::EQUAL)
public function filterByProfile($profile, $comparison = Criteria::EQUAL)
{
return $this
->useGroupResourceQuery()
->filterByGroup($group, $comparison)
->useProfileResourceQuery()
->filterByProfile($profile, $comparison)
->endUse();
}

View File

@@ -1,9 +0,0 @@
<?php
namespace Thelia\Model;
use Thelia\Model\Base\Group as BaseGroup;
class Group extends BaseGroup {
}

View File

@@ -1,9 +0,0 @@
<?php
namespace Thelia\Model;
use Thelia\Model\Base\GroupI18n as BaseGroupI18n;
class GroupI18n extends BaseGroupI18n {
}

View File

@@ -1,9 +0,0 @@
<?php
namespace Thelia\Model;
use Thelia\Model\Base\GroupModule as BaseGroupModule;
class GroupModule extends BaseGroupModule {
}

View File

@@ -1,9 +0,0 @@
<?php
namespace Thelia\Model;
use Thelia\Model\Base\GroupResource as BaseGroupResource;
class GroupResource extends BaseGroupResource {
}

View File

@@ -1,509 +0,0 @@
<?php
namespace Thelia\Model\Map;
use Propel\Runtime\Propel;
use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Map\RelationMap;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Map\TableMapTrait;
use Thelia\Model\AdminGroup;
use Thelia\Model\AdminGroupQuery;
/**
* This class defines the structure of the 'admin_group' table.
*
*
*
* This map class is used by Propel to do runtime db structure discovery.
* For example, the createSelectSql() method checks the type of a given column used in an
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
* (i.e. if it's a text column type).
*
*/
class AdminGroupTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'Thelia.Model.Map.AdminGroupTableMap';
/**
* The default database name for this class
*/
const DATABASE_NAME = 'thelia';
/**
* The table name for this class
*/
const TABLE_NAME = 'admin_group';
/**
* The related Propel class for this table
*/
const OM_CLASS = '\\Thelia\\Model\\AdminGroup';
/**
* A class that can be returned by this tableMap
*/
const CLASS_DEFAULT = 'Thelia.Model.AdminGroup';
/**
* The total number of columns
*/
const NUM_COLUMNS = 5;
/**
* The number of lazy-loaded columns
*/
const NUM_LAZY_LOAD_COLUMNS = 0;
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
const NUM_HYDRATE_COLUMNS = 5;
/**
* the column name for the ID field
*/
const ID = 'admin_group.ID';
/**
* the column name for the GROUP_ID field
*/
const GROUP_ID = 'admin_group.GROUP_ID';
/**
* the column name for the ADMIN_ID field
*/
const ADMIN_ID = 'admin_group.ADMIN_ID';
/**
* the column name for the CREATED_AT field
*/
const CREATED_AT = 'admin_group.CREATED_AT';
/**
* the column name for the UPDATED_AT field
*/
const UPDATED_AT = 'admin_group.UPDATED_AT';
/**
* The default string format for model objects of the related table
*/
const DEFAULT_STRING_FORMAT = 'YAML';
/**
* holds an array of fieldnames
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'GroupId', 'AdminId', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'groupId', 'adminId', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(AdminGroupTableMap::ID, AdminGroupTableMap::GROUP_ID, AdminGroupTableMap::ADMIN_ID, AdminGroupTableMap::CREATED_AT, AdminGroupTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'GROUP_ID', 'ADMIN_ID', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'group_id', 'admin_id', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, )
);
/**
* holds an array of keys for quick access to the fieldnames array
*
* first dimension keys are the type constants
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'GroupId' => 1, 'AdminId' => 2, 'CreatedAt' => 3, 'UpdatedAt' => 4, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'groupId' => 1, 'adminId' => 2, 'createdAt' => 3, 'updatedAt' => 4, ),
self::TYPE_COLNAME => array(AdminGroupTableMap::ID => 0, AdminGroupTableMap::GROUP_ID => 1, AdminGroupTableMap::ADMIN_ID => 2, AdminGroupTableMap::CREATED_AT => 3, AdminGroupTableMap::UPDATED_AT => 4, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'GROUP_ID' => 1, 'ADMIN_ID' => 2, 'CREATED_AT' => 3, 'UPDATED_AT' => 4, ),
self::TYPE_FIELDNAME => array('id' => 0, 'group_id' => 1, 'admin_id' => 2, 'created_at' => 3, 'updated_at' => 4, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, )
);
/**
* Initialize the table attributes and columns
* Relations are not initialized by this method since they are lazy loaded
*
* @return void
* @throws PropelException
*/
public function initialize()
{
// attributes
$this->setName('admin_group');
$this->setPhpName('AdminGroup');
$this->setClassName('\\Thelia\\Model\\AdminGroup');
$this->setPackage('Thelia.Model');
$this->setUseIdGenerator(true);
$this->setIsCrossRef(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addForeignPrimaryKey('GROUP_ID', 'GroupId', 'INTEGER' , 'group', 'ID', true, null, null);
$this->addForeignPrimaryKey('ADMIN_ID', 'AdminId', 'INTEGER' , 'admin', 'ID', true, null, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize()
/**
* Build the RelationMap objects for this table relationships
*/
public function buildRelations()
{
$this->addRelation('Group', '\\Thelia\\Model\\Group', RelationMap::MANY_TO_ONE, array('group_id' => 'id', ), 'CASCADE', 'RESTRICT');
$this->addRelation('Admin', '\\Thelia\\Model\\Admin', RelationMap::MANY_TO_ONE, array('admin_id' => 'id', ), 'CASCADE', 'RESTRICT');
} // 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', ),
);
} // getBehaviors()
/**
* 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 you may need to explicitly add objects
* to the cache in order to ensure that the same objects are always returned by find*()
* and findPk*() calls.
*
* @param \Thelia\Model\AdminGroup $obj A \Thelia\Model\AdminGroup 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 (null === $key) {
$key = serialize(array((string) $obj->getId(), (string) $obj->getGroupId(), (string) $obj->getAdminId()));
} // if key === null
self::$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 \Thelia\Model\AdminGroup object or a primary key value.
*/
public static function removeInstanceFromPool($value)
{
if (Propel::isInstancePoolingEnabled() && null !== $value) {
if (is_object($value) && $value instanceof \Thelia\Model\AdminGroup) {
$key = serialize(array((string) $value->getId(), (string) $value->getGroupId(), (string) $value->getAdminId()));
} elseif (is_array($value) && count($value) === 3) {
// assume we've been passed a primary key";
$key = serialize(array((string) $value[0], (string) $value[1], (string) $value[2]));
} elseif ($value instanceof Criteria) {
self::$instances = [];
return;
} else {
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\AdminGroup object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
throw $e;
}
unset(self::$instances[$key]);
}
}
/**
* 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 resultset row.
* @param int $offset The 0-based offset for reading from the resultset row.
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
*/
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
// If the PK cannot be derived from the row, return NULL.
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('GroupId', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 2 + $offset : static::translateFieldName('AdminId', TableMap::TYPE_PHPNAME, $indexType)] === null) {
return null;
}
return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('GroupId', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 2 + $offset : static::translateFieldName('AdminId', TableMap::TYPE_PHPNAME, $indexType)]));
}
/**
* 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 resultset row.
* @param int $offset The 0-based offset for reading from the resultset row.
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
*
* @return mixed The primary key of the row
*/
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
return $pks;
}
/**
* The class that the tableMap will make instances of.
*
* If $withPrefix is true, the returned path
* uses a dot-path notation which is translated into a path
* relative to a location on the PHP include_path.
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
*
* @param boolean $withPrefix Whether or not to return the path with the class name
* @return string path.to.ClassName
*/
public static function getOMClass($withPrefix = true)
{
return $withPrefix ? AdminGroupTableMap::CLASS_DEFAULT : AdminGroupTableMap::OM_CLASS;
}
/**
* Populates an object of the default type or an object that inherit from the default.
*
* @param array $row row returned by DataFetcher->fetch().
* @param int $offset The 0-based offset for reading from the resultset row.
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return array (AdminGroup object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
$key = AdminGroupTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = AdminGroupTableMap::getInstanceFromPool($key))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj->hydrate($row, $offset, true); // rehydrate
$col = $offset + AdminGroupTableMap::NUM_HYDRATE_COLUMNS;
} else {
$cls = AdminGroupTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
AdminGroupTableMap::addInstanceToPool($obj, $key);
}
return array($obj, $col);
}
/**
* The returned array will contain objects of the default type or
* objects that inherit from the default.
*
* @param DataFetcherInterface $dataFetcher
* @return array
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function populateObjects(DataFetcherInterface $dataFetcher)
{
$results = array();
// set the class once to avoid overhead in the loop
$cls = static::getOMClass(false);
// populate the object(s)
while ($row = $dataFetcher->fetch()) {
$key = AdminGroupTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = AdminGroupTableMap::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;
AdminGroupTableMap::addInstanceToPool($obj, $key);
} // if key exists
}
return $results;
}
/**
* 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(AdminGroupTableMap::ID);
$criteria->addSelectColumn(AdminGroupTableMap::GROUP_ID);
$criteria->addSelectColumn(AdminGroupTableMap::ADMIN_ID);
$criteria->addSelectColumn(AdminGroupTableMap::CREATED_AT);
$criteria->addSelectColumn(AdminGroupTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.GROUP_ID');
$criteria->addSelectColumn($alias . '.ADMIN_ID');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}
}
/**
* Returns the TableMap related to this object.
* 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::getServiceContainer()->getDatabaseMap(AdminGroupTableMap::DATABASE_NAME)->getTable(AdminGroupTableMap::TABLE_NAME);
}
/**
* Add a TableMap instance to the database for this tableMap class.
*/
public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(AdminGroupTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(AdminGroupTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new AdminGroupTableMap());
}
}
/**
* Performs a DELETE on the database, given a AdminGroup or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or AdminGroup object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param ConnectionInterface $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, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(AdminGroupTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
} elseif ($values instanceof \Thelia\Model\AdminGroup) { // 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(AdminGroupTableMap::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(AdminGroupTableMap::ID, $value[0]);
$criterion->addAnd($criteria->getNewCriterion(AdminGroupTableMap::GROUP_ID, $value[1]));
$criterion->addAnd($criteria->getNewCriterion(AdminGroupTableMap::ADMIN_ID, $value[2]));
$criteria->addOr($criterion);
}
}
$query = AdminGroupQuery::create()->mergeWith($criteria);
if ($values instanceof Criteria) { AdminGroupTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
foreach ((array) $values as $singleval) { AdminGroupTableMap::removeInstanceFromPool($singleval);
}
}
return $query->delete($con);
}
/**
* Deletes all rows from the admin_group table.
*
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
*/
public static function doDeleteAll(ConnectionInterface $con = null)
{
return AdminGroupQuery::create()->doDeleteAll($con);
}
/**
* Performs an INSERT on the database, given a AdminGroup or Criteria object.
*
* @param mixed $criteria Criteria or AdminGroup object containing data that is used to create the INSERT statement.
* @param ConnectionInterface $con the ConnectionInterface 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($criteria, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(AdminGroupTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
$criteria = $criteria->buildCriteria(); // build Criteria from AdminGroup object
}
if ($criteria->containsKey(AdminGroupTableMap::ID) && $criteria->keyContainsValue(AdminGroupTableMap::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.AdminGroupTableMap::ID.')');
}
// Set the correct dbName
$query = AdminGroupQuery::create()->mergeWith($criteria);
try {
// use transaction because $criteria could contain info
// for more than one table (I guess, conceivably)
$con->beginTransaction();
$pk = $query->doInsert($con);
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $pk;
}
} // AdminGroupTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
AdminGroupTableMap::buildTableMap();

View File

@@ -57,7 +57,7 @@ class AdminTableMap extends TableMap
/**
* The total number of columns
*/
const NUM_COLUMNS = 11;
const NUM_COLUMNS = 12;
/**
* The number of lazy-loaded columns
@@ -67,13 +67,18 @@ class AdminTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
const NUM_HYDRATE_COLUMNS = 11;
const NUM_HYDRATE_COLUMNS = 12;
/**
* the column name for the ID field
*/
const ID = 'admin.ID';
/**
* the column name for the PROFILE_ID field
*/
const PROFILE_ID = 'admin.PROFILE_ID';
/**
* the column name for the FIRSTNAME field
*/
@@ -136,12 +141,12 @@ class AdminTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'Firstname', 'Lastname', 'Login', 'Password', 'Algo', 'Salt', 'RememberMeToken', 'RememberMeSerial', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'firstname', 'lastname', 'login', 'password', 'algo', 'salt', 'rememberMeToken', 'rememberMeSerial', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(AdminTableMap::ID, AdminTableMap::FIRSTNAME, AdminTableMap::LASTNAME, AdminTableMap::LOGIN, AdminTableMap::PASSWORD, AdminTableMap::ALGO, AdminTableMap::SALT, AdminTableMap::REMEMBER_ME_TOKEN, AdminTableMap::REMEMBER_ME_SERIAL, AdminTableMap::CREATED_AT, AdminTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'FIRSTNAME', 'LASTNAME', 'LOGIN', 'PASSWORD', 'ALGO', 'SALT', 'REMEMBER_ME_TOKEN', 'REMEMBER_ME_SERIAL', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'firstname', 'lastname', 'login', 'password', 'algo', 'salt', 'remember_me_token', 'remember_me_serial', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
self::TYPE_PHPNAME => array('Id', 'ProfileId', 'Firstname', 'Lastname', 'Login', 'Password', 'Algo', 'Salt', 'RememberMeToken', 'RememberMeSerial', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'profileId', 'firstname', 'lastname', 'login', 'password', 'algo', 'salt', 'rememberMeToken', 'rememberMeSerial', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(AdminTableMap::ID, AdminTableMap::PROFILE_ID, AdminTableMap::FIRSTNAME, AdminTableMap::LASTNAME, AdminTableMap::LOGIN, AdminTableMap::PASSWORD, AdminTableMap::ALGO, AdminTableMap::SALT, AdminTableMap::REMEMBER_ME_TOKEN, AdminTableMap::REMEMBER_ME_SERIAL, AdminTableMap::CREATED_AT, AdminTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'PROFILE_ID', 'FIRSTNAME', 'LASTNAME', 'LOGIN', 'PASSWORD', 'ALGO', 'SALT', 'REMEMBER_ME_TOKEN', 'REMEMBER_ME_SERIAL', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'profile_id', 'firstname', 'lastname', 'login', 'password', 'algo', 'salt', 'remember_me_token', 'remember_me_serial', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, )
);
/**
@@ -151,12 +156,12 @@ class AdminTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'Firstname' => 1, 'Lastname' => 2, 'Login' => 3, 'Password' => 4, 'Algo' => 5, 'Salt' => 6, 'RememberMeToken' => 7, 'RememberMeSerial' => 8, 'CreatedAt' => 9, 'UpdatedAt' => 10, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'firstname' => 1, 'lastname' => 2, 'login' => 3, 'password' => 4, 'algo' => 5, 'salt' => 6, 'rememberMeToken' => 7, 'rememberMeSerial' => 8, 'createdAt' => 9, 'updatedAt' => 10, ),
self::TYPE_COLNAME => array(AdminTableMap::ID => 0, AdminTableMap::FIRSTNAME => 1, AdminTableMap::LASTNAME => 2, AdminTableMap::LOGIN => 3, AdminTableMap::PASSWORD => 4, AdminTableMap::ALGO => 5, AdminTableMap::SALT => 6, AdminTableMap::REMEMBER_ME_TOKEN => 7, AdminTableMap::REMEMBER_ME_SERIAL => 8, AdminTableMap::CREATED_AT => 9, AdminTableMap::UPDATED_AT => 10, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'FIRSTNAME' => 1, 'LASTNAME' => 2, 'LOGIN' => 3, 'PASSWORD' => 4, 'ALGO' => 5, 'SALT' => 6, 'REMEMBER_ME_TOKEN' => 7, 'REMEMBER_ME_SERIAL' => 8, 'CREATED_AT' => 9, 'UPDATED_AT' => 10, ),
self::TYPE_FIELDNAME => array('id' => 0, 'firstname' => 1, 'lastname' => 2, 'login' => 3, 'password' => 4, 'algo' => 5, 'salt' => 6, 'remember_me_token' => 7, 'remember_me_serial' => 8, 'created_at' => 9, 'updated_at' => 10, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
self::TYPE_PHPNAME => array('Id' => 0, 'ProfileId' => 1, 'Firstname' => 2, 'Lastname' => 3, 'Login' => 4, 'Password' => 5, 'Algo' => 6, 'Salt' => 7, 'RememberMeToken' => 8, 'RememberMeSerial' => 9, 'CreatedAt' => 10, 'UpdatedAt' => 11, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'profileId' => 1, 'firstname' => 2, 'lastname' => 3, 'login' => 4, 'password' => 5, 'algo' => 6, 'salt' => 7, 'rememberMeToken' => 8, 'rememberMeSerial' => 9, 'createdAt' => 10, 'updatedAt' => 11, ),
self::TYPE_COLNAME => array(AdminTableMap::ID => 0, AdminTableMap::PROFILE_ID => 1, AdminTableMap::FIRSTNAME => 2, AdminTableMap::LASTNAME => 3, AdminTableMap::LOGIN => 4, AdminTableMap::PASSWORD => 5, AdminTableMap::ALGO => 6, AdminTableMap::SALT => 7, AdminTableMap::REMEMBER_ME_TOKEN => 8, AdminTableMap::REMEMBER_ME_SERIAL => 9, AdminTableMap::CREATED_AT => 10, AdminTableMap::UPDATED_AT => 11, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'PROFILE_ID' => 1, 'FIRSTNAME' => 2, 'LASTNAME' => 3, 'LOGIN' => 4, 'PASSWORD' => 5, 'ALGO' => 6, 'SALT' => 7, 'REMEMBER_ME_TOKEN' => 8, 'REMEMBER_ME_SERIAL' => 9, 'CREATED_AT' => 10, 'UPDATED_AT' => 11, ),
self::TYPE_FIELDNAME => array('id' => 0, 'profile_id' => 1, 'firstname' => 2, 'lastname' => 3, 'login' => 4, 'password' => 5, 'algo' => 6, 'salt' => 7, 'remember_me_token' => 8, 'remember_me_serial' => 9, 'created_at' => 10, 'updated_at' => 11, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, )
);
/**
@@ -176,6 +181,7 @@ class AdminTableMap extends TableMap
$this->setUseIdGenerator(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addForeignKey('PROFILE_ID', 'ProfileId', 'INTEGER', 'profile', 'ID', false, null, null);
$this->addColumn('FIRSTNAME', 'Firstname', 'VARCHAR', true, 100, null);
$this->addColumn('LASTNAME', 'Lastname', 'VARCHAR', true, 100, null);
$this->addColumn('LOGIN', 'Login', 'VARCHAR', true, 100, null);
@@ -193,8 +199,7 @@ class AdminTableMap extends TableMap
*/
public function buildRelations()
{
$this->addRelation('AdminGroup', '\\Thelia\\Model\\AdminGroup', RelationMap::ONE_TO_MANY, array('id' => 'admin_id', ), 'CASCADE', 'RESTRICT', 'AdminGroups');
$this->addRelation('Group', '\\Thelia\\Model\\Group', RelationMap::MANY_TO_MANY, array(), 'CASCADE', 'RESTRICT', 'Groups');
$this->addRelation('Profile', '\\Thelia\\Model\\Profile', RelationMap::MANY_TO_ONE, array('profile_id' => 'id', ), 'RESTRICT', 'RESTRICT');
} // buildRelations()
/**
@@ -209,15 +214,6 @@ class AdminTableMap extends TableMap
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
);
} // getBehaviors()
/**
* Method to invalidate the instance pool of all tables related to admin * by a foreign key with ON DELETE CASCADE
*/
public static function clearRelatedInstancePool()
{
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
AdminGroupTableMap::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.
@@ -358,6 +354,7 @@ class AdminTableMap extends TableMap
{
if (null === $alias) {
$criteria->addSelectColumn(AdminTableMap::ID);
$criteria->addSelectColumn(AdminTableMap::PROFILE_ID);
$criteria->addSelectColumn(AdminTableMap::FIRSTNAME);
$criteria->addSelectColumn(AdminTableMap::LASTNAME);
$criteria->addSelectColumn(AdminTableMap::LOGIN);
@@ -370,6 +367,7 @@ class AdminTableMap extends TableMap
$criteria->addSelectColumn(AdminTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.PROFILE_ID');
$criteria->addSelectColumn($alias . '.FIRSTNAME');
$criteria->addSelectColumn($alias . '.LASTNAME');
$criteria->addSelectColumn($alias . '.LOGIN');

View File

@@ -187,7 +187,7 @@ class ModuleTableMap extends TableMap
$this->addRelation('OrderRelatedByPaymentModuleId', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'payment_module_id', ), 'RESTRICT', 'RESTRICT', 'OrdersRelatedByPaymentModuleId');
$this->addRelation('OrderRelatedByDeliveryModuleId', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'delivery_module_id', ), 'RESTRICT', 'RESTRICT', 'OrdersRelatedByDeliveryModuleId');
$this->addRelation('AreaDeliveryModule', '\\Thelia\\Model\\AreaDeliveryModule', RelationMap::ONE_TO_MANY, array('id' => 'delivery_module_id', ), 'CASCADE', 'RESTRICT', 'AreaDeliveryModules');
$this->addRelation('GroupModule', '\\Thelia\\Model\\GroupModule', RelationMap::ONE_TO_MANY, array('id' => 'module_id', ), 'CASCADE', 'RESTRICT', 'GroupModules');
$this->addRelation('ProfileModule', '\\Thelia\\Model\\ProfileModule', RelationMap::ONE_TO_MANY, array('id' => 'module_id', ), 'CASCADE', 'RESTRICT', 'ProfileModules');
$this->addRelation('ModuleImage', '\\Thelia\\Model\\ModuleImage', RelationMap::ONE_TO_MANY, array('id' => 'module_id', ), 'CASCADE', 'RESTRICT', 'ModuleImages');
$this->addRelation('ModuleI18n', '\\Thelia\\Model\\ModuleI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ModuleI18ns');
} // buildRelations()
@@ -213,7 +213,7 @@ class ModuleTableMap extends TableMap
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
AreaDeliveryModuleTableMap::clearInstancePool();
GroupModuleTableMap::clearInstancePool();
ProfileModuleTableMap::clearInstancePool();
ModuleImageTableMap::clearInstancePool();
ModuleI18nTableMap::clearInstancePool();
}

View File

@@ -57,7 +57,7 @@ class OrderProductTableMap extends TableMap
/**
* The total number of columns
*/
const NUM_COLUMNS = 19;
const NUM_COLUMNS = 20;
/**
* The number of lazy-loaded columns
@@ -67,7 +67,7 @@ class OrderProductTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
const NUM_HYDRATE_COLUMNS = 19;
const NUM_HYDRATE_COLUMNS = 20;
/**
* the column name for the ID field
@@ -139,6 +139,11 @@ class OrderProductTableMap extends TableMap
*/
const WEIGHT = 'order_product.WEIGHT';
/**
* the column name for the EAN_CODE field
*/
const EAN_CODE = 'order_product.EAN_CODE';
/**
* the column name for the TAX_RULE_TITLE field
*/
@@ -176,12 +181,12 @@ class OrderProductTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'OrderId', 'ProductRef', 'ProductSaleElementsRef', 'Title', 'Chapo', 'Description', 'Postscriptum', 'Quantity', 'Price', 'PromoPrice', 'WasNew', 'WasInPromo', 'Weight', 'TaxRuleTitle', 'TaxRuleDescription', 'Parent', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'orderId', 'productRef', 'productSaleElementsRef', 'title', 'chapo', 'description', 'postscriptum', 'quantity', 'price', 'promoPrice', 'wasNew', 'wasInPromo', 'weight', 'taxRuleTitle', 'taxRuleDescription', 'parent', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(OrderProductTableMap::ID, OrderProductTableMap::ORDER_ID, OrderProductTableMap::PRODUCT_REF, OrderProductTableMap::PRODUCT_SALE_ELEMENTS_REF, OrderProductTableMap::TITLE, OrderProductTableMap::CHAPO, OrderProductTableMap::DESCRIPTION, OrderProductTableMap::POSTSCRIPTUM, OrderProductTableMap::QUANTITY, OrderProductTableMap::PRICE, OrderProductTableMap::PROMO_PRICE, OrderProductTableMap::WAS_NEW, OrderProductTableMap::WAS_IN_PROMO, OrderProductTableMap::WEIGHT, OrderProductTableMap::TAX_RULE_TITLE, OrderProductTableMap::TAX_RULE_DESCRIPTION, OrderProductTableMap::PARENT, OrderProductTableMap::CREATED_AT, OrderProductTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'ORDER_ID', 'PRODUCT_REF', 'PRODUCT_SALE_ELEMENTS_REF', 'TITLE', 'CHAPO', 'DESCRIPTION', 'POSTSCRIPTUM', 'QUANTITY', 'PRICE', 'PROMO_PRICE', 'WAS_NEW', 'WAS_IN_PROMO', 'WEIGHT', 'TAX_RULE_TITLE', 'TAX_RULE_DESCRIPTION', 'PARENT', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'order_id', 'product_ref', 'product_sale_elements_ref', 'title', 'chapo', 'description', 'postscriptum', 'quantity', 'price', 'promo_price', 'was_new', 'was_in_promo', 'weight', 'tax_rule_title', 'tax_rule_description', 'parent', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, )
self::TYPE_PHPNAME => array('Id', 'OrderId', 'ProductRef', 'ProductSaleElementsRef', 'Title', 'Chapo', 'Description', 'Postscriptum', 'Quantity', 'Price', 'PromoPrice', 'WasNew', 'WasInPromo', 'Weight', 'EanCode', 'TaxRuleTitle', 'TaxRuleDescription', 'Parent', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'orderId', 'productRef', 'productSaleElementsRef', 'title', 'chapo', 'description', 'postscriptum', 'quantity', 'price', 'promoPrice', 'wasNew', 'wasInPromo', 'weight', 'eanCode', 'taxRuleTitle', 'taxRuleDescription', 'parent', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(OrderProductTableMap::ID, OrderProductTableMap::ORDER_ID, OrderProductTableMap::PRODUCT_REF, OrderProductTableMap::PRODUCT_SALE_ELEMENTS_REF, OrderProductTableMap::TITLE, OrderProductTableMap::CHAPO, OrderProductTableMap::DESCRIPTION, OrderProductTableMap::POSTSCRIPTUM, OrderProductTableMap::QUANTITY, OrderProductTableMap::PRICE, OrderProductTableMap::PROMO_PRICE, OrderProductTableMap::WAS_NEW, OrderProductTableMap::WAS_IN_PROMO, OrderProductTableMap::WEIGHT, OrderProductTableMap::EAN_CODE, OrderProductTableMap::TAX_RULE_TITLE, OrderProductTableMap::TAX_RULE_DESCRIPTION, OrderProductTableMap::PARENT, OrderProductTableMap::CREATED_AT, OrderProductTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'ORDER_ID', 'PRODUCT_REF', 'PRODUCT_SALE_ELEMENTS_REF', 'TITLE', 'CHAPO', 'DESCRIPTION', 'POSTSCRIPTUM', 'QUANTITY', 'PRICE', 'PROMO_PRICE', 'WAS_NEW', 'WAS_IN_PROMO', 'WEIGHT', 'EAN_CODE', 'TAX_RULE_TITLE', 'TAX_RULE_DESCRIPTION', 'PARENT', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'order_id', 'product_ref', 'product_sale_elements_ref', 'title', 'chapo', 'description', 'postscriptum', 'quantity', 'price', 'promo_price', 'was_new', 'was_in_promo', 'weight', 'ean_code', 'tax_rule_title', 'tax_rule_description', 'parent', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, )
);
/**
@@ -191,12 +196,12 @@ class OrderProductTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'OrderId' => 1, 'ProductRef' => 2, 'ProductSaleElementsRef' => 3, 'Title' => 4, 'Chapo' => 5, 'Description' => 6, 'Postscriptum' => 7, 'Quantity' => 8, 'Price' => 9, 'PromoPrice' => 10, 'WasNew' => 11, 'WasInPromo' => 12, 'Weight' => 13, 'TaxRuleTitle' => 14, 'TaxRuleDescription' => 15, 'Parent' => 16, 'CreatedAt' => 17, 'UpdatedAt' => 18, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'orderId' => 1, 'productRef' => 2, 'productSaleElementsRef' => 3, 'title' => 4, 'chapo' => 5, 'description' => 6, 'postscriptum' => 7, 'quantity' => 8, 'price' => 9, 'promoPrice' => 10, 'wasNew' => 11, 'wasInPromo' => 12, 'weight' => 13, 'taxRuleTitle' => 14, 'taxRuleDescription' => 15, 'parent' => 16, 'createdAt' => 17, 'updatedAt' => 18, ),
self::TYPE_COLNAME => array(OrderProductTableMap::ID => 0, OrderProductTableMap::ORDER_ID => 1, OrderProductTableMap::PRODUCT_REF => 2, OrderProductTableMap::PRODUCT_SALE_ELEMENTS_REF => 3, OrderProductTableMap::TITLE => 4, OrderProductTableMap::CHAPO => 5, OrderProductTableMap::DESCRIPTION => 6, OrderProductTableMap::POSTSCRIPTUM => 7, OrderProductTableMap::QUANTITY => 8, OrderProductTableMap::PRICE => 9, OrderProductTableMap::PROMO_PRICE => 10, OrderProductTableMap::WAS_NEW => 11, OrderProductTableMap::WAS_IN_PROMO => 12, OrderProductTableMap::WEIGHT => 13, OrderProductTableMap::TAX_RULE_TITLE => 14, OrderProductTableMap::TAX_RULE_DESCRIPTION => 15, OrderProductTableMap::PARENT => 16, OrderProductTableMap::CREATED_AT => 17, OrderProductTableMap::UPDATED_AT => 18, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'ORDER_ID' => 1, 'PRODUCT_REF' => 2, 'PRODUCT_SALE_ELEMENTS_REF' => 3, 'TITLE' => 4, 'CHAPO' => 5, 'DESCRIPTION' => 6, 'POSTSCRIPTUM' => 7, 'QUANTITY' => 8, 'PRICE' => 9, 'PROMO_PRICE' => 10, 'WAS_NEW' => 11, 'WAS_IN_PROMO' => 12, 'WEIGHT' => 13, 'TAX_RULE_TITLE' => 14, 'TAX_RULE_DESCRIPTION' => 15, 'PARENT' => 16, 'CREATED_AT' => 17, 'UPDATED_AT' => 18, ),
self::TYPE_FIELDNAME => array('id' => 0, 'order_id' => 1, 'product_ref' => 2, 'product_sale_elements_ref' => 3, 'title' => 4, 'chapo' => 5, 'description' => 6, 'postscriptum' => 7, 'quantity' => 8, 'price' => 9, 'promo_price' => 10, 'was_new' => 11, 'was_in_promo' => 12, 'weight' => 13, 'tax_rule_title' => 14, 'tax_rule_description' => 15, 'parent' => 16, 'created_at' => 17, 'updated_at' => 18, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, )
self::TYPE_PHPNAME => array('Id' => 0, 'OrderId' => 1, 'ProductRef' => 2, 'ProductSaleElementsRef' => 3, 'Title' => 4, 'Chapo' => 5, 'Description' => 6, 'Postscriptum' => 7, 'Quantity' => 8, 'Price' => 9, 'PromoPrice' => 10, 'WasNew' => 11, 'WasInPromo' => 12, 'Weight' => 13, 'EanCode' => 14, 'TaxRuleTitle' => 15, 'TaxRuleDescription' => 16, 'Parent' => 17, 'CreatedAt' => 18, 'UpdatedAt' => 19, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'orderId' => 1, 'productRef' => 2, 'productSaleElementsRef' => 3, 'title' => 4, 'chapo' => 5, 'description' => 6, 'postscriptum' => 7, 'quantity' => 8, 'price' => 9, 'promoPrice' => 10, 'wasNew' => 11, 'wasInPromo' => 12, 'weight' => 13, 'eanCode' => 14, 'taxRuleTitle' => 15, 'taxRuleDescription' => 16, 'parent' => 17, 'createdAt' => 18, 'updatedAt' => 19, ),
self::TYPE_COLNAME => array(OrderProductTableMap::ID => 0, OrderProductTableMap::ORDER_ID => 1, OrderProductTableMap::PRODUCT_REF => 2, OrderProductTableMap::PRODUCT_SALE_ELEMENTS_REF => 3, OrderProductTableMap::TITLE => 4, OrderProductTableMap::CHAPO => 5, OrderProductTableMap::DESCRIPTION => 6, OrderProductTableMap::POSTSCRIPTUM => 7, OrderProductTableMap::QUANTITY => 8, OrderProductTableMap::PRICE => 9, OrderProductTableMap::PROMO_PRICE => 10, OrderProductTableMap::WAS_NEW => 11, OrderProductTableMap::WAS_IN_PROMO => 12, OrderProductTableMap::WEIGHT => 13, OrderProductTableMap::EAN_CODE => 14, OrderProductTableMap::TAX_RULE_TITLE => 15, OrderProductTableMap::TAX_RULE_DESCRIPTION => 16, OrderProductTableMap::PARENT => 17, OrderProductTableMap::CREATED_AT => 18, OrderProductTableMap::UPDATED_AT => 19, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'ORDER_ID' => 1, 'PRODUCT_REF' => 2, 'PRODUCT_SALE_ELEMENTS_REF' => 3, 'TITLE' => 4, 'CHAPO' => 5, 'DESCRIPTION' => 6, 'POSTSCRIPTUM' => 7, 'QUANTITY' => 8, 'PRICE' => 9, 'PROMO_PRICE' => 10, 'WAS_NEW' => 11, 'WAS_IN_PROMO' => 12, 'WEIGHT' => 13, 'EAN_CODE' => 14, 'TAX_RULE_TITLE' => 15, 'TAX_RULE_DESCRIPTION' => 16, 'PARENT' => 17, 'CREATED_AT' => 18, 'UPDATED_AT' => 19, ),
self::TYPE_FIELDNAME => array('id' => 0, 'order_id' => 1, 'product_ref' => 2, 'product_sale_elements_ref' => 3, 'title' => 4, 'chapo' => 5, 'description' => 6, 'postscriptum' => 7, 'quantity' => 8, 'price' => 9, 'promo_price' => 10, 'was_new' => 11, 'was_in_promo' => 12, 'weight' => 13, 'ean_code' => 14, 'tax_rule_title' => 15, 'tax_rule_description' => 16, 'parent' => 17, 'created_at' => 18, 'updated_at' => 19, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, )
);
/**
@@ -229,6 +234,7 @@ class OrderProductTableMap extends TableMap
$this->addColumn('WAS_NEW', 'WasNew', 'TINYINT', true, null, null);
$this->addColumn('WAS_IN_PROMO', 'WasInPromo', 'TINYINT', true, null, null);
$this->addColumn('WEIGHT', 'Weight', 'VARCHAR', false, 45, null);
$this->addColumn('EAN_CODE', 'EanCode', 'VARCHAR', false, 255, null);
$this->addColumn('TAX_RULE_TITLE', 'TaxRuleTitle', 'VARCHAR', false, 255, null);
$this->addColumn('TAX_RULE_DESCRIPTION', 'TaxRuleDescription', 'CLOB', false, null, null);
$this->addColumn('PARENT', 'Parent', 'INTEGER', false, null, null);
@@ -421,6 +427,7 @@ class OrderProductTableMap extends TableMap
$criteria->addSelectColumn(OrderProductTableMap::WAS_NEW);
$criteria->addSelectColumn(OrderProductTableMap::WAS_IN_PROMO);
$criteria->addSelectColumn(OrderProductTableMap::WEIGHT);
$criteria->addSelectColumn(OrderProductTableMap::EAN_CODE);
$criteria->addSelectColumn(OrderProductTableMap::TAX_RULE_TITLE);
$criteria->addSelectColumn(OrderProductTableMap::TAX_RULE_DESCRIPTION);
$criteria->addSelectColumn(OrderProductTableMap::PARENT);
@@ -441,6 +448,7 @@ class OrderProductTableMap extends TableMap
$criteria->addSelectColumn($alias . '.WAS_NEW');
$criteria->addSelectColumn($alias . '.WAS_IN_PROMO');
$criteria->addSelectColumn($alias . '.WEIGHT');
$criteria->addSelectColumn($alias . '.EAN_CODE');
$criteria->addSelectColumn($alias . '.TAX_RULE_TITLE');
$criteria->addSelectColumn($alias . '.TAX_RULE_DESCRIPTION');
$criteria->addSelectColumn($alias . '.PARENT');

View File

@@ -57,7 +57,7 @@ class ProductSaleElementsTableMap extends TableMap
/**
* The total number of columns
*/
const NUM_COLUMNS = 10;
const NUM_COLUMNS = 11;
/**
* The number of lazy-loaded columns
@@ -67,7 +67,7 @@ class ProductSaleElementsTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
const NUM_HYDRATE_COLUMNS = 10;
const NUM_HYDRATE_COLUMNS = 11;
/**
* the column name for the ID field
@@ -109,6 +109,11 @@ class ProductSaleElementsTableMap extends TableMap
*/
const IS_DEFAULT = 'product_sale_elements.IS_DEFAULT';
/**
* the column name for the EAN_CODE field
*/
const EAN_CODE = 'product_sale_elements.EAN_CODE';
/**
* the column name for the CREATED_AT field
*/
@@ -131,12 +136,12 @@ class ProductSaleElementsTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'ProductId', 'Ref', 'Quantity', 'Promo', 'Newness', 'Weight', 'IsDefault', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'productId', 'ref', 'quantity', 'promo', 'newness', 'weight', 'isDefault', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(ProductSaleElementsTableMap::ID, ProductSaleElementsTableMap::PRODUCT_ID, ProductSaleElementsTableMap::REF, ProductSaleElementsTableMap::QUANTITY, ProductSaleElementsTableMap::PROMO, ProductSaleElementsTableMap::NEWNESS, ProductSaleElementsTableMap::WEIGHT, ProductSaleElementsTableMap::IS_DEFAULT, ProductSaleElementsTableMap::CREATED_AT, ProductSaleElementsTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'PRODUCT_ID', 'REF', 'QUANTITY', 'PROMO', 'NEWNESS', 'WEIGHT', 'IS_DEFAULT', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'product_id', 'ref', 'quantity', 'promo', 'newness', 'weight', 'is_default', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
self::TYPE_PHPNAME => array('Id', 'ProductId', 'Ref', 'Quantity', 'Promo', 'Newness', 'Weight', 'IsDefault', 'EanCode', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'productId', 'ref', 'quantity', 'promo', 'newness', 'weight', 'isDefault', 'eanCode', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(ProductSaleElementsTableMap::ID, ProductSaleElementsTableMap::PRODUCT_ID, ProductSaleElementsTableMap::REF, ProductSaleElementsTableMap::QUANTITY, ProductSaleElementsTableMap::PROMO, ProductSaleElementsTableMap::NEWNESS, ProductSaleElementsTableMap::WEIGHT, ProductSaleElementsTableMap::IS_DEFAULT, ProductSaleElementsTableMap::EAN_CODE, ProductSaleElementsTableMap::CREATED_AT, ProductSaleElementsTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'PRODUCT_ID', 'REF', 'QUANTITY', 'PROMO', 'NEWNESS', 'WEIGHT', 'IS_DEFAULT', 'EAN_CODE', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'product_id', 'ref', 'quantity', 'promo', 'newness', 'weight', 'is_default', 'ean_code', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
);
/**
@@ -146,12 +151,12 @@ class ProductSaleElementsTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'ProductId' => 1, 'Ref' => 2, 'Quantity' => 3, 'Promo' => 4, 'Newness' => 5, 'Weight' => 6, 'IsDefault' => 7, 'CreatedAt' => 8, 'UpdatedAt' => 9, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'productId' => 1, 'ref' => 2, 'quantity' => 3, 'promo' => 4, 'newness' => 5, 'weight' => 6, 'isDefault' => 7, 'createdAt' => 8, 'updatedAt' => 9, ),
self::TYPE_COLNAME => array(ProductSaleElementsTableMap::ID => 0, ProductSaleElementsTableMap::PRODUCT_ID => 1, ProductSaleElementsTableMap::REF => 2, ProductSaleElementsTableMap::QUANTITY => 3, ProductSaleElementsTableMap::PROMO => 4, ProductSaleElementsTableMap::NEWNESS => 5, ProductSaleElementsTableMap::WEIGHT => 6, ProductSaleElementsTableMap::IS_DEFAULT => 7, ProductSaleElementsTableMap::CREATED_AT => 8, ProductSaleElementsTableMap::UPDATED_AT => 9, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'PRODUCT_ID' => 1, 'REF' => 2, 'QUANTITY' => 3, 'PROMO' => 4, 'NEWNESS' => 5, 'WEIGHT' => 6, 'IS_DEFAULT' => 7, 'CREATED_AT' => 8, 'UPDATED_AT' => 9, ),
self::TYPE_FIELDNAME => array('id' => 0, 'product_id' => 1, 'ref' => 2, 'quantity' => 3, 'promo' => 4, 'newness' => 5, 'weight' => 6, 'is_default' => 7, 'created_at' => 8, 'updated_at' => 9, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
self::TYPE_PHPNAME => array('Id' => 0, 'ProductId' => 1, 'Ref' => 2, 'Quantity' => 3, 'Promo' => 4, 'Newness' => 5, 'Weight' => 6, 'IsDefault' => 7, 'EanCode' => 8, 'CreatedAt' => 9, 'UpdatedAt' => 10, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'productId' => 1, 'ref' => 2, 'quantity' => 3, 'promo' => 4, 'newness' => 5, 'weight' => 6, 'isDefault' => 7, 'eanCode' => 8, 'createdAt' => 9, 'updatedAt' => 10, ),
self::TYPE_COLNAME => array(ProductSaleElementsTableMap::ID => 0, ProductSaleElementsTableMap::PRODUCT_ID => 1, ProductSaleElementsTableMap::REF => 2, ProductSaleElementsTableMap::QUANTITY => 3, ProductSaleElementsTableMap::PROMO => 4, ProductSaleElementsTableMap::NEWNESS => 5, ProductSaleElementsTableMap::WEIGHT => 6, ProductSaleElementsTableMap::IS_DEFAULT => 7, ProductSaleElementsTableMap::EAN_CODE => 8, ProductSaleElementsTableMap::CREATED_AT => 9, ProductSaleElementsTableMap::UPDATED_AT => 10, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'PRODUCT_ID' => 1, 'REF' => 2, 'QUANTITY' => 3, 'PROMO' => 4, 'NEWNESS' => 5, 'WEIGHT' => 6, 'IS_DEFAULT' => 7, 'EAN_CODE' => 8, 'CREATED_AT' => 9, 'UPDATED_AT' => 10, ),
self::TYPE_FIELDNAME => array('id' => 0, 'product_id' => 1, 'ref' => 2, 'quantity' => 3, 'promo' => 4, 'newness' => 5, 'weight' => 6, 'is_default' => 7, 'ean_code' => 8, 'created_at' => 9, 'updated_at' => 10, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
);
/**
@@ -178,6 +183,7 @@ class ProductSaleElementsTableMap extends TableMap
$this->addColumn('NEWNESS', 'Newness', 'TINYINT', false, null, 0);
$this->addColumn('WEIGHT', 'Weight', 'FLOAT', false, null, 0);
$this->addColumn('IS_DEFAULT', 'IsDefault', 'BOOLEAN', false, 1, false);
$this->addColumn('EAN_CODE', 'EanCode', 'VARCHAR', false, 255, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize()
@@ -362,6 +368,7 @@ class ProductSaleElementsTableMap extends TableMap
$criteria->addSelectColumn(ProductSaleElementsTableMap::NEWNESS);
$criteria->addSelectColumn(ProductSaleElementsTableMap::WEIGHT);
$criteria->addSelectColumn(ProductSaleElementsTableMap::IS_DEFAULT);
$criteria->addSelectColumn(ProductSaleElementsTableMap::EAN_CODE);
$criteria->addSelectColumn(ProductSaleElementsTableMap::CREATED_AT);
$criteria->addSelectColumn(ProductSaleElementsTableMap::UPDATED_AT);
} else {
@@ -373,6 +380,7 @@ class ProductSaleElementsTableMap extends TableMap
$criteria->addSelectColumn($alias . '.NEWNESS');
$criteria->addSelectColumn($alias . '.WEIGHT');
$criteria->addSelectColumn($alias . '.IS_DEFAULT');
$criteria->addSelectColumn($alias . '.EAN_CODE');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}

View File

@@ -202,7 +202,7 @@ class ProductTableMap extends TableMap
*/
public function buildRelations()
{
$this->addRelation('TaxRule', '\\Thelia\\Model\\TaxRule', RelationMap::MANY_TO_ONE, array('tax_rule_id' => 'id', ), 'SET NULL', 'RESTRICT');
$this->addRelation('TaxRule', '\\Thelia\\Model\\TaxRule', RelationMap::MANY_TO_ONE, array('tax_rule_id' => 'id', ), 'RESTRICT', 'RESTRICT');
$this->addRelation('Template', '\\Thelia\\Model\\Template', RelationMap::MANY_TO_ONE, array('template_id' => 'id', ), null, null);
$this->addRelation('ProductCategory', '\\Thelia\\Model\\ProductCategory', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'ProductCategories');
$this->addRelation('FeatureProduct', '\\Thelia\\Model\\FeatureProduct', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'FeatureProducts');

View File

@@ -10,12 +10,12 @@ use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Map\RelationMap;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Map\TableMapTrait;
use Thelia\Model\GroupI18n;
use Thelia\Model\GroupI18nQuery;
use Thelia\Model\ProfileI18n;
use Thelia\Model\ProfileI18nQuery;
/**
* This class defines the structure of the 'group_i18n' table.
* This class defines the structure of the 'profile_i18n' table.
*
*
*
@@ -25,14 +25,14 @@ use Thelia\Model\GroupI18nQuery;
* (i.e. if it's a text column type).
*
*/
class GroupI18nTableMap extends TableMap
class ProfileI18nTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'Thelia.Model.Map.GroupI18nTableMap';
const CLASS_NAME = 'Thelia.Model.Map.ProfileI18nTableMap';
/**
* The default database name for this class
@@ -42,17 +42,17 @@ class GroupI18nTableMap extends TableMap
/**
* The table name for this class
*/
const TABLE_NAME = 'group_i18n';
const TABLE_NAME = 'profile_i18n';
/**
* The related Propel class for this table
*/
const OM_CLASS = '\\Thelia\\Model\\GroupI18n';
const OM_CLASS = '\\Thelia\\Model\\ProfileI18n';
/**
* A class that can be returned by this tableMap
*/
const CLASS_DEFAULT = 'Thelia.Model.GroupI18n';
const CLASS_DEFAULT = 'Thelia.Model.ProfileI18n';
/**
* The total number of columns
@@ -72,32 +72,32 @@ class GroupI18nTableMap extends TableMap
/**
* the column name for the ID field
*/
const ID = 'group_i18n.ID';
const ID = 'profile_i18n.ID';
/**
* the column name for the LOCALE field
*/
const LOCALE = 'group_i18n.LOCALE';
const LOCALE = 'profile_i18n.LOCALE';
/**
* the column name for the TITLE field
*/
const TITLE = 'group_i18n.TITLE';
const TITLE = 'profile_i18n.TITLE';
/**
* the column name for the DESCRIPTION field
*/
const DESCRIPTION = 'group_i18n.DESCRIPTION';
const DESCRIPTION = 'profile_i18n.DESCRIPTION';
/**
* the column name for the CHAPO field
*/
const CHAPO = 'group_i18n.CHAPO';
const CHAPO = 'profile_i18n.CHAPO';
/**
* the column name for the POSTSCRIPTUM field
*/
const POSTSCRIPTUM = 'group_i18n.POSTSCRIPTUM';
const POSTSCRIPTUM = 'profile_i18n.POSTSCRIPTUM';
/**
* The default string format for model objects of the related table
@@ -113,7 +113,7 @@ class GroupI18nTableMap extends TableMap
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'Locale', 'Title', 'Description', 'Chapo', 'Postscriptum', ),
self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
self::TYPE_COLNAME => array(GroupI18nTableMap::ID, GroupI18nTableMap::LOCALE, GroupI18nTableMap::TITLE, GroupI18nTableMap::DESCRIPTION, GroupI18nTableMap::CHAPO, GroupI18nTableMap::POSTSCRIPTUM, ),
self::TYPE_COLNAME => array(ProfileI18nTableMap::ID, ProfileI18nTableMap::LOCALE, ProfileI18nTableMap::TITLE, ProfileI18nTableMap::DESCRIPTION, ProfileI18nTableMap::CHAPO, ProfileI18nTableMap::POSTSCRIPTUM, ),
self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'TITLE', 'DESCRIPTION', 'CHAPO', 'POSTSCRIPTUM', ),
self::TYPE_FIELDNAME => array('id', 'locale', 'title', 'description', 'chapo', 'postscriptum', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
@@ -128,7 +128,7 @@ class GroupI18nTableMap extends TableMap
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Title' => 2, 'Description' => 3, 'Chapo' => 4, 'Postscriptum' => 5, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
self::TYPE_COLNAME => array(GroupI18nTableMap::ID => 0, GroupI18nTableMap::LOCALE => 1, GroupI18nTableMap::TITLE => 2, GroupI18nTableMap::DESCRIPTION => 3, GroupI18nTableMap::CHAPO => 4, GroupI18nTableMap::POSTSCRIPTUM => 5, ),
self::TYPE_COLNAME => array(ProfileI18nTableMap::ID => 0, ProfileI18nTableMap::LOCALE => 1, ProfileI18nTableMap::TITLE => 2, ProfileI18nTableMap::DESCRIPTION => 3, ProfileI18nTableMap::CHAPO => 4, ProfileI18nTableMap::POSTSCRIPTUM => 5, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'TITLE' => 2, 'DESCRIPTION' => 3, 'CHAPO' => 4, 'POSTSCRIPTUM' => 5, ),
self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'title' => 2, 'description' => 3, 'chapo' => 4, 'postscriptum' => 5, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
@@ -144,13 +144,13 @@ class GroupI18nTableMap extends TableMap
public function initialize()
{
// attributes
$this->setName('group_i18n');
$this->setPhpName('GroupI18n');
$this->setClassName('\\Thelia\\Model\\GroupI18n');
$this->setName('profile_i18n');
$this->setPhpName('ProfileI18n');
$this->setClassName('\\Thelia\\Model\\ProfileI18n');
$this->setPackage('Thelia.Model');
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'group', 'ID', true, null, null);
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'profile', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
@@ -163,7 +163,7 @@ class GroupI18nTableMap extends TableMap
*/
public function buildRelations()
{
$this->addRelation('Group', '\\Thelia\\Model\\Group', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
$this->addRelation('Profile', '\\Thelia\\Model\\Profile', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
} // buildRelations()
/**
@@ -174,7 +174,7 @@ class GroupI18nTableMap extends TableMap
* to the cache in order to ensure that the same objects are always returned by find*()
* and findPk*() calls.
*
* @param \Thelia\Model\GroupI18n $obj A \Thelia\Model\GroupI18n object.
* @param \Thelia\Model\ProfileI18n $obj A \Thelia\Model\ProfileI18n 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)
@@ -195,12 +195,12 @@ class GroupI18nTableMap extends TableMap
* 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 \Thelia\Model\GroupI18n object or a primary key value.
* @param mixed $value A \Thelia\Model\ProfileI18n object or a primary key value.
*/
public static function removeInstanceFromPool($value)
{
if (Propel::isInstancePoolingEnabled() && null !== $value) {
if (is_object($value) && $value instanceof \Thelia\Model\GroupI18n) {
if (is_object($value) && $value instanceof \Thelia\Model\ProfileI18n) {
$key = serialize(array((string) $value->getId(), (string) $value->getLocale()));
} elseif (is_array($value) && count($value) === 2) {
@@ -211,7 +211,7 @@ class GroupI18nTableMap extends TableMap
return;
} else {
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\GroupI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\ProfileI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
throw $e;
}
@@ -271,7 +271,7 @@ class GroupI18nTableMap extends TableMap
*/
public static function getOMClass($withPrefix = true)
{
return $withPrefix ? GroupI18nTableMap::CLASS_DEFAULT : GroupI18nTableMap::OM_CLASS;
return $withPrefix ? ProfileI18nTableMap::CLASS_DEFAULT : ProfileI18nTableMap::OM_CLASS;
}
/**
@@ -285,21 +285,21 @@ class GroupI18nTableMap extends TableMap
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return array (GroupI18n object, last column rank)
* @return array (ProfileI18n object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
$key = GroupI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = GroupI18nTableMap::getInstanceFromPool($key))) {
$key = ProfileI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = ProfileI18nTableMap::getInstanceFromPool($key))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj->hydrate($row, $offset, true); // rehydrate
$col = $offset + GroupI18nTableMap::NUM_HYDRATE_COLUMNS;
$col = $offset + ProfileI18nTableMap::NUM_HYDRATE_COLUMNS;
} else {
$cls = GroupI18nTableMap::OM_CLASS;
$cls = ProfileI18nTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
GroupI18nTableMap::addInstanceToPool($obj, $key);
ProfileI18nTableMap::addInstanceToPool($obj, $key);
}
return array($obj, $col);
@@ -322,8 +322,8 @@ class GroupI18nTableMap extends TableMap
$cls = static::getOMClass(false);
// populate the object(s)
while ($row = $dataFetcher->fetch()) {
$key = GroupI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = GroupI18nTableMap::getInstanceFromPool($key))) {
$key = ProfileI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = ProfileI18nTableMap::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
@@ -332,7 +332,7 @@ class GroupI18nTableMap extends TableMap
$obj = new $cls();
$obj->hydrate($row);
$results[] = $obj;
GroupI18nTableMap::addInstanceToPool($obj, $key);
ProfileI18nTableMap::addInstanceToPool($obj, $key);
} // if key exists
}
@@ -353,12 +353,12 @@ class GroupI18nTableMap extends TableMap
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(GroupI18nTableMap::ID);
$criteria->addSelectColumn(GroupI18nTableMap::LOCALE);
$criteria->addSelectColumn(GroupI18nTableMap::TITLE);
$criteria->addSelectColumn(GroupI18nTableMap::DESCRIPTION);
$criteria->addSelectColumn(GroupI18nTableMap::CHAPO);
$criteria->addSelectColumn(GroupI18nTableMap::POSTSCRIPTUM);
$criteria->addSelectColumn(ProfileI18nTableMap::ID);
$criteria->addSelectColumn(ProfileI18nTableMap::LOCALE);
$criteria->addSelectColumn(ProfileI18nTableMap::TITLE);
$criteria->addSelectColumn(ProfileI18nTableMap::DESCRIPTION);
$criteria->addSelectColumn(ProfileI18nTableMap::CHAPO);
$criteria->addSelectColumn(ProfileI18nTableMap::POSTSCRIPTUM);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.LOCALE');
@@ -378,7 +378,7 @@ class GroupI18nTableMap extends TableMap
*/
public static function getTableMap()
{
return Propel::getServiceContainer()->getDatabaseMap(GroupI18nTableMap::DATABASE_NAME)->getTable(GroupI18nTableMap::TABLE_NAME);
return Propel::getServiceContainer()->getDatabaseMap(ProfileI18nTableMap::DATABASE_NAME)->getTable(ProfileI18nTableMap::TABLE_NAME);
}
/**
@@ -386,16 +386,16 @@ class GroupI18nTableMap extends TableMap
*/
public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(GroupI18nTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(GroupI18nTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new GroupI18nTableMap());
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ProfileI18nTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(ProfileI18nTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new ProfileI18nTableMap());
}
}
/**
* Performs a DELETE on the database, given a GroupI18n or Criteria object OR a primary key value.
* Performs a DELETE on the database, given a ProfileI18n or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or GroupI18n object or primary key or array of primary keys
* @param mixed $values Criteria or ProfileI18n object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
@@ -406,17 +406,17 @@ class GroupI18nTableMap extends TableMap
public static function doDelete($values, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(GroupI18nTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProfileI18nTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
} elseif ($values instanceof \Thelia\Model\GroupI18n) { // it's a model object
} elseif ($values instanceof \Thelia\Model\ProfileI18n) { // 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(GroupI18nTableMap::DATABASE_NAME);
$criteria = new Criteria(ProfileI18nTableMap::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)) {
@@ -424,17 +424,17 @@ class GroupI18nTableMap extends TableMap
$values = array($values);
}
foreach ($values as $value) {
$criterion = $criteria->getNewCriterion(GroupI18nTableMap::ID, $value[0]);
$criterion->addAnd($criteria->getNewCriterion(GroupI18nTableMap::LOCALE, $value[1]));
$criterion = $criteria->getNewCriterion(ProfileI18nTableMap::ID, $value[0]);
$criterion->addAnd($criteria->getNewCriterion(ProfileI18nTableMap::LOCALE, $value[1]));
$criteria->addOr($criterion);
}
}
$query = GroupI18nQuery::create()->mergeWith($criteria);
$query = ProfileI18nQuery::create()->mergeWith($criteria);
if ($values instanceof Criteria) { GroupI18nTableMap::clearInstancePool();
if ($values instanceof Criteria) { ProfileI18nTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
foreach ((array) $values as $singleval) { GroupI18nTableMap::removeInstanceFromPool($singleval);
foreach ((array) $values as $singleval) { ProfileI18nTableMap::removeInstanceFromPool($singleval);
}
}
@@ -442,20 +442,20 @@ class GroupI18nTableMap extends TableMap
}
/**
* Deletes all rows from the group_i18n table.
* Deletes all rows from the profile_i18n table.
*
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
*/
public static function doDeleteAll(ConnectionInterface $con = null)
{
return GroupI18nQuery::create()->doDeleteAll($con);
return ProfileI18nQuery::create()->doDeleteAll($con);
}
/**
* Performs an INSERT on the database, given a GroupI18n or Criteria object.
* Performs an INSERT on the database, given a ProfileI18n or Criteria object.
*
* @param mixed $criteria Criteria or GroupI18n object containing data that is used to create the INSERT statement.
* @param mixed $criteria Criteria or ProfileI18n object containing data that is used to create the INSERT statement.
* @param ConnectionInterface $con the ConnectionInterface connection to use
* @return mixed The new primary key.
* @throws PropelException Any exceptions caught during processing will be
@@ -464,18 +464,18 @@ class GroupI18nTableMap extends TableMap
public static function doInsert($criteria, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(GroupI18nTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProfileI18nTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
$criteria = $criteria->buildCriteria(); // build Criteria from GroupI18n object
$criteria = $criteria->buildCriteria(); // build Criteria from ProfileI18n object
}
// Set the correct dbName
$query = GroupI18nQuery::create()->mergeWith($criteria);
$query = ProfileI18nQuery::create()->mergeWith($criteria);
try {
// use transaction because $criteria could contain info
@@ -491,7 +491,7 @@ class GroupI18nTableMap extends TableMap
return $pk;
}
} // GroupI18nTableMap
} // ProfileI18nTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
GroupI18nTableMap::buildTableMap();
ProfileI18nTableMap::buildTableMap();

View File

@@ -10,12 +10,12 @@ use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Map\RelationMap;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Map\TableMapTrait;
use Thelia\Model\GroupModule;
use Thelia\Model\GroupModuleQuery;
use Thelia\Model\ProfileModule;
use Thelia\Model\ProfileModuleQuery;
/**
* This class defines the structure of the 'group_module' table.
* This class defines the structure of the 'profile_module' table.
*
*
*
@@ -25,14 +25,14 @@ use Thelia\Model\GroupModuleQuery;
* (i.e. if it's a text column type).
*
*/
class GroupModuleTableMap extends TableMap
class ProfileModuleTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'Thelia.Model.Map.GroupModuleTableMap';
const CLASS_NAME = 'Thelia.Model.Map.ProfileModuleTableMap';
/**
* The default database name for this class
@@ -42,17 +42,17 @@ class GroupModuleTableMap extends TableMap
/**
* The table name for this class
*/
const TABLE_NAME = 'group_module';
const TABLE_NAME = 'profile_module';
/**
* The related Propel class for this table
*/
const OM_CLASS = '\\Thelia\\Model\\GroupModule';
const OM_CLASS = '\\Thelia\\Model\\ProfileModule';
/**
* A class that can be returned by this tableMap
*/
const CLASS_DEFAULT = 'Thelia.Model.GroupModule';
const CLASS_DEFAULT = 'Thelia.Model.ProfileModule';
/**
* The total number of columns
@@ -72,32 +72,32 @@ class GroupModuleTableMap extends TableMap
/**
* the column name for the ID field
*/
const ID = 'group_module.ID';
const ID = 'profile_module.ID';
/**
* the column name for the GROUP_ID field
* the column name for the PROFILE_ID field
*/
const GROUP_ID = 'group_module.GROUP_ID';
const PROFILE_ID = 'profile_module.PROFILE_ID';
/**
* the column name for the MODULE_ID field
*/
const MODULE_ID = 'group_module.MODULE_ID';
const MODULE_ID = 'profile_module.MODULE_ID';
/**
* the column name for the ACCESS field
*/
const ACCESS = 'group_module.ACCESS';
const ACCESS = 'profile_module.ACCESS';
/**
* the column name for the CREATED_AT field
*/
const CREATED_AT = 'group_module.CREATED_AT';
const CREATED_AT = 'profile_module.CREATED_AT';
/**
* the column name for the UPDATED_AT field
*/
const UPDATED_AT = 'group_module.UPDATED_AT';
const UPDATED_AT = 'profile_module.UPDATED_AT';
/**
* The default string format for model objects of the related table
@@ -111,11 +111,11 @@ class GroupModuleTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'GroupId', 'ModuleId', 'Access', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'groupId', 'moduleId', 'access', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(GroupModuleTableMap::ID, GroupModuleTableMap::GROUP_ID, GroupModuleTableMap::MODULE_ID, GroupModuleTableMap::ACCESS, GroupModuleTableMap::CREATED_AT, GroupModuleTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'GROUP_ID', 'MODULE_ID', 'ACCESS', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'group_id', 'module_id', 'access', 'created_at', 'updated_at', ),
self::TYPE_PHPNAME => array('Id', 'ProfileId', 'ModuleId', 'Access', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'profileId', 'moduleId', 'access', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(ProfileModuleTableMap::ID, ProfileModuleTableMap::PROFILE_ID, ProfileModuleTableMap::MODULE_ID, ProfileModuleTableMap::ACCESS, ProfileModuleTableMap::CREATED_AT, ProfileModuleTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'PROFILE_ID', 'MODULE_ID', 'ACCESS', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'profile_id', 'module_id', 'access', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
);
@@ -126,11 +126,11 @@ class GroupModuleTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'GroupId' => 1, 'ModuleId' => 2, 'Access' => 3, 'CreatedAt' => 4, 'UpdatedAt' => 5, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'groupId' => 1, 'moduleId' => 2, 'access' => 3, 'createdAt' => 4, 'updatedAt' => 5, ),
self::TYPE_COLNAME => array(GroupModuleTableMap::ID => 0, GroupModuleTableMap::GROUP_ID => 1, GroupModuleTableMap::MODULE_ID => 2, GroupModuleTableMap::ACCESS => 3, GroupModuleTableMap::CREATED_AT => 4, GroupModuleTableMap::UPDATED_AT => 5, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'GROUP_ID' => 1, 'MODULE_ID' => 2, 'ACCESS' => 3, 'CREATED_AT' => 4, 'UPDATED_AT' => 5, ),
self::TYPE_FIELDNAME => array('id' => 0, 'group_id' => 1, 'module_id' => 2, 'access' => 3, 'created_at' => 4, 'updated_at' => 5, ),
self::TYPE_PHPNAME => array('Id' => 0, 'ProfileId' => 1, 'ModuleId' => 2, 'Access' => 3, 'CreatedAt' => 4, 'UpdatedAt' => 5, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'profileId' => 1, 'moduleId' => 2, 'access' => 3, 'createdAt' => 4, 'updatedAt' => 5, ),
self::TYPE_COLNAME => array(ProfileModuleTableMap::ID => 0, ProfileModuleTableMap::PROFILE_ID => 1, ProfileModuleTableMap::MODULE_ID => 2, ProfileModuleTableMap::ACCESS => 3, ProfileModuleTableMap::CREATED_AT => 4, ProfileModuleTableMap::UPDATED_AT => 5, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'PROFILE_ID' => 1, 'MODULE_ID' => 2, 'ACCESS' => 3, 'CREATED_AT' => 4, 'UPDATED_AT' => 5, ),
self::TYPE_FIELDNAME => array('id' => 0, 'profile_id' => 1, 'module_id' => 2, 'access' => 3, 'created_at' => 4, 'updated_at' => 5, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
);
@@ -144,14 +144,14 @@ class GroupModuleTableMap extends TableMap
public function initialize()
{
// attributes
$this->setName('group_module');
$this->setPhpName('GroupModule');
$this->setClassName('\\Thelia\\Model\\GroupModule');
$this->setName('profile_module');
$this->setPhpName('ProfileModule');
$this->setClassName('\\Thelia\\Model\\ProfileModule');
$this->setPackage('Thelia.Model');
$this->setUseIdGenerator(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addForeignKey('GROUP_ID', 'GroupId', 'INTEGER', 'group', 'ID', true, null, null);
$this->addForeignKey('PROFILE_ID', 'ProfileId', 'INTEGER', 'profile', 'ID', true, null, null);
$this->addForeignKey('MODULE_ID', 'ModuleId', 'INTEGER', 'module', 'ID', false, null, null);
$this->addColumn('ACCESS', 'Access', 'TINYINT', false, null, 0);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
@@ -163,7 +163,7 @@ class GroupModuleTableMap extends TableMap
*/
public function buildRelations()
{
$this->addRelation('Group', '\\Thelia\\Model\\Group', RelationMap::MANY_TO_ONE, array('group_id' => 'id', ), 'CASCADE', 'CASCADE');
$this->addRelation('Profile', '\\Thelia\\Model\\Profile', RelationMap::MANY_TO_ONE, array('profile_id' => 'id', ), 'CASCADE', 'CASCADE');
$this->addRelation('Module', '\\Thelia\\Model\\Module', RelationMap::MANY_TO_ONE, array('module_id' => 'id', ), 'CASCADE', 'RESTRICT');
} // buildRelations()
@@ -236,7 +236,7 @@ class GroupModuleTableMap extends TableMap
*/
public static function getOMClass($withPrefix = true)
{
return $withPrefix ? GroupModuleTableMap::CLASS_DEFAULT : GroupModuleTableMap::OM_CLASS;
return $withPrefix ? ProfileModuleTableMap::CLASS_DEFAULT : ProfileModuleTableMap::OM_CLASS;
}
/**
@@ -250,21 +250,21 @@ class GroupModuleTableMap extends TableMap
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return array (GroupModule object, last column rank)
* @return array (ProfileModule object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
$key = GroupModuleTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = GroupModuleTableMap::getInstanceFromPool($key))) {
$key = ProfileModuleTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = ProfileModuleTableMap::getInstanceFromPool($key))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj->hydrate($row, $offset, true); // rehydrate
$col = $offset + GroupModuleTableMap::NUM_HYDRATE_COLUMNS;
$col = $offset + ProfileModuleTableMap::NUM_HYDRATE_COLUMNS;
} else {
$cls = GroupModuleTableMap::OM_CLASS;
$cls = ProfileModuleTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
GroupModuleTableMap::addInstanceToPool($obj, $key);
ProfileModuleTableMap::addInstanceToPool($obj, $key);
}
return array($obj, $col);
@@ -287,8 +287,8 @@ class GroupModuleTableMap extends TableMap
$cls = static::getOMClass(false);
// populate the object(s)
while ($row = $dataFetcher->fetch()) {
$key = GroupModuleTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = GroupModuleTableMap::getInstanceFromPool($key))) {
$key = ProfileModuleTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = ProfileModuleTableMap::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
@@ -297,7 +297,7 @@ class GroupModuleTableMap extends TableMap
$obj = new $cls();
$obj->hydrate($row);
$results[] = $obj;
GroupModuleTableMap::addInstanceToPool($obj, $key);
ProfileModuleTableMap::addInstanceToPool($obj, $key);
} // if key exists
}
@@ -318,15 +318,15 @@ class GroupModuleTableMap extends TableMap
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(GroupModuleTableMap::ID);
$criteria->addSelectColumn(GroupModuleTableMap::GROUP_ID);
$criteria->addSelectColumn(GroupModuleTableMap::MODULE_ID);
$criteria->addSelectColumn(GroupModuleTableMap::ACCESS);
$criteria->addSelectColumn(GroupModuleTableMap::CREATED_AT);
$criteria->addSelectColumn(GroupModuleTableMap::UPDATED_AT);
$criteria->addSelectColumn(ProfileModuleTableMap::ID);
$criteria->addSelectColumn(ProfileModuleTableMap::PROFILE_ID);
$criteria->addSelectColumn(ProfileModuleTableMap::MODULE_ID);
$criteria->addSelectColumn(ProfileModuleTableMap::ACCESS);
$criteria->addSelectColumn(ProfileModuleTableMap::CREATED_AT);
$criteria->addSelectColumn(ProfileModuleTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.GROUP_ID');
$criteria->addSelectColumn($alias . '.PROFILE_ID');
$criteria->addSelectColumn($alias . '.MODULE_ID');
$criteria->addSelectColumn($alias . '.ACCESS');
$criteria->addSelectColumn($alias . '.CREATED_AT');
@@ -343,7 +343,7 @@ class GroupModuleTableMap extends TableMap
*/
public static function getTableMap()
{
return Propel::getServiceContainer()->getDatabaseMap(GroupModuleTableMap::DATABASE_NAME)->getTable(GroupModuleTableMap::TABLE_NAME);
return Propel::getServiceContainer()->getDatabaseMap(ProfileModuleTableMap::DATABASE_NAME)->getTable(ProfileModuleTableMap::TABLE_NAME);
}
/**
@@ -351,16 +351,16 @@ class GroupModuleTableMap extends TableMap
*/
public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(GroupModuleTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(GroupModuleTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new GroupModuleTableMap());
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ProfileModuleTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(ProfileModuleTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new ProfileModuleTableMap());
}
}
/**
* Performs a DELETE on the database, given a GroupModule or Criteria object OR a primary key value.
* Performs a DELETE on the database, given a ProfileModule or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or GroupModule object or primary key or array of primary keys
* @param mixed $values Criteria or ProfileModule object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
@@ -371,25 +371,25 @@ class GroupModuleTableMap extends TableMap
public static function doDelete($values, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(GroupModuleTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProfileModuleTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
} elseif ($values instanceof \Thelia\Model\GroupModule) { // it's a model object
} elseif ($values instanceof \Thelia\Model\ProfileModule) { // 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(GroupModuleTableMap::DATABASE_NAME);
$criteria->add(GroupModuleTableMap::ID, (array) $values, Criteria::IN);
$criteria = new Criteria(ProfileModuleTableMap::DATABASE_NAME);
$criteria->add(ProfileModuleTableMap::ID, (array) $values, Criteria::IN);
}
$query = GroupModuleQuery::create()->mergeWith($criteria);
$query = ProfileModuleQuery::create()->mergeWith($criteria);
if ($values instanceof Criteria) { GroupModuleTableMap::clearInstancePool();
if ($values instanceof Criteria) { ProfileModuleTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
foreach ((array) $values as $singleval) { GroupModuleTableMap::removeInstanceFromPool($singleval);
foreach ((array) $values as $singleval) { ProfileModuleTableMap::removeInstanceFromPool($singleval);
}
}
@@ -397,20 +397,20 @@ class GroupModuleTableMap extends TableMap
}
/**
* Deletes all rows from the group_module table.
* Deletes all rows from the profile_module table.
*
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
*/
public static function doDeleteAll(ConnectionInterface $con = null)
{
return GroupModuleQuery::create()->doDeleteAll($con);
return ProfileModuleQuery::create()->doDeleteAll($con);
}
/**
* Performs an INSERT on the database, given a GroupModule or Criteria object.
* Performs an INSERT on the database, given a ProfileModule or Criteria object.
*
* @param mixed $criteria Criteria or GroupModule object containing data that is used to create the INSERT statement.
* @param mixed $criteria Criteria or ProfileModule object containing data that is used to create the INSERT statement.
* @param ConnectionInterface $con the ConnectionInterface connection to use
* @return mixed The new primary key.
* @throws PropelException Any exceptions caught during processing will be
@@ -419,22 +419,22 @@ class GroupModuleTableMap extends TableMap
public static function doInsert($criteria, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(GroupModuleTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProfileModuleTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
$criteria = $criteria->buildCriteria(); // build Criteria from GroupModule object
$criteria = $criteria->buildCriteria(); // build Criteria from ProfileModule object
}
if ($criteria->containsKey(GroupModuleTableMap::ID) && $criteria->keyContainsValue(GroupModuleTableMap::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.GroupModuleTableMap::ID.')');
if ($criteria->containsKey(ProfileModuleTableMap::ID) && $criteria->keyContainsValue(ProfileModuleTableMap::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ProfileModuleTableMap::ID.')');
}
// Set the correct dbName
$query = GroupModuleQuery::create()->mergeWith($criteria);
$query = ProfileModuleQuery::create()->mergeWith($criteria);
try {
// use transaction because $criteria could contain info
@@ -450,7 +450,7 @@ class GroupModuleTableMap extends TableMap
return $pk;
}
} // GroupModuleTableMap
} // ProfileModuleTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
GroupModuleTableMap::buildTableMap();
ProfileModuleTableMap::buildTableMap();

View File

@@ -10,12 +10,12 @@ use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Map\RelationMap;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Map\TableMapTrait;
use Thelia\Model\GroupResource;
use Thelia\Model\GroupResourceQuery;
use Thelia\Model\ProfileResource;
use Thelia\Model\ProfileResourceQuery;
/**
* This class defines the structure of the 'group_resource' table.
* This class defines the structure of the 'profile_resource' table.
*
*
*
@@ -25,14 +25,14 @@ use Thelia\Model\GroupResourceQuery;
* (i.e. if it's a text column type).
*
*/
class GroupResourceTableMap extends TableMap
class ProfileResourceTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'Thelia.Model.Map.GroupResourceTableMap';
const CLASS_NAME = 'Thelia.Model.Map.ProfileResourceTableMap';
/**
* The default database name for this class
@@ -42,17 +42,17 @@ class GroupResourceTableMap extends TableMap
/**
* The table name for this class
*/
const TABLE_NAME = 'group_resource';
const TABLE_NAME = 'profile_resource';
/**
* The related Propel class for this table
*/
const OM_CLASS = '\\Thelia\\Model\\GroupResource';
const OM_CLASS = '\\Thelia\\Model\\ProfileResource';
/**
* A class that can be returned by this tableMap
*/
const CLASS_DEFAULT = 'Thelia.Model.GroupResource';
const CLASS_DEFAULT = 'Thelia.Model.ProfileResource';
/**
* The total number of columns
@@ -72,37 +72,37 @@ class GroupResourceTableMap extends TableMap
/**
* the column name for the ID field
*/
const ID = 'group_resource.ID';
const ID = 'profile_resource.ID';
/**
* the column name for the GROUP_ID field
* the column name for the PROFILE_ID field
*/
const GROUP_ID = 'group_resource.GROUP_ID';
const PROFILE_ID = 'profile_resource.PROFILE_ID';
/**
* the column name for the RESOURCE_ID field
*/
const RESOURCE_ID = 'group_resource.RESOURCE_ID';
const RESOURCE_ID = 'profile_resource.RESOURCE_ID';
/**
* the column name for the READ field
*/
const READ = 'group_resource.READ';
const READ = 'profile_resource.READ';
/**
* the column name for the WRITE field
*/
const WRITE = 'group_resource.WRITE';
const WRITE = 'profile_resource.WRITE';
/**
* the column name for the CREATED_AT field
*/
const CREATED_AT = 'group_resource.CREATED_AT';
const CREATED_AT = 'profile_resource.CREATED_AT';
/**
* the column name for the UPDATED_AT field
*/
const UPDATED_AT = 'group_resource.UPDATED_AT';
const UPDATED_AT = 'profile_resource.UPDATED_AT';
/**
* The default string format for model objects of the related table
@@ -116,11 +116,11 @@ class GroupResourceTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'GroupId', 'ResourceId', 'Read', 'Write', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'groupId', 'resourceId', 'read', 'write', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(GroupResourceTableMap::ID, GroupResourceTableMap::GROUP_ID, GroupResourceTableMap::RESOURCE_ID, GroupResourceTableMap::READ, GroupResourceTableMap::WRITE, GroupResourceTableMap::CREATED_AT, GroupResourceTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'GROUP_ID', 'RESOURCE_ID', 'READ', 'WRITE', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'group_id', 'resource_id', 'read', 'write', 'created_at', 'updated_at', ),
self::TYPE_PHPNAME => array('Id', 'ProfileId', 'ResourceId', 'Read', 'Write', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'profileId', 'resourceId', 'read', 'write', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(ProfileResourceTableMap::ID, ProfileResourceTableMap::PROFILE_ID, ProfileResourceTableMap::RESOURCE_ID, ProfileResourceTableMap::READ, ProfileResourceTableMap::WRITE, ProfileResourceTableMap::CREATED_AT, ProfileResourceTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'PROFILE_ID', 'RESOURCE_ID', 'READ', 'WRITE', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'profile_id', 'resource_id', 'read', 'write', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
);
@@ -131,11 +131,11 @@ class GroupResourceTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'GroupId' => 1, 'ResourceId' => 2, 'Read' => 3, 'Write' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'groupId' => 1, 'resourceId' => 2, 'read' => 3, 'write' => 4, 'createdAt' => 5, 'updatedAt' => 6, ),
self::TYPE_COLNAME => array(GroupResourceTableMap::ID => 0, GroupResourceTableMap::GROUP_ID => 1, GroupResourceTableMap::RESOURCE_ID => 2, GroupResourceTableMap::READ => 3, GroupResourceTableMap::WRITE => 4, GroupResourceTableMap::CREATED_AT => 5, GroupResourceTableMap::UPDATED_AT => 6, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'GROUP_ID' => 1, 'RESOURCE_ID' => 2, 'READ' => 3, 'WRITE' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, ),
self::TYPE_FIELDNAME => array('id' => 0, 'group_id' => 1, 'resource_id' => 2, 'read' => 3, 'write' => 4, 'created_at' => 5, 'updated_at' => 6, ),
self::TYPE_PHPNAME => array('Id' => 0, 'ProfileId' => 1, 'ResourceId' => 2, 'Read' => 3, 'Write' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'profileId' => 1, 'resourceId' => 2, 'read' => 3, 'write' => 4, 'createdAt' => 5, 'updatedAt' => 6, ),
self::TYPE_COLNAME => array(ProfileResourceTableMap::ID => 0, ProfileResourceTableMap::PROFILE_ID => 1, ProfileResourceTableMap::RESOURCE_ID => 2, ProfileResourceTableMap::READ => 3, ProfileResourceTableMap::WRITE => 4, ProfileResourceTableMap::CREATED_AT => 5, ProfileResourceTableMap::UPDATED_AT => 6, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'PROFILE_ID' => 1, 'RESOURCE_ID' => 2, 'READ' => 3, 'WRITE' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, ),
self::TYPE_FIELDNAME => array('id' => 0, 'profile_id' => 1, 'resource_id' => 2, 'read' => 3, 'write' => 4, 'created_at' => 5, 'updated_at' => 6, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
);
@@ -149,15 +149,15 @@ class GroupResourceTableMap extends TableMap
public function initialize()
{
// attributes
$this->setName('group_resource');
$this->setPhpName('GroupResource');
$this->setClassName('\\Thelia\\Model\\GroupResource');
$this->setName('profile_resource');
$this->setPhpName('ProfileResource');
$this->setClassName('\\Thelia\\Model\\ProfileResource');
$this->setPackage('Thelia.Model');
$this->setUseIdGenerator(true);
$this->setIsCrossRef(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addForeignPrimaryKey('GROUP_ID', 'GroupId', 'INTEGER' , 'group', 'ID', true, null, null);
$this->addForeignPrimaryKey('PROFILE_ID', 'ProfileId', 'INTEGER' , 'profile', 'ID', true, null, null);
$this->addForeignPrimaryKey('RESOURCE_ID', 'ResourceId', 'INTEGER' , 'resource', 'ID', true, null, null);
$this->addColumn('READ', 'Read', 'TINYINT', false, null, 0);
$this->addColumn('WRITE', 'Write', 'TINYINT', false, null, 0);
@@ -170,7 +170,7 @@ class GroupResourceTableMap extends TableMap
*/
public function buildRelations()
{
$this->addRelation('Group', '\\Thelia\\Model\\Group', RelationMap::MANY_TO_ONE, array('group_id' => 'id', ), 'CASCADE', 'RESTRICT');
$this->addRelation('Profile', '\\Thelia\\Model\\Profile', RelationMap::MANY_TO_ONE, array('profile_id' => 'id', ), 'CASCADE', 'RESTRICT');
$this->addRelation('Resource', '\\Thelia\\Model\\Resource', RelationMap::MANY_TO_ONE, array('resource_id' => 'id', ), 'CASCADE', 'RESTRICT');
} // buildRelations()
@@ -195,14 +195,14 @@ class GroupResourceTableMap extends TableMap
* to the cache in order to ensure that the same objects are always returned by find*()
* and findPk*() calls.
*
* @param \Thelia\Model\GroupResource $obj A \Thelia\Model\GroupResource object.
* @param \Thelia\Model\ProfileResource $obj A \Thelia\Model\ProfileResource 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 (null === $key) {
$key = serialize(array((string) $obj->getId(), (string) $obj->getGroupId(), (string) $obj->getResourceId()));
$key = serialize(array((string) $obj->getId(), (string) $obj->getProfileId(), (string) $obj->getResourceId()));
} // if key === null
self::$instances[$key] = $obj;
}
@@ -216,13 +216,13 @@ class GroupResourceTableMap extends TableMap
* 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 \Thelia\Model\GroupResource object or a primary key value.
* @param mixed $value A \Thelia\Model\ProfileResource object or a primary key value.
*/
public static function removeInstanceFromPool($value)
{
if (Propel::isInstancePoolingEnabled() && null !== $value) {
if (is_object($value) && $value instanceof \Thelia\Model\GroupResource) {
$key = serialize(array((string) $value->getId(), (string) $value->getGroupId(), (string) $value->getResourceId()));
if (is_object($value) && $value instanceof \Thelia\Model\ProfileResource) {
$key = serialize(array((string) $value->getId(), (string) $value->getProfileId(), (string) $value->getResourceId()));
} elseif (is_array($value) && count($value) === 3) {
// assume we've been passed a primary key";
@@ -232,7 +232,7 @@ class GroupResourceTableMap extends TableMap
return;
} else {
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\GroupResource object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\ProfileResource object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
throw $e;
}
@@ -254,11 +254,11 @@ class GroupResourceTableMap extends TableMap
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
// If the PK cannot be derived from the row, return NULL.
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('GroupId', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 2 + $offset : static::translateFieldName('ResourceId', TableMap::TYPE_PHPNAME, $indexType)] === null) {
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('ProfileId', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 2 + $offset : static::translateFieldName('ResourceId', TableMap::TYPE_PHPNAME, $indexType)] === null) {
return null;
}
return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('GroupId', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 2 + $offset : static::translateFieldName('ResourceId', TableMap::TYPE_PHPNAME, $indexType)]));
return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('ProfileId', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 2 + $offset : static::translateFieldName('ResourceId', TableMap::TYPE_PHPNAME, $indexType)]));
}
/**
@@ -292,7 +292,7 @@ class GroupResourceTableMap extends TableMap
*/
public static function getOMClass($withPrefix = true)
{
return $withPrefix ? GroupResourceTableMap::CLASS_DEFAULT : GroupResourceTableMap::OM_CLASS;
return $withPrefix ? ProfileResourceTableMap::CLASS_DEFAULT : ProfileResourceTableMap::OM_CLASS;
}
/**
@@ -306,21 +306,21 @@ class GroupResourceTableMap extends TableMap
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return array (GroupResource object, last column rank)
* @return array (ProfileResource object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
$key = GroupResourceTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = GroupResourceTableMap::getInstanceFromPool($key))) {
$key = ProfileResourceTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = ProfileResourceTableMap::getInstanceFromPool($key))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj->hydrate($row, $offset, true); // rehydrate
$col = $offset + GroupResourceTableMap::NUM_HYDRATE_COLUMNS;
$col = $offset + ProfileResourceTableMap::NUM_HYDRATE_COLUMNS;
} else {
$cls = GroupResourceTableMap::OM_CLASS;
$cls = ProfileResourceTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
GroupResourceTableMap::addInstanceToPool($obj, $key);
ProfileResourceTableMap::addInstanceToPool($obj, $key);
}
return array($obj, $col);
@@ -343,8 +343,8 @@ class GroupResourceTableMap extends TableMap
$cls = static::getOMClass(false);
// populate the object(s)
while ($row = $dataFetcher->fetch()) {
$key = GroupResourceTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = GroupResourceTableMap::getInstanceFromPool($key))) {
$key = ProfileResourceTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = ProfileResourceTableMap::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
@@ -353,7 +353,7 @@ class GroupResourceTableMap extends TableMap
$obj = new $cls();
$obj->hydrate($row);
$results[] = $obj;
GroupResourceTableMap::addInstanceToPool($obj, $key);
ProfileResourceTableMap::addInstanceToPool($obj, $key);
} // if key exists
}
@@ -374,16 +374,16 @@ class GroupResourceTableMap extends TableMap
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(GroupResourceTableMap::ID);
$criteria->addSelectColumn(GroupResourceTableMap::GROUP_ID);
$criteria->addSelectColumn(GroupResourceTableMap::RESOURCE_ID);
$criteria->addSelectColumn(GroupResourceTableMap::READ);
$criteria->addSelectColumn(GroupResourceTableMap::WRITE);
$criteria->addSelectColumn(GroupResourceTableMap::CREATED_AT);
$criteria->addSelectColumn(GroupResourceTableMap::UPDATED_AT);
$criteria->addSelectColumn(ProfileResourceTableMap::ID);
$criteria->addSelectColumn(ProfileResourceTableMap::PROFILE_ID);
$criteria->addSelectColumn(ProfileResourceTableMap::RESOURCE_ID);
$criteria->addSelectColumn(ProfileResourceTableMap::READ);
$criteria->addSelectColumn(ProfileResourceTableMap::WRITE);
$criteria->addSelectColumn(ProfileResourceTableMap::CREATED_AT);
$criteria->addSelectColumn(ProfileResourceTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.GROUP_ID');
$criteria->addSelectColumn($alias . '.PROFILE_ID');
$criteria->addSelectColumn($alias . '.RESOURCE_ID');
$criteria->addSelectColumn($alias . '.READ');
$criteria->addSelectColumn($alias . '.WRITE');
@@ -401,7 +401,7 @@ class GroupResourceTableMap extends TableMap
*/
public static function getTableMap()
{
return Propel::getServiceContainer()->getDatabaseMap(GroupResourceTableMap::DATABASE_NAME)->getTable(GroupResourceTableMap::TABLE_NAME);
return Propel::getServiceContainer()->getDatabaseMap(ProfileResourceTableMap::DATABASE_NAME)->getTable(ProfileResourceTableMap::TABLE_NAME);
}
/**
@@ -409,16 +409,16 @@ class GroupResourceTableMap extends TableMap
*/
public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(GroupResourceTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(GroupResourceTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new GroupResourceTableMap());
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ProfileResourceTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(ProfileResourceTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new ProfileResourceTableMap());
}
}
/**
* Performs a DELETE on the database, given a GroupResource or Criteria object OR a primary key value.
* Performs a DELETE on the database, given a ProfileResource or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or GroupResource object or primary key or array of primary keys
* @param mixed $values Criteria or ProfileResource object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
@@ -429,17 +429,17 @@ class GroupResourceTableMap extends TableMap
public static function doDelete($values, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(GroupResourceTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProfileResourceTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
} elseif ($values instanceof \Thelia\Model\GroupResource) { // it's a model object
} elseif ($values instanceof \Thelia\Model\ProfileResource) { // 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(GroupResourceTableMap::DATABASE_NAME);
$criteria = new Criteria(ProfileResourceTableMap::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)) {
@@ -447,18 +447,18 @@ class GroupResourceTableMap extends TableMap
$values = array($values);
}
foreach ($values as $value) {
$criterion = $criteria->getNewCriterion(GroupResourceTableMap::ID, $value[0]);
$criterion->addAnd($criteria->getNewCriterion(GroupResourceTableMap::GROUP_ID, $value[1]));
$criterion->addAnd($criteria->getNewCriterion(GroupResourceTableMap::RESOURCE_ID, $value[2]));
$criterion = $criteria->getNewCriterion(ProfileResourceTableMap::ID, $value[0]);
$criterion->addAnd($criteria->getNewCriterion(ProfileResourceTableMap::PROFILE_ID, $value[1]));
$criterion->addAnd($criteria->getNewCriterion(ProfileResourceTableMap::RESOURCE_ID, $value[2]));
$criteria->addOr($criterion);
}
}
$query = GroupResourceQuery::create()->mergeWith($criteria);
$query = ProfileResourceQuery::create()->mergeWith($criteria);
if ($values instanceof Criteria) { GroupResourceTableMap::clearInstancePool();
if ($values instanceof Criteria) { ProfileResourceTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
foreach ((array) $values as $singleval) { GroupResourceTableMap::removeInstanceFromPool($singleval);
foreach ((array) $values as $singleval) { ProfileResourceTableMap::removeInstanceFromPool($singleval);
}
}
@@ -466,20 +466,20 @@ class GroupResourceTableMap extends TableMap
}
/**
* Deletes all rows from the group_resource table.
* Deletes all rows from the profile_resource table.
*
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
*/
public static function doDeleteAll(ConnectionInterface $con = null)
{
return GroupResourceQuery::create()->doDeleteAll($con);
return ProfileResourceQuery::create()->doDeleteAll($con);
}
/**
* Performs an INSERT on the database, given a GroupResource or Criteria object.
* Performs an INSERT on the database, given a ProfileResource or Criteria object.
*
* @param mixed $criteria Criteria or GroupResource object containing data that is used to create the INSERT statement.
* @param mixed $criteria Criteria or ProfileResource object containing data that is used to create the INSERT statement.
* @param ConnectionInterface $con the ConnectionInterface connection to use
* @return mixed The new primary key.
* @throws PropelException Any exceptions caught during processing will be
@@ -488,22 +488,22 @@ class GroupResourceTableMap extends TableMap
public static function doInsert($criteria, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(GroupResourceTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProfileResourceTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
$criteria = $criteria->buildCriteria(); // build Criteria from GroupResource object
$criteria = $criteria->buildCriteria(); // build Criteria from ProfileResource object
}
if ($criteria->containsKey(GroupResourceTableMap::ID) && $criteria->keyContainsValue(GroupResourceTableMap::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.GroupResourceTableMap::ID.')');
if ($criteria->containsKey(ProfileResourceTableMap::ID) && $criteria->keyContainsValue(ProfileResourceTableMap::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ProfileResourceTableMap::ID.')');
}
// Set the correct dbName
$query = GroupResourceQuery::create()->mergeWith($criteria);
$query = ProfileResourceQuery::create()->mergeWith($criteria);
try {
// use transaction because $criteria could contain info
@@ -519,7 +519,7 @@ class GroupResourceTableMap extends TableMap
return $pk;
}
} // GroupResourceTableMap
} // ProfileResourceTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
GroupResourceTableMap::buildTableMap();
ProfileResourceTableMap::buildTableMap();

View File

@@ -10,12 +10,12 @@ use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Map\RelationMap;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Map\TableMapTrait;
use Thelia\Model\Group;
use Thelia\Model\GroupQuery;
use Thelia\Model\Profile;
use Thelia\Model\ProfileQuery;
/**
* This class defines the structure of the 'group' table.
* This class defines the structure of the 'profile' table.
*
*
*
@@ -25,14 +25,14 @@ use Thelia\Model\GroupQuery;
* (i.e. if it's a text column type).
*
*/
class GroupTableMap extends TableMap
class ProfileTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'Thelia.Model.Map.GroupTableMap';
const CLASS_NAME = 'Thelia.Model.Map.ProfileTableMap';
/**
* The default database name for this class
@@ -42,17 +42,17 @@ class GroupTableMap extends TableMap
/**
* The table name for this class
*/
const TABLE_NAME = 'group';
const TABLE_NAME = 'profile';
/**
* The related Propel class for this table
*/
const OM_CLASS = '\\Thelia\\Model\\Group';
const OM_CLASS = '\\Thelia\\Model\\Profile';
/**
* A class that can be returned by this tableMap
*/
const CLASS_DEFAULT = 'Thelia.Model.Group';
const CLASS_DEFAULT = 'Thelia.Model.Profile';
/**
* The total number of columns
@@ -72,22 +72,22 @@ class GroupTableMap extends TableMap
/**
* the column name for the ID field
*/
const ID = 'group.ID';
const ID = 'profile.ID';
/**
* the column name for the CODE field
*/
const CODE = 'group.CODE';
const CODE = 'profile.CODE';
/**
* the column name for the CREATED_AT field
*/
const CREATED_AT = 'group.CREATED_AT';
const CREATED_AT = 'profile.CREATED_AT';
/**
* the column name for the UPDATED_AT field
*/
const UPDATED_AT = 'group.UPDATED_AT';
const UPDATED_AT = 'profile.UPDATED_AT';
/**
* The default string format for model objects of the related table
@@ -112,7 +112,7 @@ class GroupTableMap extends TableMap
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'Code', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'code', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(GroupTableMap::ID, GroupTableMap::CODE, GroupTableMap::CREATED_AT, GroupTableMap::UPDATED_AT, ),
self::TYPE_COLNAME => array(ProfileTableMap::ID, ProfileTableMap::CODE, ProfileTableMap::CREATED_AT, ProfileTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'CODE', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'code', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, )
@@ -127,7 +127,7 @@ class GroupTableMap extends TableMap
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'Code' => 1, 'CreatedAt' => 2, 'UpdatedAt' => 3, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'code' => 1, 'createdAt' => 2, 'updatedAt' => 3, ),
self::TYPE_COLNAME => array(GroupTableMap::ID => 0, GroupTableMap::CODE => 1, GroupTableMap::CREATED_AT => 2, GroupTableMap::UPDATED_AT => 3, ),
self::TYPE_COLNAME => array(ProfileTableMap::ID => 0, ProfileTableMap::CODE => 1, ProfileTableMap::CREATED_AT => 2, ProfileTableMap::UPDATED_AT => 3, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'CODE' => 1, 'CREATED_AT' => 2, 'UPDATED_AT' => 3, ),
self::TYPE_FIELDNAME => array('id' => 0, 'code' => 1, 'created_at' => 2, 'updated_at' => 3, ),
self::TYPE_NUM => array(0, 1, 2, 3, )
@@ -143,9 +143,9 @@ class GroupTableMap extends TableMap
public function initialize()
{
// attributes
$this->setName('group');
$this->setPhpName('Group');
$this->setClassName('\\Thelia\\Model\\Group');
$this->setName('profile');
$this->setPhpName('Profile');
$this->setClassName('\\Thelia\\Model\\Profile');
$this->setPackage('Thelia.Model');
$this->setUseIdGenerator(true);
// columns
@@ -160,11 +160,10 @@ class GroupTableMap extends TableMap
*/
public function buildRelations()
{
$this->addRelation('AdminGroup', '\\Thelia\\Model\\AdminGroup', RelationMap::ONE_TO_MANY, array('id' => 'group_id', ), 'CASCADE', 'RESTRICT', 'AdminGroups');
$this->addRelation('GroupResource', '\\Thelia\\Model\\GroupResource', RelationMap::ONE_TO_MANY, array('id' => 'group_id', ), 'CASCADE', 'RESTRICT', 'GroupResources');
$this->addRelation('GroupModule', '\\Thelia\\Model\\GroupModule', RelationMap::ONE_TO_MANY, array('id' => 'group_id', ), 'CASCADE', 'CASCADE', 'GroupModules');
$this->addRelation('GroupI18n', '\\Thelia\\Model\\GroupI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'GroupI18ns');
$this->addRelation('Admin', '\\Thelia\\Model\\Admin', RelationMap::MANY_TO_MANY, array(), 'CASCADE', 'RESTRICT', 'Admins');
$this->addRelation('Admin', '\\Thelia\\Model\\Admin', RelationMap::ONE_TO_MANY, array('id' => 'profile_id', ), 'RESTRICT', 'RESTRICT', 'Admins');
$this->addRelation('ProfileResource', '\\Thelia\\Model\\ProfileResource', RelationMap::ONE_TO_MANY, array('id' => 'profile_id', ), 'CASCADE', 'RESTRICT', 'ProfileResources');
$this->addRelation('ProfileModule', '\\Thelia\\Model\\ProfileModule', RelationMap::ONE_TO_MANY, array('id' => 'profile_id', ), 'CASCADE', 'CASCADE', 'ProfileModules');
$this->addRelation('ProfileI18n', '\\Thelia\\Model\\ProfileI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ProfileI18ns');
$this->addRelation('Resource', '\\Thelia\\Model\\Resource', RelationMap::MANY_TO_MANY, array(), 'CASCADE', 'RESTRICT', 'Resources');
} // buildRelations()
@@ -182,16 +181,15 @@ class GroupTableMap extends TableMap
);
} // getBehaviors()
/**
* Method to invalidate the instance pool of all tables related to group * by a foreign key with ON DELETE CASCADE
* Method to invalidate the instance pool of all tables related to profile * by a foreign key with ON DELETE CASCADE
*/
public static function clearRelatedInstancePool()
{
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
AdminGroupTableMap::clearInstancePool();
GroupResourceTableMap::clearInstancePool();
GroupModuleTableMap::clearInstancePool();
GroupI18nTableMap::clearInstancePool();
ProfileResourceTableMap::clearInstancePool();
ProfileModuleTableMap::clearInstancePool();
ProfileI18nTableMap::clearInstancePool();
}
/**
@@ -250,7 +248,7 @@ class GroupTableMap extends TableMap
*/
public static function getOMClass($withPrefix = true)
{
return $withPrefix ? GroupTableMap::CLASS_DEFAULT : GroupTableMap::OM_CLASS;
return $withPrefix ? ProfileTableMap::CLASS_DEFAULT : ProfileTableMap::OM_CLASS;
}
/**
@@ -264,21 +262,21 @@ class GroupTableMap extends TableMap
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return array (Group object, last column rank)
* @return array (Profile object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
$key = GroupTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = GroupTableMap::getInstanceFromPool($key))) {
$key = ProfileTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = ProfileTableMap::getInstanceFromPool($key))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj->hydrate($row, $offset, true); // rehydrate
$col = $offset + GroupTableMap::NUM_HYDRATE_COLUMNS;
$col = $offset + ProfileTableMap::NUM_HYDRATE_COLUMNS;
} else {
$cls = GroupTableMap::OM_CLASS;
$cls = ProfileTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
GroupTableMap::addInstanceToPool($obj, $key);
ProfileTableMap::addInstanceToPool($obj, $key);
}
return array($obj, $col);
@@ -301,8 +299,8 @@ class GroupTableMap extends TableMap
$cls = static::getOMClass(false);
// populate the object(s)
while ($row = $dataFetcher->fetch()) {
$key = GroupTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = GroupTableMap::getInstanceFromPool($key))) {
$key = ProfileTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = ProfileTableMap::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
@@ -311,7 +309,7 @@ class GroupTableMap extends TableMap
$obj = new $cls();
$obj->hydrate($row);
$results[] = $obj;
GroupTableMap::addInstanceToPool($obj, $key);
ProfileTableMap::addInstanceToPool($obj, $key);
} // if key exists
}
@@ -332,10 +330,10 @@ class GroupTableMap extends TableMap
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(GroupTableMap::ID);
$criteria->addSelectColumn(GroupTableMap::CODE);
$criteria->addSelectColumn(GroupTableMap::CREATED_AT);
$criteria->addSelectColumn(GroupTableMap::UPDATED_AT);
$criteria->addSelectColumn(ProfileTableMap::ID);
$criteria->addSelectColumn(ProfileTableMap::CODE);
$criteria->addSelectColumn(ProfileTableMap::CREATED_AT);
$criteria->addSelectColumn(ProfileTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.CODE');
@@ -353,7 +351,7 @@ class GroupTableMap extends TableMap
*/
public static function getTableMap()
{
return Propel::getServiceContainer()->getDatabaseMap(GroupTableMap::DATABASE_NAME)->getTable(GroupTableMap::TABLE_NAME);
return Propel::getServiceContainer()->getDatabaseMap(ProfileTableMap::DATABASE_NAME)->getTable(ProfileTableMap::TABLE_NAME);
}
/**
@@ -361,16 +359,16 @@ class GroupTableMap extends TableMap
*/
public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(GroupTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(GroupTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new GroupTableMap());
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ProfileTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(ProfileTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new ProfileTableMap());
}
}
/**
* Performs a DELETE on the database, given a Group or Criteria object OR a primary key value.
* Performs a DELETE on the database, given a Profile or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or Group object or primary key or array of primary keys
* @param mixed $values Criteria or Profile object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
@@ -381,25 +379,25 @@ class GroupTableMap extends TableMap
public static function doDelete($values, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(GroupTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProfileTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
} elseif ($values instanceof \Thelia\Model\Group) { // it's a model object
} elseif ($values instanceof \Thelia\Model\Profile) { // 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(GroupTableMap::DATABASE_NAME);
$criteria->add(GroupTableMap::ID, (array) $values, Criteria::IN);
$criteria = new Criteria(ProfileTableMap::DATABASE_NAME);
$criteria->add(ProfileTableMap::ID, (array) $values, Criteria::IN);
}
$query = GroupQuery::create()->mergeWith($criteria);
$query = ProfileQuery::create()->mergeWith($criteria);
if ($values instanceof Criteria) { GroupTableMap::clearInstancePool();
if ($values instanceof Criteria) { ProfileTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
foreach ((array) $values as $singleval) { GroupTableMap::removeInstanceFromPool($singleval);
foreach ((array) $values as $singleval) { ProfileTableMap::removeInstanceFromPool($singleval);
}
}
@@ -407,20 +405,20 @@ class GroupTableMap extends TableMap
}
/**
* Deletes all rows from the group table.
* Deletes all rows from the profile table.
*
* @param ConnectionInterface $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
*/
public static function doDeleteAll(ConnectionInterface $con = null)
{
return GroupQuery::create()->doDeleteAll($con);
return ProfileQuery::create()->doDeleteAll($con);
}
/**
* Performs an INSERT on the database, given a Group or Criteria object.
* Performs an INSERT on the database, given a Profile or Criteria object.
*
* @param mixed $criteria Criteria or Group object containing data that is used to create the INSERT statement.
* @param mixed $criteria Criteria or Profile object containing data that is used to create the INSERT statement.
* @param ConnectionInterface $con the ConnectionInterface connection to use
* @return mixed The new primary key.
* @throws PropelException Any exceptions caught during processing will be
@@ -429,22 +427,22 @@ class GroupTableMap extends TableMap
public static function doInsert($criteria, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(GroupTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProfileTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
$criteria = $criteria->buildCriteria(); // build Criteria from Group object
$criteria = $criteria->buildCriteria(); // build Criteria from Profile object
}
if ($criteria->containsKey(GroupTableMap::ID) && $criteria->keyContainsValue(GroupTableMap::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.GroupTableMap::ID.')');
if ($criteria->containsKey(ProfileTableMap::ID) && $criteria->keyContainsValue(ProfileTableMap::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ProfileTableMap::ID.')');
}
// Set the correct dbName
$query = GroupQuery::create()->mergeWith($criteria);
$query = ProfileQuery::create()->mergeWith($criteria);
try {
// use transaction because $criteria could contain info
@@ -460,7 +458,7 @@ class GroupTableMap extends TableMap
return $pk;
}
} // GroupTableMap
} // ProfileTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
GroupTableMap::buildTableMap();
ProfileTableMap::buildTableMap();

View File

@@ -150,7 +150,7 @@ class ResourceTableMap extends TableMap
$this->setUseIdGenerator(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addColumn('CODE', 'Code', 'VARCHAR', true, 30, null);
$this->addColumn('CODE', 'Code', 'VARCHAR', true, 255, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize()
@@ -160,9 +160,9 @@ class ResourceTableMap extends TableMap
*/
public function buildRelations()
{
$this->addRelation('GroupResource', '\\Thelia\\Model\\GroupResource', RelationMap::ONE_TO_MANY, array('id' => 'resource_id', ), 'CASCADE', 'RESTRICT', 'GroupResources');
$this->addRelation('ProfileResource', '\\Thelia\\Model\\ProfileResource', RelationMap::ONE_TO_MANY, array('id' => 'resource_id', ), 'CASCADE', 'RESTRICT', 'ProfileResources');
$this->addRelation('ResourceI18n', '\\Thelia\\Model\\ResourceI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ResourceI18ns');
$this->addRelation('Group', '\\Thelia\\Model\\Group', RelationMap::MANY_TO_MANY, array(), 'CASCADE', 'RESTRICT', 'Groups');
$this->addRelation('Profile', '\\Thelia\\Model\\Profile', RelationMap::MANY_TO_MANY, array(), 'CASCADE', 'RESTRICT', 'Profiles');
} // buildRelations()
/**
@@ -185,7 +185,7 @@ class ResourceTableMap extends TableMap
{
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
GroupResourceTableMap::clearInstancePool();
ProfileResourceTableMap::clearInstancePool();
ResourceI18nTableMap::clearInstancePool();
}

View File

@@ -160,7 +160,7 @@ class TaxRuleTableMap extends TableMap
*/
public function buildRelations()
{
$this->addRelation('Product', '\\Thelia\\Model\\Product', RelationMap::ONE_TO_MANY, array('id' => 'tax_rule_id', ), 'SET NULL', 'RESTRICT', 'Products');
$this->addRelation('Product', '\\Thelia\\Model\\Product', RelationMap::ONE_TO_MANY, array('id' => 'tax_rule_id', ), 'RESTRICT', 'RESTRICT', 'Products');
$this->addRelation('TaxRuleCountry', '\\Thelia\\Model\\TaxRuleCountry', RelationMap::ONE_TO_MANY, array('id' => 'tax_rule_id', ), 'CASCADE', 'RESTRICT', 'TaxRuleCountries');
$this->addRelation('TaxRuleI18n', '\\Thelia\\Model\\TaxRuleI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'TaxRuleI18ns');
} // buildRelations()
@@ -185,7 +185,6 @@ class TaxRuleTableMap extends TableMap
{
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
ProductTableMap::clearInstancePool();
TaxRuleCountryTableMap::clearInstancePool();
TaxRuleI18nTableMap::clearInstancePool();
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Thelia\Model;
use Thelia\Model\Base\Profile as BaseProfile;
use Thelia\Model\Tools\ModelEventDispatcherTrait;
class Profile extends BaseProfile
{
use ModelEventDispatcherTrait;
}

View File

@@ -0,0 +1,10 @@
<?php
namespace Thelia\Model;
use Thelia\Model\Base\ProfileI18n as BaseProfileI18n;
class ProfileI18n extends BaseProfileI18n
{
}

View File

@@ -2,11 +2,11 @@
namespace Thelia\Model;
use Thelia\Model\Base\GroupI18nQuery as BaseGroupI18nQuery;
use Thelia\Model\Base\ProfileI18nQuery as BaseProfileI18nQuery;
/**
* Skeleton subclass for performing query and update operations on the 'group_i18n' table.
* Skeleton subclass for performing query and update operations on the 'profile_i18n' table.
*
*
*
@@ -15,6 +15,7 @@ use Thelia\Model\Base\GroupI18nQuery as BaseGroupI18nQuery;
* long as it does not already exist in the output directory.
*
*/
class GroupI18nQuery extends BaseGroupI18nQuery {
class ProfileI18nQuery extends BaseProfileI18nQuery
{
} // GroupI18nQuery
} // ProfileI18nQuery

View File

@@ -0,0 +1,10 @@
<?php
namespace Thelia\Model;
use Thelia\Model\Base\ProfileModule as BaseProfileModule;
class ProfileModule extends BaseProfileModule
{
}

View File

@@ -2,11 +2,11 @@
namespace Thelia\Model;
use Thelia\Model\Base\GroupResourceQuery as BaseGroupResourceQuery;
use Thelia\Model\Base\ProfileModuleQuery as BaseProfileModuleQuery;
/**
* Skeleton subclass for performing query and update operations on the 'group_resource' table.
* Skeleton subclass for performing query and update operations on the 'profile_module' table.
*
*
*
@@ -15,6 +15,7 @@ use Thelia\Model\Base\GroupResourceQuery as BaseGroupResourceQuery;
* long as it does not already exist in the output directory.
*
*/
class GroupResourceQuery extends BaseGroupResourceQuery {
class ProfileModuleQuery extends BaseProfileModuleQuery
{
} // GroupResourceQuery
} // ProfileModuleQuery

View File

@@ -2,11 +2,11 @@
namespace Thelia\Model;
use Thelia\Model\Base\GroupQuery as BaseGroupQuery;
use Thelia\Model\Base\ProfileQuery as BaseProfileQuery;
/**
* Skeleton subclass for performing query and update operations on the 'group' table.
* Skeleton subclass for performing query and update operations on the 'profile' table.
*
*
*
@@ -15,6 +15,7 @@ use Thelia\Model\Base\GroupQuery as BaseGroupQuery;
* long as it does not already exist in the output directory.
*
*/
class GroupQuery extends BaseGroupQuery {
class ProfileQuery extends BaseProfileQuery
{
} // GroupQuery
} // ProfileQuery

View File

@@ -0,0 +1,10 @@
<?php
namespace Thelia\Model;
use Thelia\Model\Base\ProfileResource as BaseProfileResource;
class ProfileResource extends BaseProfileResource
{
}

View File

@@ -2,11 +2,11 @@
namespace Thelia\Model;
use Thelia\Model\Base\GroupModuleQuery as BaseGroupModuleQuery;
use Thelia\Model\Base\ProfileResourceQuery as BaseProfileResourceQuery;
/**
* Skeleton subclass for performing query and update operations on the 'group_module' table.
* Skeleton subclass for performing query and update operations on the 'profile_resource' table.
*
*
*
@@ -15,6 +15,7 @@ use Thelia\Model\Base\GroupModuleQuery as BaseGroupModuleQuery;
* long as it does not already exist in the output directory.
*
*/
class GroupModuleQuery extends BaseGroupModuleQuery {
class ProfileResourceQuery extends BaseProfileResourceQuery
{
} // GroupModuleQuery
} // ProfileResourceQuery

View File

@@ -1192,3 +1192,101 @@ INSERT INTO `order_status_i18n` (`id`, `locale`, `title`, `description`, `chapo`
(4, 'fr_FR', 'Envoyée', '', '', ''),
(5, 'en_US', 'Canceled', '', '', ''),
(5, 'fr_FR', 'Annulée', '', '', '');
/**
generated with command : php Thelia thelia:generate-resources --output sql
*/
INSERT INTO resource (`id`, `code`, `created_at`, `updated_at`) VALUES
(NULL, 'admin.address.view', NOW(), NOW()),
(NULL, 'admin.address.create', NOW(), NOW()),
(NULL, 'admin.address.update', NOW(), NOW()),
(NULL, 'admin.address.delete', NOW(), NOW()),
(NULL, 'admin.configuration.admin.view', NOW(), NOW()),
(NULL, 'admin.configuration.admin.create', NOW(), NOW()),
(NULL, 'admin.configuration.admin.update', NOW(), NOW()),
(NULL, 'admin.configuration.admin.delete', NOW(), NOW()),
(NULL, 'admin.configuration.area.view', NOW(), NOW()),
(NULL, 'admin.configuration.area.create', NOW(), NOW()),
(NULL, 'admin.configuration.area.update', NOW(), NOW()),
(NULL, 'admin.configuration.area.delete', NOW(), NOW()),
(NULL, 'admin.configuration.attribute.view', NOW(), NOW()),
(NULL, 'admin.configuration.attribute.create', NOW(), NOW()),
(NULL, 'admin.configuration.attribute.update', NOW(), NOW()),
(NULL, 'admin.configuration.attribute.delete', NOW(), NOW()),
(NULL, 'admin.category.view', NOW(), NOW()),
(NULL, 'admin.category.create', NOW(), NOW()),
(NULL, 'admin.category.update', NOW(), NOW()),
(NULL, 'admin.category.delete', NOW(), NOW()),
(NULL, 'admin.configuration.view', NOW(), NOW()),
(NULL, 'admin.configuration.create', NOW(), NOW()),
(NULL, 'admin.configuration.update', NOW(), NOW()),
(NULL, 'admin.configuration.delete', NOW(), NOW()),
(NULL, 'admin.content.view', NOW(), NOW()),
(NULL, 'admin.content.create', NOW(), NOW()),
(NULL, 'admin.content.update', NOW(), NOW()),
(NULL, 'admin.content.delete', NOW(), NOW()),
(NULL, 'admin.configuration.country.view', NOW(), NOW()),
(NULL, 'admin.configuration.country.create', NOW(), NOW()),
(NULL, 'admin.configuration.country.update', NOW(), NOW()),
(NULL, 'admin.configuration.country.delete', NOW(), NOW()),
(NULL, 'admin.coupon.view', NOW(), NOW()),
(NULL, 'admin.coupon.create', NOW(), NOW()),
(NULL, 'admin.coupon.update', NOW(), NOW()),
(NULL, 'admin.coupon.delete', NOW(), NOW()),
(NULL, 'admin.configuration.currency.view', NOW(), NOW()),
(NULL, 'admin.configuration.currency.create', NOW(), NOW()),
(NULL, 'admin.configuration.currency.update', NOW(), NOW()),
(NULL, 'admin.configuration.currency.delete', NOW(), NOW()),
(NULL, 'admin.customer.view', NOW(), NOW()),
(NULL, 'admin.customer.create', NOW(), NOW()),
(NULL, 'admin.customer.update', NOW(), NOW()),
(NULL, 'admin.customer.delete', NOW(), NOW()),
(NULL, 'admin.configuration.feature.view', NOW(), NOW()),
(NULL, 'admin.configuration.feature.create', NOW(), NOW()),
(NULL, 'admin.configuration.feature.update', NOW(), NOW()),
(NULL, 'admin.configuration.feature.delete', NOW(), NOW()),
(NULL, 'admin.folder.view', NOW(), NOW()),
(NULL, 'admin.folder.create', NOW(), NOW()),
(NULL, 'admin.folder.update', NOW(), NOW()),
(NULL, 'admin.folder.delete', NOW(), NOW()),
(NULL, 'admin.configuration.language.view', NOW(), NOW()),
(NULL, 'admin.configuration.language.create', NOW(), NOW()),
(NULL, 'admin.configuration.language.update', NOW(), NOW()),
(NULL, 'admin.configuration.language.delete', NOW(), NOW()),
(NULL, 'admin.configuration.mailing-system.view', NOW(), NOW()),
(NULL, 'admin.configuration.mailing-system.create', NOW(), NOW()),
(NULL, 'admin.configuration.mailing-system.update', NOW(), NOW()),
(NULL, 'admin.configuration.mailing-system.delete', NOW(), NOW()),
(NULL, 'admin.configuration.message.view', NOW(), NOW()),
(NULL, 'admin.configuration.message.create', NOW(), NOW()),
(NULL, 'admin.configuration.message.update', NOW(), NOW()),
(NULL, 'admin.configuration.message.delete', NOW(), NOW()),
(NULL, 'admin.configuration.module.view', NOW(), NOW()),
(NULL, 'admin.configuration.module.create', NOW(), NOW()),
(NULL, 'admin.configuration.module.update', NOW(), NOW()),
(NULL, 'admin.configuration.module.delete', NOW(), NOW()),
(NULL, 'admin.order.view', NOW(), NOW()),
(NULL, 'admin.order.create', NOW(), NOW()),
(NULL, 'admin.order.update', NOW(), NOW()),
(NULL, 'admin.order.delete', NOW(), NOW()),
(NULL, 'admin.product.view', NOW(), NOW()),
(NULL, 'admin.product.create', NOW(), NOW()),
(NULL, 'admin.product.update', NOW(), NOW()),
(NULL, 'admin.product.delete', NOW(), NOW()),
(NULL, 'admin.configuration.profile.view', NOW(), NOW()),
(NULL, 'admin.configuration.profile.create', NOW(), NOW()),
(NULL, 'admin.configuration.profile.update', NOW(), NOW()),
(NULL, 'admin.configuration.profile.delete', NOW(), NOW()),
(NULL, 'admin.configuration.shipping-zone.view', NOW(), NOW()),
(NULL, 'admin.configuration.shipping-zone.create', NOW(), NOW()),
(NULL, 'admin.configuration.shipping-zone.update', NOW(), NOW()),
(NULL, 'admin.configuration.shipping-zone.delete', NOW(), NOW()),
(NULL, 'admin.configuration.tax.view', NOW(), NOW()),
(NULL, 'admin.configuration.tax.create', NOW(), NOW()),
(NULL, 'admin.configuration.tax.update', NOW(), NOW()),
(NULL, 'admin.configuration.tax.delete', NOW(), NOW()),
(NULL, 'admin.configuration.template.view', NOW(), NOW()),
(NULL, 'admin.configuration.template.create', NOW(), NOW()),
(NULL, 'admin.configuration.template.update', NOW(), NOW()),
(NULL, 'admin.configuration.template.delete', NOW(), NOW());

View File

@@ -50,7 +50,7 @@ CREATE TABLE `product`
FOREIGN KEY (`tax_rule_id`)
REFERENCES `tax_rule` (`id`)
ON UPDATE RESTRICT
ON DELETE SET NULL,
ON DELETE RESTRICT,
CONSTRAINT `fk_product_template`
FOREIGN KEY (`template_id`)
REFERENCES `template` (`id`)
@@ -365,11 +365,12 @@ CREATE TABLE `product_sale_elements`
`newness` TINYINT DEFAULT 0,
`weight` FLOAT DEFAULT 0,
`is_default` TINYINT(1) DEFAULT 0,
`ean_code` VARCHAR(255),
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
UNIQUE INDEX `ref_UNIQUE` (`ref`),
INDEX `idx_product_sale_element_product_id` (`product_id`),
INDEX `ref` (`ref`),
CONSTRAINT `fk_product_sale_element_product_id`
FOREIGN KEY (`product_id`)
REFERENCES `product` (`id`)
@@ -775,6 +776,7 @@ CREATE TABLE `order_product`
`was_new` TINYINT NOT NULL,
`was_in_promo` TINYINT NOT NULL,
`weight` VARCHAR(45),
`ean_code` VARCHAR(255),
`tax_rule_title` VARCHAR(255),
`tax_rule_description` LONGTEXT,
`parent` INTEGER COMMENT 'not managed yet',
@@ -929,12 +931,12 @@ CREATE TABLE `area_delivery_module`
) ENGINE=InnoDB;
-- ---------------------------------------------------------------------
-- group
-- profile
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `group`;
DROP TABLE IF EXISTS `profile`;
CREATE TABLE `group`
CREATE TABLE `profile`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`code` VARCHAR(30) NOT NULL,
@@ -953,7 +955,7 @@ DROP TABLE IF EXISTS `resource`;
CREATE TABLE `resource`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`code` VARCHAR(30) NOT NULL,
`code` VARCHAR(255) NOT NULL,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
@@ -969,6 +971,7 @@ DROP TABLE IF EXISTS `admin`;
CREATE TABLE `admin`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`profile_id` INTEGER,
`firstname` VARCHAR(100) NOT NULL,
`lastname` VARCHAR(100) NOT NULL,
`login` VARCHAR(100) NOT NULL,
@@ -979,61 +982,39 @@ CREATE TABLE `admin`
`remember_me_serial` VARCHAR(255),
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`)
PRIMARY KEY (`id`),
INDEX `fk_admin_profile_id` (`profile_id`),
CONSTRAINT `fk_admin_profile_id`
FOREIGN KEY (`profile_id`)
REFERENCES `profile` (`id`)
ON UPDATE RESTRICT
ON DELETE RESTRICT
) ENGINE=InnoDB;
-- ---------------------------------------------------------------------
-- admin_group
-- profile_resource
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `admin_group`;
DROP TABLE IF EXISTS `profile_resource`;
CREATE TABLE `admin_group`
CREATE TABLE `profile_resource`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`group_id` INTEGER NOT NULL,
`admin_id` INTEGER NOT NULL,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`,`group_id`,`admin_id`),
INDEX `idx_admin_group_group_id` (`group_id`),
INDEX `idx_admin_group_admin_id` (`admin_id`),
CONSTRAINT `fk_admin_group_group_id`
FOREIGN KEY (`group_id`)
REFERENCES `group` (`id`)
ON UPDATE RESTRICT
ON DELETE CASCADE,
CONSTRAINT `fk_admin_group_admin_id`
FOREIGN KEY (`admin_id`)
REFERENCES `admin` (`id`)
ON UPDATE RESTRICT
ON DELETE CASCADE
) ENGINE=InnoDB;
-- ---------------------------------------------------------------------
-- group_resource
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `group_resource`;
CREATE TABLE `group_resource`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`group_id` INTEGER NOT NULL,
`profile_id` INTEGER NOT NULL,
`resource_id` INTEGER NOT NULL,
`read` TINYINT DEFAULT 0,
`write` TINYINT DEFAULT 0,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`,`group_id`,`resource_id`),
INDEX `id_group_resource_group_id` (`group_id`),
INDEX `idx_group_resource_resource_id` (`resource_id`),
CONSTRAINT `fk_group_resource_group_id`
FOREIGN KEY (`group_id`)
REFERENCES `group` (`id`)
PRIMARY KEY (`id`,`profile_id`,`resource_id`),
INDEX `id_profile_resource_profile_id` (`profile_id`),
INDEX `idx_profile_resource_resource_id` (`resource_id`),
CONSTRAINT `fk_profile_resource_profile_id`
FOREIGN KEY (`profile_id`)
REFERENCES `profile` (`id`)
ON UPDATE RESTRICT
ON DELETE CASCADE,
CONSTRAINT `fk_group_resource_resource_id`
CONSTRAINT `fk_profile_resource_resource_id`
FOREIGN KEY (`resource_id`)
REFERENCES `resource` (`id`)
ON UPDATE RESTRICT
@@ -1041,28 +1022,28 @@ CREATE TABLE `group_resource`
) ENGINE=InnoDB;
-- ---------------------------------------------------------------------
-- group_module
-- profile_module
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `group_module`;
DROP TABLE IF EXISTS `profile_module`;
CREATE TABLE `group_module`
CREATE TABLE `profile_module`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`group_id` INTEGER NOT NULL,
`profile_id` INTEGER NOT NULL,
`module_id` INTEGER,
`access` TINYINT DEFAULT 0,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
INDEX `idx_group_module_group_id` (`group_id`),
INDEX `idx_group_module_module_id` (`module_id`),
CONSTRAINT `fk_group_module_group_id`
FOREIGN KEY (`group_id`)
REFERENCES `group` (`id`)
INDEX `idx_profile_module_profile_id` (`profile_id`),
INDEX `idx_profile_module_module_id` (`module_id`),
CONSTRAINT `fk_profile_module_profile_id`
FOREIGN KEY (`profile_id`)
REFERENCES `profile` (`id`)
ON UPDATE CASCADE
ON DELETE CASCADE,
CONSTRAINT `fk_group_module_module_id`
CONSTRAINT `fk_profile_module_module_id`
FOREIGN KEY (`module_id`)
REFERENCES `module` (`id`)
ON UPDATE RESTRICT
@@ -1971,12 +1952,12 @@ CREATE TABLE `module_i18n`
) ENGINE=InnoDB;
-- ---------------------------------------------------------------------
-- group_i18n
-- profile_i18n
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `group_i18n`;
DROP TABLE IF EXISTS `profile_i18n`;
CREATE TABLE `group_i18n`
CREATE TABLE `profile_i18n`
(
`id` INTEGER NOT NULL,
`locale` VARCHAR(5) DEFAULT 'en_US' NOT NULL,
@@ -1985,9 +1966,9 @@ CREATE TABLE `group_i18n`
`chapo` TEXT,
`postscriptum` TEXT,
PRIMARY KEY (`id`,`locale`),
CONSTRAINT `group_i18n_FK_1`
CONSTRAINT `profile_i18n_FK_1`
FOREIGN KEY (`id`)
REFERENCES `group` (`id`)
REFERENCES `profile` (`id`)
ON DELETE CASCADE
) ENGINE=InnoDB;

View File

@@ -29,7 +29,7 @@
<column name="chapo" type="LONGVARCHAR" />
<column name="postscriptum" type="LONGVARCHAR" />
<column name="template_id" type="INTEGER" />
<foreign-key foreignTable="tax_rule" name="fk_product_tax_rule_id" onDelete="SET NULL" onUpdate="RESTRICT">
<foreign-key foreignTable="tax_rule" name="fk_product_tax_rule_id" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference foreign="id" local="tax_rule_id" />
</foreign-key>
<foreign-key foreignTable="template" name="fk_product_template">
@@ -284,15 +284,16 @@
<column defaultValue="0" name="newness" type="TINYINT" />
<column defaultValue="0" name="weight" type="FLOAT" />
<column defaultValue="0" name="is_default" type="BOOLEAN" />
<column name="ean_code" size="255" type="VARCHAR" />
<foreign-key foreignTable="product" name="fk_product_sale_element_product_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="product_id" />
</foreign-key>
<index name="idx_product_sale_element_product_id">
<index-column name="product_id" />
</index>
<unique name="ref_UNIQUE">
<unique-column name="ref" />
</unique>
<index name="ref">
<index-column name="ref" />
</index>
<behavior name="timestampable" />
</table>
<table isCrossRef="true" name="attribute_template" namespace="Thelia\Model">
@@ -610,6 +611,7 @@
<column name="was_new" required="true" type="TINYINT" />
<column name="was_in_promo" required="true" type="TINYINT" />
<column name="weight" size="45" type="VARCHAR" />
<column name="ean_code" size="255" type="VARCHAR" />
<column name="tax_rule_title" size="255" type="VARCHAR" />
<column name="tax_rule_description" type="CLOB" />
<column description="not managed yet" name="parent" type="INTEGER" />
@@ -721,7 +723,7 @@
</unique>
<behavior name="timestampable" />
</table>
<table name="group" namespace="Thelia\Model">
<table name="profile" namespace="Thelia\Model">
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column name="code" required="true" size="30" type="VARCHAR" />
<column name="title" size="255" type="VARCHAR" />
@@ -738,7 +740,7 @@
</table>
<table name="resource" namespace="Thelia\Model">
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column name="code" required="true" size="30" type="VARCHAR" />
<column name="code" required="true" size="255" type="VARCHAR" />
<column name="title" size="255" type="VARCHAR" />
<column name="description" type="CLOB" />
<column name="chapo" type="LONGVARCHAR" />
@@ -753,6 +755,7 @@
</table>
<table name="admin" namespace="Thelia\Model">
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column name="profile_id" type="INTEGER" />
<column name="firstname" required="true" size="100" type="VARCHAR" />
<column name="lastname" required="true" size="100" type="VARCHAR" />
<column name="login" required="true" size="100" type="VARCHAR" />
@@ -761,61 +764,49 @@
<column name="salt" size="128" type="VARCHAR" />
<column name="remember_me_token" size="255" type="VARCHAR" />
<column name="remember_me_serial" size="255" type="VARCHAR" />
<behavior name="timestampable" />
</table>
<table isCrossRef="true" name="admin_group" namespace="Thelia\Model">
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column name="group_id" primaryKey="true" required="true" type="INTEGER" />
<column name="admin_id" primaryKey="true" required="true" type="INTEGER" />
<foreign-key foreignTable="group" name="fk_admin_group_group_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="group_id" />
<foreign-key foreignTable="profile" name="fk_admin_profile_id" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference foreign="id" local="profile_id" />
</foreign-key>
<foreign-key foreignTable="admin" name="fk_admin_group_admin_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="admin_id" />
</foreign-key>
<index name="idx_admin_group_group_id">
<index-column name="group_id" />
</index>
<index name="idx_admin_group_admin_id">
<index-column name="admin_id" />
<index name="fk_admin_profile_id">
<index-column name="profile_id" />
</index>
<behavior name="timestampable" />
</table>
<table isCrossRef="true" name="group_resource" namespace="Thelia\Model">
<table isCrossRef="true" name="profile_resource" namespace="Thelia\Model">
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column name="group_id" primaryKey="true" required="true" type="INTEGER" />
<column name="profile_id" primaryKey="true" required="true" type="INTEGER" />
<column name="resource_id" primaryKey="true" required="true" type="INTEGER" />
<column defaultValue="0" name="read" type="TINYINT" />
<column defaultValue="0" name="write" type="TINYINT" />
<foreign-key foreignTable="group" name="fk_group_resource_group_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="group_id" />
<foreign-key foreignTable="profile" name="fk_profile_resource_profile_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="profile_id" />
</foreign-key>
<foreign-key foreignTable="resource" name="fk_group_resource_resource_id" onDelete="CASCADE" onUpdate="RESTRICT">
<foreign-key foreignTable="resource" name="fk_profile_resource_resource_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="resource_id" />
</foreign-key>
<index name="id_group_resource_group_id">
<index-column name="group_id" />
<index name="id_profile_resource_profile_id">
<index-column name="profile_id" />
</index>
<index name="idx_group_resource_resource_id">
<index name="idx_profile_resource_resource_id">
<index-column name="resource_id" />
</index>
<behavior name="timestampable" />
</table>
<table name="group_module" namespace="Thelia\Model">
<table name="profile_module" namespace="Thelia\Model">
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column name="group_id" required="true" type="INTEGER" />
<column name="profile_id" required="true" type="INTEGER" />
<column name="module_id" type="INTEGER" />
<column defaultValue="0" name="access" type="TINYINT" />
<foreign-key foreignTable="group" name="fk_group_module_group_id" onDelete="CASCADE" onUpdate="CASCADE">
<reference foreign="id" local="group_id" />
<foreign-key foreignTable="profile" name="fk_profile_module_profile_id" onDelete="CASCADE" onUpdate="CASCADE">
<reference foreign="id" local="profile_id" />
</foreign-key>
<foreign-key foreignTable="module" name="fk_group_module_module_id" onDelete="CASCADE" onUpdate="RESTRICT">
<foreign-key foreignTable="module" name="fk_profile_module_module_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="module_id" />
</foreign-key>
<index name="idx_group_module_group_id">
<index-column name="group_id" />
<index name="idx_profile_module_profile_id">
<index-column name="profile_id" />
</index>
<index name="idx_group_module_module_id">
<index name="idx_profile_module_module_id">
<index-column name="module_id" />
</index>
<behavior name="timestampable" />

View File

@@ -129,17 +129,17 @@
</tr>
{/loop}
{loop type="auth" name="pcc3" roles="ADMIN" permissions="admin.configuration.admin_profiles"}
{loop type="auth" name="pcc3" roles="ADMIN" permissions="admin.configuration.profiles"}
<tr>
<td><a href="{url path='/admin/configuration/admin_profiles'}">{intl l='Back-office profiles'}</a></td>
<td><a class="btn btn-default btn-xs" href="{url path='/admin/configuration/admin_profiles'}"><i class="glyphicon glyphicon-edit"></i></a></td>
<td><a href="{url path='/admin/configuration/profiles'}">{intl l='Administration profiles'}</a></td>
<td><a class="btn btn-default btn-xs" href="{url path='/admin/configuration/profiles'}"><i class="glyphicon glyphicon-edit"></i></a></td>
</tr>
{/loop}
{loop type="auth" name="pcc4" roles="ADMIN" permissions="admin.configuration.admin_users"}
<tr>
<td><a href="{url path='/admin/configuration/admin_users'}">{intl l='Back-office users'}</a></td>
<td><a class="btn btn-default btn-xs" href="{url path='/admin/configuration/admin_users'}"><i class="glyphicon glyphicon-edit"></i></a></td>
<td><a href="{url path='/admin/configuration/administrators'}">{intl l='Administrators'}</a></td>
<td><a class="btn btn-default btn-xs" href="{url path='/admin/configuration/administrators'}"><i class="glyphicon glyphicon-edit"></i></a></td>
</tr>
{/loop}

View File

@@ -0,0 +1,34 @@
{*
A generic modal creation dialog template. Parameters
dialog_id = the dialog id attribute
dialog_title = the dialog title
dialog_body = the dialog body. In most cases, this is a creation form
dialog_ok_label = The OK button label. Default OK
ok_button_id (optionnal) = the id of the OK button
*}
<div class="modal fade" id="{$dialog_id}" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>{$dialog_title nofilter}</h3>
</div>
<div class="modal-body">
{$dialog_body nofilter}
</div>
<div class="modal-footer">
<button {if ! empty($ok_button_id)}id="{$ok_button_id}"{/if} type="button" data-dismiss="modal" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {$dialog_ok_label|default:{intl l='OK'}}</button>
</div>
</div>
</div>
</div>

View File

@@ -1,126 +1,445 @@
{extends file="admin-layout.tpl"}
{block name="page-title"}{intl l='Edit profile'}{/block}
{block name="page-title"}{intl l='Edit a profile'}{/block}
{block name="check-permissions"}admin.profile.edit{/block}
{block name="check-permissions"}admin.configuration.profiles.edit{/block}
{block name="main-content"}
<div class="profile edit-profile">
<div id="wrapper" class="container">
{assign oder_tab {$smarty.get.tab|default:$smarty.post.tab|default:'data'}}
{assign asked_country {$smarty.get.country|default:{country ask="default" attr="id"}}}
<ul class="breadcrumb">
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
<li>{intl l='Editing profile "%name"' name="{$NAME}"}</li>
<div class="profiles edit-profiles">
<div id="wrapper" class="container">
<ul class="breadcrumb">
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
<li><a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a></li>
<li><a href="{url path='/admin/configuration/profiles'}">{intl l="Profiles"}</a></li>
<li>{intl l='Editing profile'}</li>
</ul>
{loop type="profile" name="profile" id=$profile_id backend_context="1" lang=$edit_language_id}
<div class="row">
<div class="col-md-12 general-block-decorator clearfix">
<div class="lead clearfix">
<span class='label label-default pull-left'>{$CODE}</span>
</div>
<ul class="nav nav-tabs clearfix">
<li {if $oder_tab == 'data'}class="active"{/if}><a href="#data" data-tab-name="cart" data-toggle="tab"><span class="glyphicon glyphicon-shopping-cart"></span> {intl l="Description"}</a></li>
<li {if $oder_tab == 'permissions'}class="active"{/if}><a href="#permissions" data-tab-name="bill" data-toggle="tab"><span class="glyphicon glyphicon-list-alt"></span> {intl l="Permissions"}</a></li>
</ul>
<div class="row">
<div class="col-md-12 general-block-decorator">
<div class="col-md-12 title title-without-tabs">
{intl l="Edit profile $NAME"}
</div>
<div class="tab-content">
<div class="tab-pane fade {if $oder_tab == 'data'}active in{/if}" id="data">
<div class="form-container">
{form name="thelia.admin.profile.modification"}
<form method="POST" action="{url path="/admin/profile/update/{$ID}"}" {form_enctype form=$form} class="clearfix">
<form method="POST" action="{url path="/admin/configuration/profiles/save"}" {form_enctype form=$form} >
{include
file = "includes/inner-form-toolbar.html"
hide_submit_buttons = false
page_url = {url path="/admin/configuration/profiles/update/$profile_id" tab=data}
close_url = {url path="/admin/configuration/profiles"}
}
{* Be sure to get the product ID, even if the form could not be validated *}
<input type="hidden" name="profile_id" value="{$ID}" />
{form_hidden_fields form=$form}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{url path="/admin/profile/update/{$ID}"}" />
<input type="hidden" name="{$name}" value="{url path="/admin/configuration/profiles"}" />
{/form_field}
{form_field form=$form field='locale'}
<input type="hidden" name="{$name}" value="{$edit_language_locale}" />
{/form_field}
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
{form_field form=$form field='firstname'}
{form_field form=$form field='title'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$FIRSTNAME}" title="{intl l="{$label}"}" placeholder="{intl l='Firstname'}">
<label for="{$label_attr.for}" class="control-label">{intl l=$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" required="required" title="{intl l='Title'}" placeholder="{intl l='Title'}" class="form-control" value="{if $error}{$value}{else}{if $IS_TRANSLATED == 1}{$TITLE}{/if}{/if}">
</div>
{/form_field}
{form_field form=$form field='lastname'}
{form_field form=$form field='chapo'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$LASTNAME}" title="{intl l="{$label}"}" placeholder="{intl l='Lastname'}">
<label for="{$label_attr.for}" class="control-label">{intl l=$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" title="{intl l='Chapo'}" placeholder="{intl l='Chapo'}" class="form-control" value="{if $error}{$value}{else}{if $IS_TRANSLATED == 1}{$CHAPO}{/if}{/if}">
</div>
{/form_field}
{form_field form=$form field='default_language'}
{form_field form=$form field='description'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<label for="{$label_attr.for}" class="control-label">
{intl l=$label} :
<span class="label-help-block">{intl l="The detailed description."}</span>
</label>
<select name="{$name}" id="{$label_attr.for}" data-toggle="selectpicker">
{loop type="lang" name="default_language" backend_context="1"}
<option value="{$ID}" {if $ID == $TITLE}selected{/if}>{$TITLE}</option>
{/loop}
</select>
<textarea name="{$name}" id="{$label_attr.for}" rows="10" class="form-control wysiwyg">{if $error}{$value}{else}{if $IS_TRANSLATED == 1}{$DESCRIPTION}{/if}{/if}</textarea>
</div>
{/form_field}
{form_field form=$form field='editing_language_default'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<select name="{$name}" id="{$label_attr.for}" data-toggle="selectpicker">
{loop type="lang" name="editing_language_default" backend_context="1"}
<option value="{$ID}" {if $ID == $TITLE}selected{/if}>{$TITLE}</option>
{/loop}
</select>
{form_field form=$form field='postscriptum'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l=$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" title="{intl l='Postscriptum'}" placeholder="{intl l='Postscriptum'}" class="form-control" value="{if $error}{$value}{else}{if $IS_TRANSLATED == 1}{$POSTSCRIPTUM}{/if}{/if}">
</div>
{/form_field}
<div class="well">
<div class="title title-without-tabs">{intl l="Change password"}</div>
{form_field form=$form field='old_password'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" title="{intl l="{$label}"}" placeholder="{intl l='Old password'}">
<div class="row">
<div class="col-md-12">
<div class="control-group">
<label>&nbsp;</label>
<div class="controls">
<p>{intl l='Profile created on %date_create. Last modification: %date_change' date_create={format_date date=$CREATE_DATE} date_change={format_date date=$UPDATE_DATE}}</p>
</div>
</div>
{/form_field}
{form_field form=$form field='password'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" title="{intl l="{$label}"}" placeholder="{intl l='Password'}">
</div>
{/form_field}
{form_field form=$form field='password_confirm'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" title="{intl l="{$label}"}" placeholder="{intl l='Password confirmation'}">
</div>
{/form_field}
</div>
<div class="text-right">
<button type="submit" class="btn btn-default btn-primary" title="{intl l='Edit profile'}">
{intl l="Edit"}
<span class="glyphicon glyphicon-ok"></span>
</button>
</div>
</div>
</form>
{/form}
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane fade {if $oder_tab == 'permissions'}active in{/if}" id="permissions">
<div class="col-md-12 title title-without-tabs">
{intl l="Manage permissions"}
</div>
{*
<div class="form-group">
<label for="" class="label-control">{intl l="Choose a country"} :</label>
<form id="country-selector-form" action="{url path="/admin/configuration/profiles/update/$profile_id"}" method="GET">
<input type="hidden" name="tab" value="taxes">
<select id="country-selector" name="country" data-toggle="selectpicker">
{loop type="country" name="country-list"}
<option value="{$ID}" {if $ID == $asked_country}selected="selected"{/if}>{$TITLE}</option>
{/loop}
</select>
</form>
</div>
<p><strong>{intl l="Countries that have the same profile"} :<strong></p>
<p class="lead js-collapse" id="same_countries" data-collapse-height="86">
{$matchedCountries.first=$asked_country}
{loop type="profile-country" name="same-country-list" profile=$ID ask="countries" country=$asked_country}
{$matchedCountries[]=$COUNTRY}
<span class="label label-info">{$COUNTRY_TITLE}</span>
{/loop}
{elseloop rel="same-country-list"}
<span class="label label-danger">{intl l="NONE"}</span>
{/elseloop}
</p>
<button data-collapse-block="same_countries" type="button" class="btn btn-info btn-sm btn-block js-collapse-btn" style="margin-bottom: 15px">See all countries</button>
<div class="row">
<div class="col-md-6">
<div id="panel" class="panel panel-default place">
<div class="panel-heading">
<h3 class="panel-title">{intl l="Manage the profile taxes appliance order"}</h3>
</div>
<div class="panel-body">
{assign lastPosition 0}
{loop type="profile-country" name="existing-tax-list" profile=$ID country=$asked_country}
{if $POSITION != $lastPosition}
{assign lastPosition $POSITION}
{if $LOOP_COUNT > 1}
</div>
{/if}
<div class="drop-group droppable add-to-group">
<p class="drop-message">
<span class="glyphicon glyphicon-plus"></span>
<span class="message">{intl l="Add tax to this group"}</span>
</p>
{/if}
<div class="drag" data-id="{$TAX}">{$TAX_TITLE}</div>
{if $LOOP_COUNT == $LOOP_TOTAL}
</div>
{/if}
{/loop}
{elseloop rel="existing-tax-list"}
<div class="drop-group droppable add-to-group">
<p class="drop-message">
<span class="glyphicon glyphicon-plus"></span>
<span class="message">{intl l="Add tax to this group"}</span>
</p>
</div>
{/elseloop}
</div>
<div class="panel-footer droppable create-group">
<p class="drop-message">
<span class="glyphicon glyphicon-plus"></span>
<span class="message">{intl l="Drop tax here to create a tax group"}</span>
</p>
</div>
</div>
<a href="#tax_list_update_dialog" data-toggle="modal" id="apply-taxes-rules" class="btn btn-default btn-primary btn-block"><span class="glyphicon glyphicon-check"></span> {intl l="Apply"}</a>
</div>
<div class="col-md-6">
<div id="panel-list" class="panel panel-default take">
<div class="panel-heading">
<h3 class="panel-title">Available taxes</h3>
</div>
<div class="panel-body">
{loop type="tax" name="tax-list" exclude_profile=$ID country=$asked_country}
<div class="draggable" data-id="{$ID}">{$TITLE}</div>
{/loop}
</div>
<div class="panel-footer droppable remove-from-group">
<p class="drop-message">
<span class="glyphicon glyphicon-minus"></span>
<span class="message">{intl l="Drop tax here to delete from group"}</span>
</p>
</div>
</div>
</div>
*}
</div>
</div>
</div>
</div>
{/loop}
</div>
</div>
{* Confirmation dialog *}
{*form name="thelia.admin.profile.taxlistupdate"}
{if $form_error_message}
{$taxUpdateError = true}
{else}
{$taxUpdateError = false}
{/if}
{* Capture the dialog body, to pass it to the generic dialog *}
{*capture "tax_list_update_dialog"}
<input type="hidden" name="profile_id" value="{$profile_id}">
<input type="hidden" name="tab" value="taxes">
{form_hidden_fields form=$form}
{form_field form=$form field='country_list'}
<p>{intl l="Profile taxes will be update for the following countries :"}</p>
<div class="form-group">
<div class="input-group">
<select id="countries-select" class="" name="{$name}" data-toggle="selectpicker" multiple>
{loop type="country" name="country-list"}
<option value='{$ID}' {if (!$value AND in_array($ID, $matchedCountries)) OR ($value AND in_array($ID, $value))}selected="selected"{/if}>{$TITLE}</option>
{/loop}
</select>
<span class="input-group-btn">
<button class="btn btn-primary js-uncheck-all" data-uncheck-select="countries-select">{intl l="uncheck all"}</button>
</span>
</div>
</div>
{/form_field}
{/capture}
{include
file = "includes/generic-create-dialog.html"
dialog_id = "tax_list_update_dialog"
dialog_title = {intl l="Update profile taxes"}
dialog_body = {$smarty.capture.tax_list_update_dialog nofilter}
dialog_ok_label = {intl l="Edit profile taxes"}
dialog_cancel_label = {intl l="Cancel"}
form_action = {url path="/admin/configuration/profiles/saveTaxes"}
form_enctype = {form_enctype form=$form}
form_error_message = $form_error_message
}
{/form*}
{/block}
{block name="javascript-initialization"}
{javascripts file='assets/js/bootstrap-select/bootstrap-select.js'}
<script src="{$asset_url}"></script>
{/javascripts}
{javascripts file='assets/js/main.js'}
<script src="{$asset_url}"></script>
<script src='{$asset_url}'></script>
{/javascripts}
{javascripts file='assets/js/main.js'}
<script src='{$asset_url}'></script>
{/javascripts}
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script>
$(function() {
{if $taxUpdateError == true}
$('#tax_list_update_dialog').modal();
{/if}
$('.js-collapse').each(function(k, v) {
var h = $(v).data('collapse-height');
if( $(v).height() > h ) {
$(v).css('overflow', 'hidden').css('height', h + 'px');
} else {
$('[data-collapse-block=' + $(v).attr('id') + ']').hide();
}
});
$('.js-collapse-btn').click(function(e) {
e.preventDefault();
var block = $(this).data('collapseBlock');
$('#' + block).css('overflow', 'initial').css('height', 'initial');
$(this).unbind().remove();
});
$('.js-uncheck-all').click(function(e) {
e.preventDefault();
var selectId = $(this).data('uncheckSelect');
$('#' + selectId).selectpicker('deselectAll');
});
{literal}
$('#country-selector').change(function(e) {
$('#country-selector-form').submit();
});
// Cache jQuery Objects
var $group = $('#panel');
var $list = $('#panel-list');
// Build array of taxes rules
$('#apply-taxes-rules').click(function(){
var taxesRules = [],
index;
$('.drop-group', $group).each(function(i){
var $this = $(this);
index = i;
taxesRules[index] = [];
$('.drag', $this).each(function(j){
taxesRules[index][j] = [];
taxesRules[index][j] = $(this).data('id'); // retrieve with data
});
});
$('#tax_list').val(JSON.stringify(taxesRules));
});
// Default options for draggable
var dragOptions = {
cursor: 'move',
containment: "document",
opacity: 0.5,
revert: "invalid", // when not dropped, the item will revert back to its initial position
zIndex: 10
};
// Default options for sortabble
var sortOptions = {
cursor: 'move',
cancel: '.drop-message',
update: function( event, ui ){
// Check if we have an empty group
var $zone = $('.add-to-group', $group);
if($zone.size() > 1 && $(this).find('> div').size() == 0){ // Remove empty group only if we have more than 1 group
$(this).slideUp(function(){ $(this).remove(); });
}
}
};
// Default options for droppable
var dropOptions = {
accept: "#panel-list .draggable", // Controls which draggable elements are accepted
hoverClass: "over",
drop: function( event, ui ) {
var $drop = $(this);
if($(this).hasClass('create-group')){
// Check if we have already an empty group
var $empty_group = $group.find('.drop-group:not(:has(> div))');
if($empty_group.size() > 0){ // if yes (Use the first empty group)
$drop = $empty_group.filter(':first');
}else{ //if no (Create a new group)
$drop = $group.find('.drop-group:last-child').clone().appendTo($group.find('.panel-body'));
// Remove taxes
$drop.find('> div').remove();
// Make the new group droppable
$drop
.droppable(dropOptions)
.sortable(sortOptions);
}
}
$("<div></div>").addClass('drag').attr('data-id', ui.draggable.data('id')).text( ui.draggable.text()).appendTo( $drop );
ui.draggable.remove();
}
};
// Make the list of taxes draggable
$('.draggable', $list).draggable(dragOptions);
// let the drop-group be droppable & sortable, accepting the tax items
$('.droppable', $group)
.droppable(dropOptions)
.sortable(sortOptions);
$('.place .panel-body').sortable(sortOptions);
// let the gallery be droppable as well, accepting items from the trash
$('.remove-from-group', $list)
.droppable({
accept: "#panel .drag",
hoverClass: 'over',
drop: function( event, ui ) {
$("<div></div>").addClass('draggable').text( ui.draggable.text() ).attr('data-id', ui.draggable.data('id')).draggable(dragOptions).appendTo( $list.find('.panel-body') );
ui.draggable.remove();
}
});
{/literal}
});
</script>
{/block}

View File

@@ -0,0 +1,210 @@
{extends file="admin-layout.tpl"}
{block name="page-title"}{intl l='Taxes rules'}{/block}
{block name="check-permissions"}admin.profile.view{/block}
{block name="main-content"}
<div>
<div id="wrapper" class="container">
<div class="clearfix">
<ul class="breadcrumb">
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
<li><a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a></li>
<li><a href="{url path='/admin/configuration/profiles'}">{intl l="Profiles"}</a></li>
</ul>
</div>
{module_include location='profiles_top'}
<div class="row">
<div class="col-md-12">
<div class="general-block-decorator">
<div class="table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<caption class="clearfix">
{intl l="Taxes"}
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.profile.create"}
<a class="btn btn-default btn-primary pull-right" title="{intl l='Create a new profile'}" href="#profile_create_dialog" data-toggle="modal">
<span class="glyphicon glyphicon-plus"></span>
</a>
{/loop}
</caption>
<thead>
<tr>
<th class="col-md-3">{intl l="Name"}</th>
<th class="col-md-5">{intl l="Description"}</th>
<th class="col-md-1">{intl l="Actions"}</th>
</tr>
</thead>
<tbody>
{loop type="profile" name="profiles" backend_context="1"}
<tr>
<td>{$TITLE}</td>
<td>{$DESCRIPTION}</td>
<td>
<div class="btn-group">
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.profile.change"}
<a class="btn btn-default btn-xs" title="{intl l='Change this profile'}" href="{url path="/admin/configuration/profiles/update/$ID"}"><span class="glyphicon glyphicon-edit"></span></a>
{/loop}
{assign linkedAdminCount {count name="linked-admin" type="admin" profile=$ID}}
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.profile.change"}
<a class="btn btn-default btn-xs js-delete-profile" title="{intl l='Delete this profile'}" href="#{if $linkedAdminCount > 0}profile_cannot_delete_dialog{else}profile_delete_dialog{/if}" data-id="{$ID}" data-toggle="modal"><span class="glyphicon glyphicon-trash"></span></a>
{/loop}
</div>
</td>
</tr>
{/loop}
</tbody>
</table>
</div>
</div>
</div>
</div>
{module_include location='profiles_bottom'}
</div>
</div>
{* -- Add profile confirmation dialog ----------------------------------- *}
{form name="thelia.admin.profile.add"}
{if $form_error_message}
{$profileCreateError = true}
{else}
{$profileCreateError = false}
{/if}
{* Capture the dialog body, to pass it to the generic dialog *}
{capture "profile_create_dialog"}
{form_hidden_fields form=$form}
{form_field form=$form field='locale'}
<input type="hidden" name="{$name}" value="{$edit_language_locale}" />
{/form_field}
{form_field form=$form field='code'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l=$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" required="required" title="{intl l='Profile code'}" placeholder="{intl l='Profile code'}" class="form-control" value="{if $form_error}{$value}{/if}">
</div>
{/form_field}
{form_field form=$form field='title'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l=$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" required="required" title="{intl l='Title'}" placeholder="{intl l='Title'}" class="form-control" value="{if $form_error}{$value}{/if}">
</div>
{/form_field}
{form_field form=$form field='chapo'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l=$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" title="{intl l='Short description'}" placeholder="{intl l='Short description'}" class="form-control" value="{if $form_error}{$value}{/if}">
</div>
{/form_field}
{form_field form=$form field='description'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
{intl l=$label} :
<span class="label-help-block">{intl l="The detailed description."}</span>
</label>
<textarea name="{$name}" id="{$label_attr.for}" rows="10" class="form-control wysiwyg">{if $form_error}{$value}{/if}</textarea>
</div>
{/form_field}
{form_field form=$form field='postscriptum'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l=$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" title="{intl l='Postscriptum'}" placeholder="{intl l='Postscriptum'}" class="form-control" value="{if $form_error}{$value}{/if}">
</div>
{/form_field}
{/capture}
{include
file = "includes/generic-create-dialog.html"
dialog_id = "profile_create_dialog"
dialog_title = {intl l="Create a new profile"}
dialog_body = {$smarty.capture.profile_create_dialog nofilter}
dialog_ok_label = {intl l="Create"}
dialog_cancel_label = {intl l="Cancel"}
form_action = {url path="/admin/configuration/profiles/add"}
form_enctype = {form_enctype form=$form}
form_error_message = $form_error_message
}
{/form}
{* -- Delete profile confirmation dialog ----------------------------------- *}
{capture "profile_delete_dialog"}
<input type="hidden" name="profile_id" id="profile_delete_id" value="" />
{module_include location='profile_delete_form'}
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "profile_delete_dialog"
dialog_title = {intl l="Delete profile"}
dialog_message = {intl l="Do you really want to delete this profile ?"}
form_action = {url path='/admin/configuration/profiles/delete'}
form_content = {$smarty.capture.profile_delete_dialog nofilter}
}
{include
file = "includes/generic-warning-dialog.html"
dialog_id = "profile_cannot_delete_dialog"
dialog_title = {intl l="You can't delete this profile"}
dialog_body = {intl l="They are some administrator which are linked to this profile. Please edit/remove them before deleting this profile."}
}
{/block}
{block name="javascript-initialization"}
{javascripts file='assets/js/bootstrap-select/bootstrap-select.js'}
<script src='{$asset_url}'></script>
{/javascripts}
{javascripts file='assets/js/main.js'}
<script src='{$asset_url}'></script>
{/javascripts}
<script type="text/javascript">
jQuery(function($) {
{if $profileCreateError == true}
$('#profile_create_dialog').modal();
{/if}
$(".js-delete-profile").click(function(e){
$('#profile_delete_id').val($(this).data('id'))
});
})
</script>
{/block}

View File

@@ -127,6 +127,8 @@
</div>
</div>
{/block}
{block name="javascript-initialization"}

View File

@@ -9,7 +9,7 @@
{assign oder_tab {$smarty.get.tab|default:$smarty.post.tab|default:'data'}}
{assign asked_country {$smarty.get.country|default:{country ask="default" attr="id"}}}
<div class="taxes-rules edit-taxes-rules">
<div class="taxes-rules edit-taxes-rules">
<div id="wrapper" class="container">
@@ -208,11 +208,10 @@
</div>
</div>
{/loop}
</div>
{/loop}
</div>
</div>
{* Confirmation dialog *}
{form name="thelia.admin.taxrule.taxlistupdate"}

View File

@@ -282,7 +282,7 @@ form_content = {$smarty.capture.tax_delete_dialog nofilter}
{form_field form=$form field='title'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l=$label} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" required="required" title="{intl l='Title'}" placeholder="{intl l='Title'}" class="form-control" value="{if $error}{$value}{else}{if $IS_TRANSLATED == 1}{$TITLE}{/if}{/if}">
<input type="text" id="{$label_attr.for}" name="{$name}" required="required" title="{intl l='Title'}" placeholder="{intl l='Title'}" class="form-control" value="{if $error}{$value}{/if}">
</div>
{/form_field}
@@ -293,7 +293,7 @@ form_content = {$smarty.capture.tax_delete_dialog nofilter}
<span class="label-help-block">{intl l="The detailed description."}</span>
</label>
<textarea name="{$name}" id="{$label_attr.for}" rows="10" class="form-control wysiwyg">{if $error}{$value}{else}{if $IS_TRANSLATED == 1}{$DESCRIPTION}{/if}{/if}</textarea>
<textarea name="{$name}" id="{$label_attr.for}" rows="10" class="form-control wysiwyg">{if $error}{$value}{/if}</textarea>
</div>
{/form_field}