In this example, the function validateJsonNotEmptyImage does not work as expected?
Just to clarify.
'src' => $image->src, // WORKS
'height' => $this->validateJsonNotEmptyImage('type', 'width'), // DOES NOT WORK
public function validateJsonNotEmptyImage($type, $array1) {
if ($type, $array1) {
if (isset($type->$array1)) {
return $type . '->' . $array1;
} else {
return null;
}
}
}
$productsImagesToSiteArray = array();
foreach ($this->resource->images as $image) {
$productsImagesToSiteArray[] = array(
'height' => $this->validateJsonNotEmptyImage('$image', 'width'),
'src' => $image->src,
);
}
$image