Takes meta as array and sets it to the entity.

@param CategoryMetaInterface[] $metaEntities

@return Category
777909
public function setMeta($metaEntities)
    {
        $currentMeta = $this->entity->getMeta();
        foreach ($metaEntities as $singleMeta) {
            $metaEntity = $this->getSingleMetaById($currentMeta, $singleMeta->getId());
            if (!$metaEntity) {
                $metaEntity = $singleMeta;
                $this->entity->addMeta($metaEntity);
            }

            $metaEntity->setCategory($this->entity);
            $metaEntity->setKey($singleMeta->getKey());
            $metaEntity->setValue($singleMeta->getValue());
            $metaEntity->setLocale($singleMeta->getLocale());
        }

        return $this;
    }
397008
public function setPosts(ArrayCollection $posts)
    {
        /** @var \Icap\BlogBundle\Entity\Post[] $posts */
        foreach ($posts as $post) {
            $post->setBlog($this);
        }

        $this->posts = $posts;

        return $this;
    }
988927
public function getCategory()
    {
        try {
            $category = $this->coreRegistry->registry('current_category');
            if ($category instanceof CategoryModel) {
                $categoryList = [];

                $categoryIds = $this->removeDefaultCategories($category->getPathIds());

                $linkField = 'entity_id';
                if (class_exists('Magento\Framework\EntityManager\MetadataPool')) {
                    // @codingStandardsIgnoreLine
                    $metadataPool = $this->objectManager->create(
                        'Magento\Framework\EntityManager\MetadataPool'
                    );
                    $linkField = $metadataPool->getMetadata(CategoryInterface::class)->getLinkField();
                }

                /** @var \Magento\Catalog\Model\ResourceModel\Category\Collection $categoryCollection */
                $categoryCollection = $this->categoryCollectionFactory->create()
                    ->setStore($this->storeManager->getStore())
                    ->addAttributeToSelect('name')
                    ->addFieldToFilter($linkField, ['in' => $categoryIds]);

                /** @var Category $category */
                foreach ($categoryCollection as $categoryItem) {
                    $categoryList[] = $categoryItem->getName();
                }

                return [
                    'names' => $categoryList,
                    'ids'   => $categoryIds,
                ];
            }
        } catch (\Exception $e) {
            throw $e;
        }
        return false;
    }
710945
public function setCategories($categories)
    {
        foreach ($categories as $category) {
            $category->setBlog($this);
        }
        $this->categories = $categories;

        return $this;
    }
903189
public function addCategory(\Hexmedia\ContentBundle\Entity\Category $category)
    {
        $this->categories[] = $category;

        return $this;
    }
220306
public function setTemplateEntities(
        Collection $templateEntities
    ): self {
        foreach($this->templateEntities as $templateEntity){
            $this->removeTemplateEntity($templateEntity);
        }
        foreach($templateEntities as $newTemplateEntity){
            $this->addTemplateEntity($newTemplateEntity);
        }

        return $this;
    }
388954
public function withMeta($meta): EncoderInterface
    {
        $this->meta    = $meta;
        $this->hasMeta = true;

        return $this;
    }
1047681
public function addMeta()
    {
        foreach (func_get_args() as $meta) {
            if (is_array($meta)) {
                $this->meta += $meta;
            }
        }

        return $this;
    }
454002
public static function toArray(IEntity $entity, int $type = self::RELATIONSHIP_AS_IS, int $recursionLevel = 0): array
	{
		$return = [];
		$metadata = $entity->getMetadata();

		foreach ($metadata->getProperties() as $name => $metadataProperty) {
			if (!$entity->hasValue($name)) {
				$value = null;
			} else {
				$value = $entity->getValue($name);
			}

			if ($value instanceof IEntity) {
				if ($type === self::RELATIONSHIP_AS_ID) {
					$value = $value->getValue('id');
				} elseif ($type === self::RELATIONSHIP_AS_ARRAY) {
					if ($recursionLevel + 1 >= static::$maxRecursionLevel) {
						$value = null;
					} else {
						$value = static::toArray($value, $type, $recursionLevel + 1);
					}
				}

			} elseif ($value instanceof IRelationshipCollection) {
				if ($type === self::RELATIONSHIP_AS_ID) {
					$collection = [];
					foreach ($value as $collectionEntity) {
						$collection[] = $collectionEntity->getValue('id');
					}
					$value = $collection;

				} elseif ($type === self::RELATIONSHIP_AS_ARRAY) {
					$collection = [];
					if ($recursionLevel + 1 < static::$maxRecursionLevel) {
						foreach ($value as $collectionEntity) {
							$collection[] = static::toArray($collectionEntity, $type, $recursionLevel + 1);
						}
					}
					$value = $collection;
				}
			}

			$return[$name] = $value;
		}

		return $return;
	}
1352681
public function setCategory(ChildCategory $v = null)
    {
        if ($v === null) {
            $this->setCategoryId(NULL);
        } else {
            $this->setCategoryId($v->getId());
        }

        $this->aCategory = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildCategory object, it will not be re-added.
        if ($v !== null) {
            $v->addC2M($this);
        }


        return $this;
    }
1090058
public function whereAnyMetaId(array $metas)
	{
		$filters = array();
		
		foreach ($metas as $meta => $data) {
			$value = is_array($data) ? Arr::get($data, 0) : $data;
			$operator = is_array($data) ? Arr::get($data, 1, '=') : '=';
			
			$filters[] = array('id' => $meta, 'value' => $value, 'operator' => $operator);
		}
		
		$this->filters[]['metas'] = $filters;
		
		return $this;
	}
952432
public function addMeta($meta = array())
	{
		foreach ($meta as $type => $value)
		{
			$this->meta[$type] = array_merge($this->meta[$type], $value);
		}
	}
310687
public function setMetadata(\TechPromux\DynamicQueryBundle\Entity\Metadata $metadata)
    {
        $this->metadata = $metadata;

        return $this;
    }
538942
public function createMetaEntityFactory(): MetaEntityFactory {
		if (null === $this->metaEntityFactory) {
			$this->metaEntityFactory = new MysqlMetaEntityFactory($this);
		}
		
		return $this->metaEntityFactory;
	}
1321296
public function createMetaEntityFactory(): MetaEntityFactory {
		if (!(isset($this->metaEntityFactory))) {
			$this->metaEntityFactory = new OracleMetaEntityFactory($this);
		}
		return $this->metaEntityFactory;
	}
67519
protected function setDefaults($metaType, $mapping)
    {
        if (!is_array($mapping)) {
            $mapping = [];
        }

        $mapping = $this->setRootDefault('attributes', $mapping);
        $mapping = $this->setRootDefault('embeds', $mapping);
        $mapping = $this->setRootDefault('mixins', $mapping);
        if ('embed' === $metaType) {
            return $mapping;
        }

        $mapping = $this->setRootDefault('relationships', $mapping);
        if ('mixin' === $metaType) {
            return $mapping;
        }
        $this->setRootDefault('entity', $mapping);

        if (!isset($mapping['entity']['persistence']) || !is_array($mapping['entity']['persistence'])) {
            $mapping['entity']['persistence'] = [];
        }

        if (!isset($mapping['entity']['search']) || !is_array($mapping['entity']['search'])) {
            $mapping['entity']['search'] = [];
        }
        return $mapping;
    }
1200470
private function createMetasetConfig(array $metaSets)
    {
        $optionResolver = $this->get('phlexible_meta_set.option_resolver');

        $meta = array();

        foreach ($metaSets as $metaSet) {
            $fieldDatas = [];

            foreach ($metaSet->getFields() as $field) {
                $options = $optionResolver->resolve($field);

                $fieldData = [
                    'key' => $field->getName(),
                    'type' => $field->getType(),
                    'options' => $options,
                    'readonly' => $field->isReadonly(),
                    'required' => $field->isRequired(),
                    'synchronized' => $field->isSynchronized(),
                ];

                $fieldDatas[] = $fieldData;
            }

            $meta[] = [
                'set_id' => $metaSet->getId(),
                'title' => $metaSet->getName(),
                'fields' => $fieldDatas,
            ];
        }

        return $meta;
    }