Symfony - Orocommerce: missing FROM-clause entry for table “t0”
up vote
0
down vote
favorite
I'm trying to custom the "updateAction" customer of symfony - orocommerce, and after trying a lot, it throw this error message in log file:
Uncaught PHP Exception DoctrineDBALExceptionTableNotFoundException:
"An exception occurred while executing:
'SELECT t1.serialized_data AS
serialized_data_2, t1.id AS id_3, t1.confirmed AS confirmed_4,
t1.email AS email_5, t1.email_lowercase AS email_lowercase_6,
t1.name_prefix AS name_prefix_7, t1.first_name AS first_name_8,
t1.middle_name AS middle_name_9, t1.last_name AS last_name_10,
t1.name_suffix AS name_suffix_11, t1.birthday AS birthday_12,
t1.created_at AS created_at_13, t1.updated_at AS updated_at_14,
t1.enabled AS enabled_15, t1.login_count AS login_count_16,
t1.username AS username_17, t1.is_guest AS is_guest_18, t1.password AS
password_19, t1.salt AS salt_20, t1.last_login AS last_login_21,
t1.confirmation_token AS confirmation_token_22, t1.password_requested
AS password_requested_23, t1.password_changed AS password_changed_24,
t1.pharmacy_name AS pharmacy_name_25, t1.pharmacy_address AS
pharmacy_address_26, t1.pbs_approval_number AS pbs_approval_number_27,
t1.business_name AS business_name_28, t1.australian_business_number AS
australian_business_number_29, t1.business_phone_number AS
business_phone_number_30, t1.fax_number AS fax_number_31,
t1.pharmacy_owner_full_name AS pharmacy_owner_full_name_32,
t1.ahpra_no AS ahpra_no_33, t1.group_name AS group_name_34,
t1.group_contact_name AS group_contact_name_35, t1.group_contact_email
AS group_contact_email_36, t1.group_contact_phone_number AS
group_contact_phone_number_37, t1.customer_id AS customer_id_38,
t1.owner_id AS owner_id_39, t1.website_id AS website_id_40,
t1.organization_id AS organization_id_41 FROM oro_customer_user t1
WHERE t0.id = ?' with params ["94"]:
SQLSTATE[42P01]: Undefined
table: 7 ERROR: missing FROM-clause entry for table "t0" LINE 1:
...rganization_id_41 FROM oro_customer_user t1 WHERE t0.id = '9
Which can be short write like this:
SELECT * FROM oro_customer_user t1 WHERE t0.id = 94
After searching about this, seem like i've not extends the entity the right way, so may i know how to do this?
Here is my code:
MyCodeBundleCustomerBundleControllerCustomerUserController
<?php
namespace MyCodeBundleCustomerBundleController;
use OroBundleCustomerBundleEntityCustomerUser;
use MyCodeBundleCustomerBundleEntityCustomerUser as MyCodeCustomerUser;
use OroBundleCustomerBundleFormHandlerCustomerUserHandler;
use OroBundleCustomerBundleFormTypeCustomerUserType;
use MyCodeBundleCustomerBundleFormTypeCustomerUserType as MyCodeCustomerUserType;
use OroBundleEntityBundleORMDoctrineHelper;
use OroBundleSecurityBundleAnnotationAcl;
use OroBundleSecurityBundleAnnotationAclAncestor;
use SensioBundleFrameworkExtraBundleConfigurationTemplate;
use SymfonyBundleFrameworkBundleControllerController;
use SymfonyComponentFormFormError;
use SymfonyComponentHttpFoundationRedirectResponse;
use SymfonyComponentHttpFoundationRequest;
use SymfonyComponentRoutingAnnotationRoute;
use OroBundleCustomerBundleControllerCustomerUserController as OroCustomerUserController;
use DoctrineORMEntityManager;
use PsrLogLoggerInterface;
class CustomerUserController extends Controller
{
/**
* Edit customer user form
*
* @Route("/update/{id}", name="oro_customer_customer_user_update", requirements={"id"="d+"})
* @Template
* @Acl(
* id="oro_customer_customer_user_update",
* type="entity",
* class="MyCodeCustomerBundle:CustomerUser",
* permission="EDIT"
* )
* @param MyCodeCustomerUser $customerUser
* @param Request $request
* @return array|RedirectResponse
*/
public function updateAction(MyCodeCustomerUser $customerUser, Request $request)
{
die('1');
return $this->MyCodeUpdate($customerUser, $request);
}
/**
* @param MyCodeCustomerUser $customerUser
* @param Request $request
* @return array|RedirectResponse
*/
protected function MyCodeUpdate(MyCodeCustomerUser $customerUser, Request $request)
{
$form = $this->createForm(MyCodeCustomerUserType::class, $customerUser);
$handler = new CustomerUserHandler(
$form,
$request,
$this->get('oro_customer_user.manager'),
$this->get('oro_security.token_accessor'),
$this->get('translator'),
$this->get('logger')
);
$result = $this->get('oro_form.model.update_handler')->handleUpdate(
$customerUser,
$form,
function (MyCodeCustomerUser $customerUser) {
return [
'route' => 'mycode_customer_customer_user_update',
'parameters' => ['id' => $customerUser->getId()]
];
},
function (MyCodeCustomerUser $customerUser) {
return [
'route' => 'oro_customer_customer_user_view',
'parameters' => ['id' => $customerUser->getId()]
];
},
$this->get('translator')->trans('oro.customer.controller.customeruser.saved.message'),
$handler
);
return $result;
}
MyCodeBundleCustomerBundleEntityCustomerUser
<?php
namespace MyCodeBundleCustomerBundleEntity;
use DoctrineCommonCollectionsArrayCollection;
use DoctrineCommonCollectionsCollection;
use DoctrineORMEventPreUpdateEventArgs;
use DoctrineORMMapping as ORM;
use OroBundleCustomerBundleModelExtendCustomerUser;
use OroBundleEmailBundleModelEmailHolderInterface;
use OroBundleEntityConfigBundleMetadataAnnotationConfig;
use OroBundleEntityConfigBundleMetadataAnnotationConfigField;
use OroBundleLocaleBundleModelFullNameInterface;
use OroBundleOrganizationBundleEntityOrganization;
use OroBundleUserBundleEntityAbstractUser;
use OroBundleUserBundleEntityUser;
use OroBundleUserBundleSecurityAdvancedApiUserInterface;
use OroBundleWebsiteBundleEntityWebsite;
use OroBundleCustomerBundleEntityCustomerUser as OroCustomerUser;
/**
* The entity that represents a person who acts on behalf of the company
* to buy products using OroCommerce store frontend.
*
* @ORMEntity()
* @ORMTable(name="oro_customer_user")
*/
class CustomerUser extends OroCustomerUser
{
/**
* @ORMColumn(name="pharmacy_name", type="string", nullable=true)
*/
private $pharmacy_name;
/**
* @ORMColumn(name="pharmacy_address", type="string", nullable=true)
*/
private $pharmacy_address;
/**
* @ORMColumn(name="pbs_approval_number", type="string", nullable=true)
*/
private $pbs_approval_number;
/**
* @ORMColumn(name="business_name", type="string", nullable=true)
*/
private $business_name;
/**
* @ORMColumn(name="australian_business_number", type="string", nullable=true)
*/
private $australian_business_number;
/**
* @ORMColumn(name="business_phone_number", type="string", nullable=true)
*/
private $business_phone_number;
/**
* @ORMColumn(name="fax_number", type="string", nullable=true)
*/
private $fax_number;
/**
* @ORMColumn(name="pharmacy_owner_full_name", type="string", nullable=true)
*/
private $pharmacy_owner_full_name;
/**
* @ORMColumn(name="ahpra_no", type="string", nullable=true)
*/
private $ahpra_no;
/**
* @ORMColumn(name="group_name", type="string", nullable=true)
*/
private $group_name;
/**
* @ORMColumn(name="group_contact_name", type="string", nullable=true)
*/
private $group_contact_name;
/**
* @ORMColumn(name="group_contact_email", type="string", nullable=true)
*/
private $group_contact_email;
/**
* @ORMColumn(name="group_contact_phone_number", type="string", nullable=true)
*/
private $group_contact_phone_number;
/**
* {@inheritdoc}
*/
public function __construct()
{
parent::__construct();
}
Please help, thanks.
php symfony orocommerce
add a comment |
up vote
0
down vote
favorite
I'm trying to custom the "updateAction" customer of symfony - orocommerce, and after trying a lot, it throw this error message in log file:
Uncaught PHP Exception DoctrineDBALExceptionTableNotFoundException:
"An exception occurred while executing:
'SELECT t1.serialized_data AS
serialized_data_2, t1.id AS id_3, t1.confirmed AS confirmed_4,
t1.email AS email_5, t1.email_lowercase AS email_lowercase_6,
t1.name_prefix AS name_prefix_7, t1.first_name AS first_name_8,
t1.middle_name AS middle_name_9, t1.last_name AS last_name_10,
t1.name_suffix AS name_suffix_11, t1.birthday AS birthday_12,
t1.created_at AS created_at_13, t1.updated_at AS updated_at_14,
t1.enabled AS enabled_15, t1.login_count AS login_count_16,
t1.username AS username_17, t1.is_guest AS is_guest_18, t1.password AS
password_19, t1.salt AS salt_20, t1.last_login AS last_login_21,
t1.confirmation_token AS confirmation_token_22, t1.password_requested
AS password_requested_23, t1.password_changed AS password_changed_24,
t1.pharmacy_name AS pharmacy_name_25, t1.pharmacy_address AS
pharmacy_address_26, t1.pbs_approval_number AS pbs_approval_number_27,
t1.business_name AS business_name_28, t1.australian_business_number AS
australian_business_number_29, t1.business_phone_number AS
business_phone_number_30, t1.fax_number AS fax_number_31,
t1.pharmacy_owner_full_name AS pharmacy_owner_full_name_32,
t1.ahpra_no AS ahpra_no_33, t1.group_name AS group_name_34,
t1.group_contact_name AS group_contact_name_35, t1.group_contact_email
AS group_contact_email_36, t1.group_contact_phone_number AS
group_contact_phone_number_37, t1.customer_id AS customer_id_38,
t1.owner_id AS owner_id_39, t1.website_id AS website_id_40,
t1.organization_id AS organization_id_41 FROM oro_customer_user t1
WHERE t0.id = ?' with params ["94"]:
SQLSTATE[42P01]: Undefined
table: 7 ERROR: missing FROM-clause entry for table "t0" LINE 1:
...rganization_id_41 FROM oro_customer_user t1 WHERE t0.id = '9
Which can be short write like this:
SELECT * FROM oro_customer_user t1 WHERE t0.id = 94
After searching about this, seem like i've not extends the entity the right way, so may i know how to do this?
Here is my code:
MyCodeBundleCustomerBundleControllerCustomerUserController
<?php
namespace MyCodeBundleCustomerBundleController;
use OroBundleCustomerBundleEntityCustomerUser;
use MyCodeBundleCustomerBundleEntityCustomerUser as MyCodeCustomerUser;
use OroBundleCustomerBundleFormHandlerCustomerUserHandler;
use OroBundleCustomerBundleFormTypeCustomerUserType;
use MyCodeBundleCustomerBundleFormTypeCustomerUserType as MyCodeCustomerUserType;
use OroBundleEntityBundleORMDoctrineHelper;
use OroBundleSecurityBundleAnnotationAcl;
use OroBundleSecurityBundleAnnotationAclAncestor;
use SensioBundleFrameworkExtraBundleConfigurationTemplate;
use SymfonyBundleFrameworkBundleControllerController;
use SymfonyComponentFormFormError;
use SymfonyComponentHttpFoundationRedirectResponse;
use SymfonyComponentHttpFoundationRequest;
use SymfonyComponentRoutingAnnotationRoute;
use OroBundleCustomerBundleControllerCustomerUserController as OroCustomerUserController;
use DoctrineORMEntityManager;
use PsrLogLoggerInterface;
class CustomerUserController extends Controller
{
/**
* Edit customer user form
*
* @Route("/update/{id}", name="oro_customer_customer_user_update", requirements={"id"="d+"})
* @Template
* @Acl(
* id="oro_customer_customer_user_update",
* type="entity",
* class="MyCodeCustomerBundle:CustomerUser",
* permission="EDIT"
* )
* @param MyCodeCustomerUser $customerUser
* @param Request $request
* @return array|RedirectResponse
*/
public function updateAction(MyCodeCustomerUser $customerUser, Request $request)
{
die('1');
return $this->MyCodeUpdate($customerUser, $request);
}
/**
* @param MyCodeCustomerUser $customerUser
* @param Request $request
* @return array|RedirectResponse
*/
protected function MyCodeUpdate(MyCodeCustomerUser $customerUser, Request $request)
{
$form = $this->createForm(MyCodeCustomerUserType::class, $customerUser);
$handler = new CustomerUserHandler(
$form,
$request,
$this->get('oro_customer_user.manager'),
$this->get('oro_security.token_accessor'),
$this->get('translator'),
$this->get('logger')
);
$result = $this->get('oro_form.model.update_handler')->handleUpdate(
$customerUser,
$form,
function (MyCodeCustomerUser $customerUser) {
return [
'route' => 'mycode_customer_customer_user_update',
'parameters' => ['id' => $customerUser->getId()]
];
},
function (MyCodeCustomerUser $customerUser) {
return [
'route' => 'oro_customer_customer_user_view',
'parameters' => ['id' => $customerUser->getId()]
];
},
$this->get('translator')->trans('oro.customer.controller.customeruser.saved.message'),
$handler
);
return $result;
}
MyCodeBundleCustomerBundleEntityCustomerUser
<?php
namespace MyCodeBundleCustomerBundleEntity;
use DoctrineCommonCollectionsArrayCollection;
use DoctrineCommonCollectionsCollection;
use DoctrineORMEventPreUpdateEventArgs;
use DoctrineORMMapping as ORM;
use OroBundleCustomerBundleModelExtendCustomerUser;
use OroBundleEmailBundleModelEmailHolderInterface;
use OroBundleEntityConfigBundleMetadataAnnotationConfig;
use OroBundleEntityConfigBundleMetadataAnnotationConfigField;
use OroBundleLocaleBundleModelFullNameInterface;
use OroBundleOrganizationBundleEntityOrganization;
use OroBundleUserBundleEntityAbstractUser;
use OroBundleUserBundleEntityUser;
use OroBundleUserBundleSecurityAdvancedApiUserInterface;
use OroBundleWebsiteBundleEntityWebsite;
use OroBundleCustomerBundleEntityCustomerUser as OroCustomerUser;
/**
* The entity that represents a person who acts on behalf of the company
* to buy products using OroCommerce store frontend.
*
* @ORMEntity()
* @ORMTable(name="oro_customer_user")
*/
class CustomerUser extends OroCustomerUser
{
/**
* @ORMColumn(name="pharmacy_name", type="string", nullable=true)
*/
private $pharmacy_name;
/**
* @ORMColumn(name="pharmacy_address", type="string", nullable=true)
*/
private $pharmacy_address;
/**
* @ORMColumn(name="pbs_approval_number", type="string", nullable=true)
*/
private $pbs_approval_number;
/**
* @ORMColumn(name="business_name", type="string", nullable=true)
*/
private $business_name;
/**
* @ORMColumn(name="australian_business_number", type="string", nullable=true)
*/
private $australian_business_number;
/**
* @ORMColumn(name="business_phone_number", type="string", nullable=true)
*/
private $business_phone_number;
/**
* @ORMColumn(name="fax_number", type="string", nullable=true)
*/
private $fax_number;
/**
* @ORMColumn(name="pharmacy_owner_full_name", type="string", nullable=true)
*/
private $pharmacy_owner_full_name;
/**
* @ORMColumn(name="ahpra_no", type="string", nullable=true)
*/
private $ahpra_no;
/**
* @ORMColumn(name="group_name", type="string", nullable=true)
*/
private $group_name;
/**
* @ORMColumn(name="group_contact_name", type="string", nullable=true)
*/
private $group_contact_name;
/**
* @ORMColumn(name="group_contact_email", type="string", nullable=true)
*/
private $group_contact_email;
/**
* @ORMColumn(name="group_contact_phone_number", type="string", nullable=true)
*/
private $group_contact_phone_number;
/**
* {@inheritdoc}
*/
public function __construct()
{
parent::__construct();
}
Please help, thanks.
php symfony orocommerce
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm trying to custom the "updateAction" customer of symfony - orocommerce, and after trying a lot, it throw this error message in log file:
Uncaught PHP Exception DoctrineDBALExceptionTableNotFoundException:
"An exception occurred while executing:
'SELECT t1.serialized_data AS
serialized_data_2, t1.id AS id_3, t1.confirmed AS confirmed_4,
t1.email AS email_5, t1.email_lowercase AS email_lowercase_6,
t1.name_prefix AS name_prefix_7, t1.first_name AS first_name_8,
t1.middle_name AS middle_name_9, t1.last_name AS last_name_10,
t1.name_suffix AS name_suffix_11, t1.birthday AS birthday_12,
t1.created_at AS created_at_13, t1.updated_at AS updated_at_14,
t1.enabled AS enabled_15, t1.login_count AS login_count_16,
t1.username AS username_17, t1.is_guest AS is_guest_18, t1.password AS
password_19, t1.salt AS salt_20, t1.last_login AS last_login_21,
t1.confirmation_token AS confirmation_token_22, t1.password_requested
AS password_requested_23, t1.password_changed AS password_changed_24,
t1.pharmacy_name AS pharmacy_name_25, t1.pharmacy_address AS
pharmacy_address_26, t1.pbs_approval_number AS pbs_approval_number_27,
t1.business_name AS business_name_28, t1.australian_business_number AS
australian_business_number_29, t1.business_phone_number AS
business_phone_number_30, t1.fax_number AS fax_number_31,
t1.pharmacy_owner_full_name AS pharmacy_owner_full_name_32,
t1.ahpra_no AS ahpra_no_33, t1.group_name AS group_name_34,
t1.group_contact_name AS group_contact_name_35, t1.group_contact_email
AS group_contact_email_36, t1.group_contact_phone_number AS
group_contact_phone_number_37, t1.customer_id AS customer_id_38,
t1.owner_id AS owner_id_39, t1.website_id AS website_id_40,
t1.organization_id AS organization_id_41 FROM oro_customer_user t1
WHERE t0.id = ?' with params ["94"]:
SQLSTATE[42P01]: Undefined
table: 7 ERROR: missing FROM-clause entry for table "t0" LINE 1:
...rganization_id_41 FROM oro_customer_user t1 WHERE t0.id = '9
Which can be short write like this:
SELECT * FROM oro_customer_user t1 WHERE t0.id = 94
After searching about this, seem like i've not extends the entity the right way, so may i know how to do this?
Here is my code:
MyCodeBundleCustomerBundleControllerCustomerUserController
<?php
namespace MyCodeBundleCustomerBundleController;
use OroBundleCustomerBundleEntityCustomerUser;
use MyCodeBundleCustomerBundleEntityCustomerUser as MyCodeCustomerUser;
use OroBundleCustomerBundleFormHandlerCustomerUserHandler;
use OroBundleCustomerBundleFormTypeCustomerUserType;
use MyCodeBundleCustomerBundleFormTypeCustomerUserType as MyCodeCustomerUserType;
use OroBundleEntityBundleORMDoctrineHelper;
use OroBundleSecurityBundleAnnotationAcl;
use OroBundleSecurityBundleAnnotationAclAncestor;
use SensioBundleFrameworkExtraBundleConfigurationTemplate;
use SymfonyBundleFrameworkBundleControllerController;
use SymfonyComponentFormFormError;
use SymfonyComponentHttpFoundationRedirectResponse;
use SymfonyComponentHttpFoundationRequest;
use SymfonyComponentRoutingAnnotationRoute;
use OroBundleCustomerBundleControllerCustomerUserController as OroCustomerUserController;
use DoctrineORMEntityManager;
use PsrLogLoggerInterface;
class CustomerUserController extends Controller
{
/**
* Edit customer user form
*
* @Route("/update/{id}", name="oro_customer_customer_user_update", requirements={"id"="d+"})
* @Template
* @Acl(
* id="oro_customer_customer_user_update",
* type="entity",
* class="MyCodeCustomerBundle:CustomerUser",
* permission="EDIT"
* )
* @param MyCodeCustomerUser $customerUser
* @param Request $request
* @return array|RedirectResponse
*/
public function updateAction(MyCodeCustomerUser $customerUser, Request $request)
{
die('1');
return $this->MyCodeUpdate($customerUser, $request);
}
/**
* @param MyCodeCustomerUser $customerUser
* @param Request $request
* @return array|RedirectResponse
*/
protected function MyCodeUpdate(MyCodeCustomerUser $customerUser, Request $request)
{
$form = $this->createForm(MyCodeCustomerUserType::class, $customerUser);
$handler = new CustomerUserHandler(
$form,
$request,
$this->get('oro_customer_user.manager'),
$this->get('oro_security.token_accessor'),
$this->get('translator'),
$this->get('logger')
);
$result = $this->get('oro_form.model.update_handler')->handleUpdate(
$customerUser,
$form,
function (MyCodeCustomerUser $customerUser) {
return [
'route' => 'mycode_customer_customer_user_update',
'parameters' => ['id' => $customerUser->getId()]
];
},
function (MyCodeCustomerUser $customerUser) {
return [
'route' => 'oro_customer_customer_user_view',
'parameters' => ['id' => $customerUser->getId()]
];
},
$this->get('translator')->trans('oro.customer.controller.customeruser.saved.message'),
$handler
);
return $result;
}
MyCodeBundleCustomerBundleEntityCustomerUser
<?php
namespace MyCodeBundleCustomerBundleEntity;
use DoctrineCommonCollectionsArrayCollection;
use DoctrineCommonCollectionsCollection;
use DoctrineORMEventPreUpdateEventArgs;
use DoctrineORMMapping as ORM;
use OroBundleCustomerBundleModelExtendCustomerUser;
use OroBundleEmailBundleModelEmailHolderInterface;
use OroBundleEntityConfigBundleMetadataAnnotationConfig;
use OroBundleEntityConfigBundleMetadataAnnotationConfigField;
use OroBundleLocaleBundleModelFullNameInterface;
use OroBundleOrganizationBundleEntityOrganization;
use OroBundleUserBundleEntityAbstractUser;
use OroBundleUserBundleEntityUser;
use OroBundleUserBundleSecurityAdvancedApiUserInterface;
use OroBundleWebsiteBundleEntityWebsite;
use OroBundleCustomerBundleEntityCustomerUser as OroCustomerUser;
/**
* The entity that represents a person who acts on behalf of the company
* to buy products using OroCommerce store frontend.
*
* @ORMEntity()
* @ORMTable(name="oro_customer_user")
*/
class CustomerUser extends OroCustomerUser
{
/**
* @ORMColumn(name="pharmacy_name", type="string", nullable=true)
*/
private $pharmacy_name;
/**
* @ORMColumn(name="pharmacy_address", type="string", nullable=true)
*/
private $pharmacy_address;
/**
* @ORMColumn(name="pbs_approval_number", type="string", nullable=true)
*/
private $pbs_approval_number;
/**
* @ORMColumn(name="business_name", type="string", nullable=true)
*/
private $business_name;
/**
* @ORMColumn(name="australian_business_number", type="string", nullable=true)
*/
private $australian_business_number;
/**
* @ORMColumn(name="business_phone_number", type="string", nullable=true)
*/
private $business_phone_number;
/**
* @ORMColumn(name="fax_number", type="string", nullable=true)
*/
private $fax_number;
/**
* @ORMColumn(name="pharmacy_owner_full_name", type="string", nullable=true)
*/
private $pharmacy_owner_full_name;
/**
* @ORMColumn(name="ahpra_no", type="string", nullable=true)
*/
private $ahpra_no;
/**
* @ORMColumn(name="group_name", type="string", nullable=true)
*/
private $group_name;
/**
* @ORMColumn(name="group_contact_name", type="string", nullable=true)
*/
private $group_contact_name;
/**
* @ORMColumn(name="group_contact_email", type="string", nullable=true)
*/
private $group_contact_email;
/**
* @ORMColumn(name="group_contact_phone_number", type="string", nullable=true)
*/
private $group_contact_phone_number;
/**
* {@inheritdoc}
*/
public function __construct()
{
parent::__construct();
}
Please help, thanks.
php symfony orocommerce
I'm trying to custom the "updateAction" customer of symfony - orocommerce, and after trying a lot, it throw this error message in log file:
Uncaught PHP Exception DoctrineDBALExceptionTableNotFoundException:
"An exception occurred while executing:
'SELECT t1.serialized_data AS
serialized_data_2, t1.id AS id_3, t1.confirmed AS confirmed_4,
t1.email AS email_5, t1.email_lowercase AS email_lowercase_6,
t1.name_prefix AS name_prefix_7, t1.first_name AS first_name_8,
t1.middle_name AS middle_name_9, t1.last_name AS last_name_10,
t1.name_suffix AS name_suffix_11, t1.birthday AS birthday_12,
t1.created_at AS created_at_13, t1.updated_at AS updated_at_14,
t1.enabled AS enabled_15, t1.login_count AS login_count_16,
t1.username AS username_17, t1.is_guest AS is_guest_18, t1.password AS
password_19, t1.salt AS salt_20, t1.last_login AS last_login_21,
t1.confirmation_token AS confirmation_token_22, t1.password_requested
AS password_requested_23, t1.password_changed AS password_changed_24,
t1.pharmacy_name AS pharmacy_name_25, t1.pharmacy_address AS
pharmacy_address_26, t1.pbs_approval_number AS pbs_approval_number_27,
t1.business_name AS business_name_28, t1.australian_business_number AS
australian_business_number_29, t1.business_phone_number AS
business_phone_number_30, t1.fax_number AS fax_number_31,
t1.pharmacy_owner_full_name AS pharmacy_owner_full_name_32,
t1.ahpra_no AS ahpra_no_33, t1.group_name AS group_name_34,
t1.group_contact_name AS group_contact_name_35, t1.group_contact_email
AS group_contact_email_36, t1.group_contact_phone_number AS
group_contact_phone_number_37, t1.customer_id AS customer_id_38,
t1.owner_id AS owner_id_39, t1.website_id AS website_id_40,
t1.organization_id AS organization_id_41 FROM oro_customer_user t1
WHERE t0.id = ?' with params ["94"]:
SQLSTATE[42P01]: Undefined
table: 7 ERROR: missing FROM-clause entry for table "t0" LINE 1:
...rganization_id_41 FROM oro_customer_user t1 WHERE t0.id = '9
Which can be short write like this:
SELECT * FROM oro_customer_user t1 WHERE t0.id = 94
After searching about this, seem like i've not extends the entity the right way, so may i know how to do this?
Here is my code:
MyCodeBundleCustomerBundleControllerCustomerUserController
<?php
namespace MyCodeBundleCustomerBundleController;
use OroBundleCustomerBundleEntityCustomerUser;
use MyCodeBundleCustomerBundleEntityCustomerUser as MyCodeCustomerUser;
use OroBundleCustomerBundleFormHandlerCustomerUserHandler;
use OroBundleCustomerBundleFormTypeCustomerUserType;
use MyCodeBundleCustomerBundleFormTypeCustomerUserType as MyCodeCustomerUserType;
use OroBundleEntityBundleORMDoctrineHelper;
use OroBundleSecurityBundleAnnotationAcl;
use OroBundleSecurityBundleAnnotationAclAncestor;
use SensioBundleFrameworkExtraBundleConfigurationTemplate;
use SymfonyBundleFrameworkBundleControllerController;
use SymfonyComponentFormFormError;
use SymfonyComponentHttpFoundationRedirectResponse;
use SymfonyComponentHttpFoundationRequest;
use SymfonyComponentRoutingAnnotationRoute;
use OroBundleCustomerBundleControllerCustomerUserController as OroCustomerUserController;
use DoctrineORMEntityManager;
use PsrLogLoggerInterface;
class CustomerUserController extends Controller
{
/**
* Edit customer user form
*
* @Route("/update/{id}", name="oro_customer_customer_user_update", requirements={"id"="d+"})
* @Template
* @Acl(
* id="oro_customer_customer_user_update",
* type="entity",
* class="MyCodeCustomerBundle:CustomerUser",
* permission="EDIT"
* )
* @param MyCodeCustomerUser $customerUser
* @param Request $request
* @return array|RedirectResponse
*/
public function updateAction(MyCodeCustomerUser $customerUser, Request $request)
{
die('1');
return $this->MyCodeUpdate($customerUser, $request);
}
/**
* @param MyCodeCustomerUser $customerUser
* @param Request $request
* @return array|RedirectResponse
*/
protected function MyCodeUpdate(MyCodeCustomerUser $customerUser, Request $request)
{
$form = $this->createForm(MyCodeCustomerUserType::class, $customerUser);
$handler = new CustomerUserHandler(
$form,
$request,
$this->get('oro_customer_user.manager'),
$this->get('oro_security.token_accessor'),
$this->get('translator'),
$this->get('logger')
);
$result = $this->get('oro_form.model.update_handler')->handleUpdate(
$customerUser,
$form,
function (MyCodeCustomerUser $customerUser) {
return [
'route' => 'mycode_customer_customer_user_update',
'parameters' => ['id' => $customerUser->getId()]
];
},
function (MyCodeCustomerUser $customerUser) {
return [
'route' => 'oro_customer_customer_user_view',
'parameters' => ['id' => $customerUser->getId()]
];
},
$this->get('translator')->trans('oro.customer.controller.customeruser.saved.message'),
$handler
);
return $result;
}
MyCodeBundleCustomerBundleEntityCustomerUser
<?php
namespace MyCodeBundleCustomerBundleEntity;
use DoctrineCommonCollectionsArrayCollection;
use DoctrineCommonCollectionsCollection;
use DoctrineORMEventPreUpdateEventArgs;
use DoctrineORMMapping as ORM;
use OroBundleCustomerBundleModelExtendCustomerUser;
use OroBundleEmailBundleModelEmailHolderInterface;
use OroBundleEntityConfigBundleMetadataAnnotationConfig;
use OroBundleEntityConfigBundleMetadataAnnotationConfigField;
use OroBundleLocaleBundleModelFullNameInterface;
use OroBundleOrganizationBundleEntityOrganization;
use OroBundleUserBundleEntityAbstractUser;
use OroBundleUserBundleEntityUser;
use OroBundleUserBundleSecurityAdvancedApiUserInterface;
use OroBundleWebsiteBundleEntityWebsite;
use OroBundleCustomerBundleEntityCustomerUser as OroCustomerUser;
/**
* The entity that represents a person who acts on behalf of the company
* to buy products using OroCommerce store frontend.
*
* @ORMEntity()
* @ORMTable(name="oro_customer_user")
*/
class CustomerUser extends OroCustomerUser
{
/**
* @ORMColumn(name="pharmacy_name", type="string", nullable=true)
*/
private $pharmacy_name;
/**
* @ORMColumn(name="pharmacy_address", type="string", nullable=true)
*/
private $pharmacy_address;
/**
* @ORMColumn(name="pbs_approval_number", type="string", nullable=true)
*/
private $pbs_approval_number;
/**
* @ORMColumn(name="business_name", type="string", nullable=true)
*/
private $business_name;
/**
* @ORMColumn(name="australian_business_number", type="string", nullable=true)
*/
private $australian_business_number;
/**
* @ORMColumn(name="business_phone_number", type="string", nullable=true)
*/
private $business_phone_number;
/**
* @ORMColumn(name="fax_number", type="string", nullable=true)
*/
private $fax_number;
/**
* @ORMColumn(name="pharmacy_owner_full_name", type="string", nullable=true)
*/
private $pharmacy_owner_full_name;
/**
* @ORMColumn(name="ahpra_no", type="string", nullable=true)
*/
private $ahpra_no;
/**
* @ORMColumn(name="group_name", type="string", nullable=true)
*/
private $group_name;
/**
* @ORMColumn(name="group_contact_name", type="string", nullable=true)
*/
private $group_contact_name;
/**
* @ORMColumn(name="group_contact_email", type="string", nullable=true)
*/
private $group_contact_email;
/**
* @ORMColumn(name="group_contact_phone_number", type="string", nullable=true)
*/
private $group_contact_phone_number;
/**
* {@inheritdoc}
*/
public function __construct()
{
parent::__construct();
}
Please help, thanks.
php symfony orocommerce
php symfony orocommerce
edited Nov 19 at 12:31
Brian Tompsett - 汤莱恩
4,153133699
4,153133699
asked Nov 19 at 11:07
fudu
1157
1157
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Answered at the forum.
https://forum.oroinc.com/orocommerce/topic/missing-from-clause-entry-for-table-t0
Please don't post the same questions at different channels. This usually not speed up the answer, but make more work for us.
Thank you
Thanks, i just thought that if i post on this, there will be someone who have experience about this which can lead me or give advice on this. Sorry
– fudu
Nov 27 at 1:58
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Answered at the forum.
https://forum.oroinc.com/orocommerce/topic/missing-from-clause-entry-for-table-t0
Please don't post the same questions at different channels. This usually not speed up the answer, but make more work for us.
Thank you
Thanks, i just thought that if i post on this, there will be someone who have experience about this which can lead me or give advice on this. Sorry
– fudu
Nov 27 at 1:58
add a comment |
up vote
0
down vote
Answered at the forum.
https://forum.oroinc.com/orocommerce/topic/missing-from-clause-entry-for-table-t0
Please don't post the same questions at different channels. This usually not speed up the answer, but make more work for us.
Thank you
Thanks, i just thought that if i post on this, there will be someone who have experience about this which can lead me or give advice on this. Sorry
– fudu
Nov 27 at 1:58
add a comment |
up vote
0
down vote
up vote
0
down vote
Answered at the forum.
https://forum.oroinc.com/orocommerce/topic/missing-from-clause-entry-for-table-t0
Please don't post the same questions at different channels. This usually not speed up the answer, but make more work for us.
Thank you
Answered at the forum.
https://forum.oroinc.com/orocommerce/topic/missing-from-clause-entry-for-table-t0
Please don't post the same questions at different channels. This usually not speed up the answer, but make more work for us.
Thank you
answered Nov 26 at 19:48
Anyt
212
212
Thanks, i just thought that if i post on this, there will be someone who have experience about this which can lead me or give advice on this. Sorry
– fudu
Nov 27 at 1:58
add a comment |
Thanks, i just thought that if i post on this, there will be someone who have experience about this which can lead me or give advice on this. Sorry
– fudu
Nov 27 at 1:58
Thanks, i just thought that if i post on this, there will be someone who have experience about this which can lead me or give advice on this. Sorry
– fudu
Nov 27 at 1:58
Thanks, i just thought that if i post on this, there will be someone who have experience about this which can lead me or give advice on this. Sorry
– fudu
Nov 27 at 1:58
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53373313%2fsymfony-orocommerce-missing-from-clause-entry-for-table-t0%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown