public function createLayersForLU($lu, $data) { $layerType = new LayerType(); $layerTypes = $layerType->listToLU($lu); foreach ($layerTypes as $lt) { $layer = new Layer(); $layer->setIdLayerType($lt['idLayerType']); $layer->setIdAnnotationSet($this->getId()); $layer->setRank(1); $layer->save(); if ($lt['entry'] == 'lty_target') { $label = new Label(); $label->setMulti(false); $label->setIdInstantiationTypeFromEntry('int_normal'); $idLabelType = $layerType->listLabelType((object) ['entry' => 'lty_target'])->asQuery()->getResult()[0]['idLabelType']; $label->setIdLabelType($idLabelType); $label->setIdLayer($layer->getId()); $label->setStartChar($data->startChar); $label->setEndChar($data->endChar); $label->save(); } } }