سؤال

Currently I am doing this

$product = myProductCalss::myproduct($id);
$product = $product->myproduct;

is there another slick way to do this so that I can kinda do it in one liner?

هل كانت مفيدة؟

المحلول

THis should work:

$product = myProductCalss::myproduct($id)->myproduct;

Your question doesn`t belong here, check https://codereview.stackexchange.com/questions/tagged/php

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top