attributes[$attribute->getId()] = $attribute; } public function get(string $id) : ?Attribute{ return $this->attributes[$id] ?? null; } /** * @return Attribute[] */ public function getAll() : array{ return $this->attributes; } /** * @return Attribute[] */ public function needSend() : array{ return array_filter($this->attributes, function(Attribute $attribute) : bool{ return $attribute->isSyncable() && $attribute->isDesynchronized(); }); } }