creating managers
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!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
- mahammadareef
- Posts: 54
- Joined: 14 Oct 2022, 11:54
creating managers
I wanted to fetch the data from my newly created table called customer_contact and show it in the admin panel including all the default options like add new delete update search filter etc ...,
- mahammadareef
- Posts: 54
- Joined: 14 Oct 2022, 11:54
Re: creating managers
please explain it in step by step process wih reference
Re: creating manager and admin panel
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
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
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
- mahammadareef
- Posts: 54
- Joined: 14 Oct 2022, 11:54
Re: creating managers
i created the contact table migration using laravel style, is it possible to get this data and show it in aimeos admin panel
- mahammadareef
- Posts: 54
- Joined: 14 Oct 2022, 11:54
Re: creating managers
I created the manager class it showing me this error
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mshop/contact/manager/counts' at line 1: mshop/contact/manager/counts
help me fix this
thank you in advance team aimeos
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mshop/contact/manager/counts' at line 1: mshop/contact/manager/counts
help me fix this
thank you in advance team aimeos
Re: creating managers
Yes, you can also use Laravel migrations to create the table.
That means that the configuration of the SQL statement for "mshop/contact/manager/counts" is missing (and probably all other SQL statements you have to add to the configuration for your new manager).mahammadareef wrote: ↑15 Nov 2022, 14:00 SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mshop/contact/manager/counts' at line 1: mshop/contact/manager/counts
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
- mahammadareef
- Posts: 54
- Joined: 14 Oct 2022, 11:54
Re: creating managers
Thank you team for helping me understand aimeos ,
now i want to understand the logic behind this code (manager config file)
What is the purpose to use ansi+mysql array and how count array triggerred
now i want to understand the logic behind this code (manager config file)
Code: Select all
'count' => array(
'ansi' => '
SELECT COUNT(*) AS "count"
FROM (
SELECT mrev."id"
FROM "mshop_review" mrev
:joins
WHERE :cond
GROUP BY mrev."id"
ORDER BY mrev."id"
OFFSET 0 ROWS FETCH NEXT 10000 ROWS ONLY
) AS list
',
'mysql' => '
SELECT COUNT(*) AS "count"
FROM (
SELECT mrev."id"
FROM "mshop_review" mrev
:joins
WHERE :cond
GROUP BY mrev."id"
ORDER BY mrev."id"
LIMIT 10000 OFFSET 0
) AS list
'
),
Re: creating managers
Aimeos supports different database implementations (MySQL, PostgreSQL, SQL Server, etc.) and not all understand the same SQL syntax. The ANSI SQL syntax is supported by most database implementations but e.g. not by MySQL (the difference is the LIMIT/OFFSET part). Therefore, two different SQL statements must be provided, one for MySQL and one for the rest.
The right one is chosen by the getCachedStatement() method which requires the configuration key without the implementation specific postfix, e.g. "mshop/review/manager/count"
The right one is chosen by the getCachedStatement() method which requires the configuration key without the implementation specific postfix, e.g. "mshop/review/manager/count"
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: creating managers
Hello,
Thanks for the information posted here.
I am confused by one part of the setup here:
https://github.com/aimeos/aimeos-core/b ... Review.php
Why does it say $db = $this->db( 'db-review' ); , the database is being set to 'db-review'?
If my database is under a different name, should I put that name in here instead?
EDIT:
Nevermind, I found the answer in the docs:
If no connection for db-mydomain is configured, it will automatically fall back to the default connection.
Thanks for the information posted here.
I am confused by one part of the setup here:
https://github.com/aimeos/aimeos-core/b ... Review.php
Why does it say $db = $this->db( 'db-review' ); , the database is being set to 'db-review'?
If my database is under a different name, should I put that name in here instead?
EDIT:
Nevermind, I found the answer in the docs:
If no connection for db-mydomain is configured, it will automatically fall back to the default connection.
Re: creating managers
I don't understand how to execute the task for the table creation.
Some help please?
Some help please?