hey guys , I have extended user table in zed and add new column to table but it is not appearing .

Posts: 34 🧑🏻‍🚀 - Cadet
edited June 2023 in Spryker Development

hey guys , I have extended user table in zed and add new column to table but it is not appearing . this is my userTable.php code and userCommunicationFactory.php code . Am I Missing something ?

Welcome!

It looks like you're new here. Sign in or register to get started.

Comments

  • Lead Spryker Solution Architect / Technical Director Posts: 690 🪐 - Explorer

    In your UserCommunicationFactory, what namespace for your UsersTable is used?

  • Posts: 34 🧑🏻‍🚀 - Cadet

    namespace Pyz\Zed\User\Communication;

  • Posts: 34 🧑🏻‍🚀 - Cadet

    is there need to extend controller ? becaz inside controller they are calling facade and create the talble like this
    $usersTable = $this->getFactory()->createUserTable();

  • Lead Spryker Solution Architect / Technical Director Posts: 690 🪐 - Explorer

    The facade get's resolved to your project facade, this should be fine.

    I would set a debugger breakpoint in the controller to see what is going on

  • Posts: 34 🧑🏻‍🚀 - Cadet

    sir is there need to extend the controller ?

  • Lead Spryker Solution Architect / Technical Director Posts: 690 🪐 - Explorer

    No, there is no need to extend the controller, extending the Table and the CommunicationFactory, as well as the *.schema.xml is enough.

  • Posts: 34 🧑🏻‍🚀 - Cadet

    here i want to show mobile number as well . so is there need of schema file ?

  • Lead Spryker Solution Architect / Technical Director Posts: 690 🪐 - Explorer

    As your SpyUsersTableMap already has a column COL_MOBILE_NUMBER you already extended the database via a schema file. That done.

  • Lead Spryker Solution Architect / Technical Director Posts: 690 🪐 - Explorer

    As said:

    I would set a debugger breakpoint in the controller to see what is going on

    Without seeing the complete code it's pretty hard to find the issue. From looking at what you've shown it looks fine

  • Posts: 34 🧑🏻‍🚀 - Cadet

    okay i will configure it and will check it .

  • Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,115 ⚖️ - Guardians (admin)

    @U04TM8FELSF Can you may post all the use-statements of your CommunicationFactory?

  • Posts: 34 🧑🏻‍🚀 - Cadet

    <?php

    /**
    * Copyright © 2016-present Spryker Systems GmbH. All rights reserved.
    * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
    */

    namespace Spryker\Zed\User\Communication;

    use Spryker\Zed\Kernel\Communication\AbstractCommunicationFactory;
    use Spryker\Zed\User\Communication\Form\ActivateUserForm;
    use Spryker\Zed\User\Communication\Form\DataProvider\UserFormDataProvider;
    use Spryker\Zed\User\Communication\Form\DataProvider\UserUpdateFormDataProvider;
    use Spryker\Zed\User\Communication\Form\DeactivateUserForm;
    use Spryker\Zed\User\Communication\Form\ResetPasswordForm;
    use Spryker\Zed\User\Communication\Form\UserDeleteConfirmForm;
    use Spryker\Zed\User\Communication\Form\UserForm;
    use Spryker\Zed\User\Communication\Form\UserUpdateForm;
    use Spryker\Zed\User\Communication\Table\PluginExecutor\UserTablePluginExecutor;
    use Spryker\Zed\User\Communication\Table\PluginExecutor\UserTablePluginExecutorInterface;
    use Spryker\Zed\User\Communication\Table\UsersTable;
    use Spryker\Zed\User\UserDependencyProvider;
    use Symfony\Component\Form\FormInterface;

    /**
    * @method \Spryker\Zed\User\Persistence\UserQueryContainerInterface getQueryContainer()
    * @method \Spryker\Zed\User\UserConfig getConfig()
    * @method \Spryker\Zed\User\Business\UserFacadeInterface getFacade()
    */
    class UserCommunicationFactory extends AbstractCommunicationFactory
    {
    /**
    * @return \Symfony\Component\Form\FormInterface
    */
    public function createResetPasswordForm()
    {
    return $this->getFormFactory()->create(ResetPasswordForm::class);
    }

    /**
     * @return \Spryker\Zed\User\Communication\Table\UsersTable
     */
    public function createUserTable()
    {
        return new UsersTable(
            $this->getQueryContainer(),
            $this->getProvidedDependency(UserDependencyProvider::SERVICE_DATE_FORMATTER),
            $this->createUserTablePluginExecutor(),
        );
    }
    
    /**
     * @return \Spryker\Zed\User\Communication\Table\PluginExecutor\UserTablePluginExecutorInterface
     */
    public function createUserTablePluginExecutor(): UserTablePluginExecutorInterface
    {
        return new UserTablePluginExecutor(
            $this->getUserTableActionExpanderPlugins(),
            $this->getUserTableConfigExpanderPlugins(),
            $this->getUserTableDataExpanderPlugins(),
        );
    }
    
    /**
     * @param array<string, mixed> $data
     * @param array<string, mixed> $options
     *
     * @return \Symfony\Component\Form\FormInterface
     */
    public function createUserForm(array $data = [], array $options = [])
    {
        return $this->getFormFactory()->create(UserForm::class, $data, $options);
    }
    
    /**
     * @return array<\Spryker\Zed\UserExtension\Dependency\Plugin\UserFormExpanderPluginInterface>
     */
    public function getFormExpanderPlugins(): array
    {
        return $this->getProvidedDependency(UserDependencyProvider::PLUGINS_USER_FORM_EXPANDER);
    }
    
    /**
     * @param array<string, mixed> $data
     * @param array<string, mixed> $options
     *
     * @return \Symfony\Component\Form\FormInterface
     */
    public function createUpdateUserForm(array $data = [], array $options = [])
    {
        return $this->getFormFactory()->create(UserUpdateForm::class, $data, $options);
    }
    
    /**
     * @return \Symfony\Component\Form\FormInterface
     */
    public function getUserDeleteConfirmForm(): FormInterface
    {
        return $this->getFormFactory()->create(UserDeleteConfirmForm::class);
    }
    
    /**
     * @return \Symfony\Component\Form\FormInterface
     */
    public function createActivateUserForm(): FormInterface
    {
        return $this->getFormFactory()->create(ActivateUserForm::class);
    }
    
    /**
     * @return \Symfony\Component\Form\FormInterface
     */
    public function createDeactivateUserForm(): FormInterface
    {
        return $this->getFormFactory()->create(DeactivateUserForm::class);
    }
    
    /**
     * @return \Spryker\Zed\User\Communication\Form\DataProvider\UserFormDataProvider
     */
    public function createUserFormDataProvider()
    {
        /** @var \Spryker\Zed\User\Business\UserFacade $userFacade */
        $userFacade = $this->getFacade();
    
        return new UserFormDataProvider($this->getGroupPlugin(), $userFacade);
    }
    
    /**
     * @return \Spryker\Zed\User\Communication\Form\DataProvider\UserUpdateFormDataProvider
     */
    public function createUserUpdateFormDataProvider()
    {
        /** @var \Spryker\Zed\User\Business\UserFacade $userFacade */
        $userFacade = $this->getFacade();
    
        return new UserUpdateFormDataProvider($this->getGroupPlugin(), $userFacade);
    }
    
    /**
     * @return \Spryker\Zed\User\Dependency\Plugin\GroupPluginInterface
     */
    public function getGroupPlugin()
    {
        return $this->getProvidedDependency(UserDependencyProvider::PLUGIN_GROUP);
    }
    
    /**
     * @return array<\Spryker\Zed\UserExtension\Dependency\Plugin\UserTableActionExpanderPluginInterface>
     */
    protected function getUserTableActionExpanderPlugins(): array
    {
        return $this->getProvidedDependency(UserDependencyProvider::PLUGINS_USER_TABLE_ACTION_EXPANDER);
    }
    
    /**
     * @return array<\Spryker\Zed\UserExtension\Dependency\Plugin\UserTableConfigExpanderPluginInterface>
     */
    protected function getUserTableConfigExpanderPlugins(): array
    {
        return $this->getProvidedDependency(UserDependencyProvider::PLUGINS_USER_TABLE_CONFIG_EXPANDER);
    }
    
    /**
     * @return array<\Spryker\Zed\UserExtension\Dependency\Plugin\UserTableDataExpanderPluginInterface>
     */
    protected function getUserTableDataExpanderPlugins(): array
    {
        return $this->getProvidedDependency(UserDependencyProvider::PLUGINS_USER_TABLE_DATA_EXPANDER);
    }
    

    }

  • Lead Spryker Solution Architect / Technical Director Posts: 690 🪐 - Explorer

    use Spryker\Zed\User\Communication\Table\UsersTable; must be use Pyz\Zed\User\Communication\Table\UsersTable;

  • Lead Spryker Solution Architect / Technical Director Posts: 690 🪐 - Explorer

    That was one of the first thing's I asked

  • Posts: 34 🧑🏻‍🚀 - Cadet

    okay sir mobile number is appearing

  • Posts: 34 🧑🏻‍🚀 - Cadet

    thank you sir

Welcome!

It looks like you're new here. Sign in or register to get started.