OroCommerce Forums

Covering OroCommerce topics, including community updates and company announcements.

Forums OroCommerce Create CRUD pages for custom entities?

This topic contains 3 replies, has 3 voices, and was last updated by  peeush 2 weeks, 1 day ago.

  • Creator
    Topic
  • #40126

    peeush
    Participant

    Hello

    I have created a few basic custom entities (programatically) following the developer documentation (How to Use Entities and How to Create Entities).

    I am now trying to create application pages to perform basic CRUD operations but cannot find any step by step guidance on how to do so – can someone point me in the right direction please? I need basic CRUD pages with simple one on one mapping to fields in my entities – I have already gone through Customizing CRUD Pages but that only guides on customising an existing CRUD page and not create a new one for a custom entity.

    I tried creating a simple data grid to view the entity records as well – following How to Create a Basic Datagrid). There are no errors when I run oro:platform:update but neither the application menu shows up, nor is the entity index route active (I get 404 when I try to manually navigate to <app admin url>/<entity> i.e. the configured route). How can I test if the route is indeed getting created and why my application menu entries are not showing up?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #40127
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    Please Take a look at Creating a simple CRUD article.

    #40130

    abhishek.kumar
    Participant

    Hey i want to install orocommerce in azure app service, its not installing, Please anyone

    #40172

    peeush
    Participant

    Thanks Andrey! Creating a simple CRUD article works, but for a couple of issues that needs to be fixed:

      in VehicleController class, viewAction return needs to include entity as well:
      public function viewAction(Vehicle $vehicle)
      {
      return array(
      ‘entity’=>$vehicle,
      ‘vehicle’=>$vehicle
      );
      }
      Delete action implementation details are missing – check out this cookbook for implementing it: https://makandracards.com/oro/65247-oroplatform-api-and-deleting-entity-and-api-testing
      In VehicleController class update function, to instantiate the Vehicle form, you need to explicitly pass the Form Type (passing alias does not work):
      $form = $this->get('form.factory')->create('InventoryBundle\Form\Type\VehicleType', $vehicle);
      FormType class needs to include OptionsResolver class and not OptionsResolverInterface class:
      use Symfony\Component\OptionsResolver\OptionsResolver;

    Hope this can help others using the article!

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

You will be redirected to [title]. Would you like to continue?

Yes No