for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace FlatPlan\Components;
use FlatPlan\Components\Image;
class Gallery extends AbstractComponent {
protected $components = array();
protected $roles = ['gallery', 'mosaic'];
/**
* @param string $role
* @return void
*/
public function __construct($role)
{
$this->setRole($role);
}
public function setComponents($components)
if (is_array($components)) {
foreach ($components as $component) {
if ($component instanceof Image) {
$component->updateStyles($this->role);
array_push($this->components, $component);
} else if ($components instanceof Image) {
$components->updateStyles($this->role);
array_push($this->components, $components);
private function getComponents()
$componentList = array();
foreach ($this->components as $subComponent) {
array_push($componentList, $subComponent->getComponent());
return $componentList;
public function getComponent()
$component = new \stdClass();
$component->role = $this->getRole();
$component->items = $this->getComponents();
$component->layout = $this->layout;
$component->style = $this->style;
return $component;