creating managers

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
aimeos
Administrator
Posts: 7865
Joined: 01 Jan 1970, 00:00

Re: creating managers

Post by aimeos » 26 Nov 2022, 09:25

Run this command to create/update/migrate the table structure and data:

Code: Select all

php artisan aimeos:setup
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

kdim95
Advanced
Posts: 194
Joined: 26 Aug 2022, 12:17

Re: creating managers

Post by kdim95 » 26 Nov 2022, 11:59

Thank you, knowing of the command made me check closer what I did wrong.

I got confused by the namespace Aimeos\Upscheme\Task and had placed my task inside the directory 'src\Aimeos\Upscheme\Task' instead of 'setup\default'.

User avatar
mahammadareef
Posts: 54
Joined: 14 Oct 2022, 11:54

Re: creating managers

Post by mahammadareef » 05 Dec 2022, 20:40

Code: Select all

public function search( \Aimeos\Base\Criteria\Iface $search, array $ref = [], int &$total = null ) : \Aimeos\Map
	{
		$context = $this->context();
		$conn = $context->db( $this->getResourceName() );
		$items = [];
		
		$required = ['contact'];
		
		
		$level = \Aimeos\MShop\Locale\Manager\Base::SITE_SUBTREE;
		$level = $context->config()->get( 'mshop/contact/manager/sitemode', $level );
		
		
		
			$cfgPathSearch = 'mshop/contact/manager/search';
            
			
			$cfgPathCount = 'mshop/contact/manager/count';
            
			$results = $this->searchItemsBase( $conn, $search, $cfgPathSearch, $cfgPathCount,
            $required, $total, $level );
            
            // dd($results);

			try
			{
				while( ( $row = $results->fetch() ) !== null ) {
					
					[quote]$items[$row['contact.id']] = $this->applyFilter( $this->createItemBase( $row ) );[/quote]
				}
			}
			catch( \Exception $e )
			{
				$results->finish();
				throw $e;
			}
		// dd(map( $items ));
		return map( $items );
	}

this is my search code contact/manager/standard class , where iam getting
Undefined array key "contact.id"
#0 D:\laragon\www\laravel-project\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(259): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'Undefined array...', 'D:\\laragon\\www\\...', 267)
in
$items[$row['contact.id']] = $this->applyFilter( $this->createItemBase( $row ) );
line ....


please help me solve this

User avatar
aimeos
Administrator
Posts: 7865
Joined: 01 Jan 1970, 00:00

Re: creating managers

Post by aimeos » 07 Dec 2022, 09:13

The column is only named "contact.id" if you use this as alias in your SQL statement in the manager configuration, e.g.:

Code: Select all

SELECT "id" AS "contact.id", ...
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

karoleq991
Posts: 1
Joined: 07 Feb 2023, 19:14

Re: creating manager and admin panel

Post by karoleq991 » 07 Feb 2023, 19:18

aimeos wrote: 14 Nov 2022, 17:27 Create an Aimeos migration first in the ./setup/default/schema/contact.php directory of your extension so your table will be automatically created and updated like this one:
https://github.com/aimeos/aimeos-core/b ... review.php
The corresponding setup task should be like this one in the ./setup/Contact.php directory of your extension:
https://github.com/aimeos/aimeos-core/b ... Review.php
Documentation for migrations and setup tasks is available here:
https://aimeos.org/docs/latest/infrastr ... igrations/

Next, create a manager and item for your new data domain in ./src/MShop/Contact/Manager/Standard.php, ./src/Contact/Item/Standard.php and ./src/MShop/Contact/Exception.php like this one:
https://github.com/aimeos/aimeos-core/t ... hop/Review
You can copy, paste and adapt the files. The corresponding config must be in ./config/mshop/contact.php and should look like this one:
https://github.com/aimeos/aimeos-core/b ... review.php

Finally, create the class file for the admin backend in ./src/Admin/JQAdm/Contact/Standard.php like this one in your extension:
https://github.com/aimeos/ai-admin-jqad ... andard.php
Create the corresponding templates like here:
https://github.com/aimeos/ai-admin-jqad ... adm/review
Configure the permissions and navbar entry of your new admin backend panel like here in the ./config/admin/jqadm/ directory of your extension:
https://github.com/aimeos/ai-admin-jqad ... dmin/jqadm
I'm having trouble creating a template.
After doing it, a white page is displayed and the template does not load, even though I have placed the list.php and item.php files in the templates/admin/jqadm/<my panel name> directory of my extension. Please help me :)

User avatar
aimeos
Administrator
Posts: 7865
Joined: 01 Jan 1970, 00:00

Re: creating managers

Post by aimeos » 08 Feb 2023, 08:49

This is most likely due to a PHP or VueJS error. Remove everything from your templates and add parts one by one to see where the error occurs.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply