From: Vincent Vanwaelscappel Date: Fri, 23 Aug 2019 14:26:11 +0000 (+0200) Subject: #2926 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=f6bef5795889532e806129172aedcac4a78090d8;p=cubist_cms-back.git #2926 --- diff --git a/src/app/Magic/PageData.php b/src/app/Magic/PageData.php index 55b9923..b7edb4f 100644 --- a/src/app/Magic/PageData.php +++ b/src/app/Magic/PageData.php @@ -343,4 +343,17 @@ class PageData implements \ArrayAccess return empty($res) ? $default : $res; } + + /** + * @param $entities CubistMagicAbstractModel[] + * @return PageData[] + */ + public static function fromEntities($entities) + { + $res = []; + foreach ($entities as $key => $entity) { + $res[$key] = $entity->getPageData(); + } + return $res; + } }