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)
gosephmiguel
Posts: 1
Joined: 13 Sep 2019, 12:57

Is this an accepted way of retrieving data???

Post by gosephmiguel » 13 Sep 2019, 13:00

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.whatsapp web 192.168.0.1 routerlogin

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.
Last edited by gosephmiguel on 14 Sep 2019, 21:23, edited 1 time in total.

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

Re: Is this an accepted way of retrieving data???

Post by aimeos » 13 Sep 2019, 13:52

Use

Code: Select all

$catItem->getRefItems( 'text', 'short' )
instead. The parameters of getRefItems() are:

Code: Select all

getRefItems( '<domain>', '<type>', '<listtype>' [, false (get all items)] )
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply