return $this; | return $this; | ||||
} | } | ||||
public function countProductFamilies($status = null) | |||||
{ | |||||
$count = 0 ; | |||||
foreach($this->getProductFamilies() as $productFamily) { | |||||
if($status === null || ($status !== null && $productFamily->getStatus() == $status)) { | |||||
$count ++ ; | |||||
} | |||||
} | |||||
return $count ; | |||||
} | |||||
public function getMerchant(): ?Merchant | public function getMerchant(): ?Merchant | ||||
{ | { | ||||
return $this->merchant; | return $this->merchant; |
if ($withOffline) $query->andWhere('e.status >= 0'); | if ($withOffline) $query->andWhere('e.status >= 0'); | ||||
else $query->andWhere('e.status = 1'); | else $query->andWhere('e.status = 1'); | ||||
$query->leftJoin('e.productFamilies','productFamilies') ; | |||||
$query->orderBy('e.position', 'ASC'); | $query->orderBy('e.position', 'ASC'); | ||||