Is this an accepted way of retrieving data?

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Golfmad
Posts: 5
Joined: 01 Nov 2018, 11:42

Is this an accepted way of retrieving data?

Post by Golfmad » 08 Nov 2018, 12:23

Hi

New to Laravel and this framework, I just wanted to check to see if this is an accepted/recommended method of getting data about "items". For example I wanted to retrieve the short description about a category so I did the following.

Code: Select all



//var_dump($catItem->getRefItems( 'text' ))

$text_for_category =  $catItem->getRefItems( 'text' );

foreach( $text_for_category as $text ) {
	if($text->getTypeName() == "Short description"){
		echo $text->getContent();
	}
}
As stated, not sure if this is the best approach (perhaps by doing it this way I am missing out on features) but it does seem to output my expected data.

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

Re: Is this an accepted way of retrieving data?

Post by aimeos » 09 Nov 2018, 20:47

It's much easier. You only have to use this:

Code: Select all

$catItem->getRefItems( 'text', 'short', 'default' )
"short" is the text type for the catalog domain you have to create and use for category short descriptions. "default" is the list type in the mshop_catalog_list table
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply