]> _ Git - cubist_cms-back.git/commitdiff
#2926
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 23 Aug 2019 14:26:11 +0000 (16:26 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 23 Aug 2019 14:26:11 +0000 (16:26 +0200)
src/app/Magic/PageData.php

index 55b992312a72d42bd8b43992321d3c6bf0769e88..b7edb4f54ef4b0d077c826d95d84d9cd1a233f0a 100644 (file)
@@ -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;
+    }
 }