parentCol = $parentCol; $this->parentContainer = $parent; $this->cols = new ArrayCollection(); $this->ordered = 0; $this->cache = []; } public function getId(): ?int { return $this->id; } /** * @return AGridContent */ public function getParentContainer(): AGridContent { return $this->parentContainer; } /** * @param AGridContent $parentContainer * @return AGridRow */ public function setParentContainer(AGridContent $parentContainer): AGridRow { $this->parentContainer = $parentContainer; return $this; } /** * @return Collection */ public function getCols(): Collection { return $this->cols; } /** * @param Collection $cols * @return AGridRow */ public function setCols(Collection $cols): AGridRow { $this->cols = $cols; return $this; } public function addCol(AGridCol $col): self { if (!$this->cols->contains($col)) { $this->cols[] = $col; } return $this; } public function removeCol(AGridCol $col): self { if ($this->cols->contains($col)) { $this->cols->removeElement($col); } return $this; } public function getOrdered(): ?int { return $this->ordered; } public function setOrdered(int $ordered): self { $this->ordered = $ordered; return $this; } /** * @return AGridCol|null */ public function getParentCol(): ?AGridCol { return $this->parentCol; } public function setParentCol(?AGridCol $parentCol): self { $this->parentCol = $parentCol; return $this; } public function getCache(string $lang = null, string $resolution = null) { if($lang == null) $lang = 'default'; if($resolution == null) $resolution = 'default'; //on a l'information pour la langue et la résolution concernée if(isset($this->cache[$lang][$resolution]) && $this->cache[$lang][$resolution] != null) return $this->cache[$lang][$resolution]; //on regarde si on à l'information pour la résolution par defaut if(isset($this->cache[$lang]['default']) && $this->cache[$lang]['default'] != null) return $this->cache[$lang]['default']; //on regarde si on a l'information pour la langue par defaut if(isset($this->cache['default'][$resolution]) && $this->cache['default'][$resolution] != null) return $this->cache['default'][$resolution]; //on regarde si on a l'information pour la langue et la résolution par defaut if(isset($this->cache['default']['default']) && $this->cache['default']['default'] != null) return $this->cache['default']['default']; return ''; } /** * @param string $lang * @param string $resolution * @param $value * @return $this */ public function addCache(string $lang, string $resolution, $value) { if($lang == null) $lang = 'default'; if($resolution == null) $resolution = 'default'; $this->cache[$lang][$resolution] = $value; return $this; } public function setCache(?array $cache): self { $this->cache = $cache; return $this; } }