public function createLayersForCxn($cxn, $data) { $layerType = new LayerType(); $layerTypes = $layerType->listToConstruction(); foreach ($layerTypes as $lt) { $layer = new Layer(); $layer->setIdLayerType($lt['idLayerType']); $layer->setIdAnnotationSet($this->getId()); $layer->setRank(1); $layer->save(); } // obtem as relações CXN-FR e cria as camadas FE $layerCEFE = $layerType->listCEFE(); $er = new EntityRelation(); $relations = $er->listCxnFrameRelations($cxn->getIdEntity())->asQuery()->getResult(); foreach ($relations as $relation) { $layer = new Layer(); $layer->setIdLayerType($layerCEFE[0]['idLayerType']); $layer->setIdAnnotationSet($this->getId()); $layer->setRank(1); $layer->save(); } }