private function addEvolution($decoded_taf, $evolution, $result, $entity_name)
    {
        // clone the evolution entity
        /** @var Evolution $newEvolution */
        $new_evolution = clone($evolution);

        // add the new entity to it
        $new_evolution->setEntity($result[$entity_name]);

        // possibly add cavok to it
        if ($entity_name == 'visibility' && $this->with_cavok == true) {
            $new_evolution->setCavok(true);
        }

        // get the original entity from the decoded taf or a new one decoded taf doesn't contain it yet
        $getter_name = 'get'.ucfirst($entity_name);
        $setter_name = 'set'.ucfirst($entity_name);
        $decoded_entity = $decoded_taf->$getter_name();
        if ($decoded_entity == null || $entity_name == 'clouds' || $entity_name == 'weatherPhenomenons') {
            // that entity is not in the decoded_taf yet, or it's a cloud layer which is a special case
            $decoded_entity = $this->instantiateEntity($entity_name);
        }

        // add the new evolution to that entity
        $decoded_entity->addEvolution($new_evolution);

        // update the decoded taf's entity or add the new one to it
        if ($entity_name == 'clouds') {
            $decoded_taf->addCloud($decoded_entity);
        } elseif ($entity_name == 'weatherPhenomenons') {
            $decoded_taf->addWeatherPhenomenon($decoded_entity);
        } else {
            $decoded_taf->$setter_name($decoded_entity);
        }
    }
private function addEvolution($decoded_taf, $evolution, $result, $entity_name)
    {
        // clone the evolution entity
        /** @var Evolution $newEvolution */
        $new_evolution = clone($evolution);

        // add the new entity to it
        $new_evolution->setEntity($result[$entity_name]);

        // possibly add cavok to it
        if ($entity_name == 'visibility' && $this->with_cavok == true) {
            $new_evolution->setCavok(true);
        }

        // get the original entity from the decoded taf or a new one decoded taf doesn't contain it yet
        $getter_name = 'get'.ucfirst($entity_name);
        $setter_name = 'set'.ucfirst($entity_name);
        $decoded_entity = $decoded_taf->$getter_name();
        if ($decoded_entity == null || $entity_name == 'clouds' || $entity_name == 'weatherPhenomenons') {
            // that entity is not in the decoded_taf yet, or it's a cloud layer which is a special case
            $decoded_entity = $this->instantiateEntity($entity_name);
        }

        // add the new evolution to that entity
        $decoded_entity->addEvolution($new_evolution);

        // update the decoded taf's entity or add the new one to it
        if ($entity_name == 'clouds') {
            $decoded_taf->addCloud($decoded_entity);
        } elseif ($entity_name == 'weatherPhenomenons') {
            $decoded_taf->addWeatherPhenomenon($decoded_entity);
        } else {
            $decoded_taf->$setter_name($decoded_entity);
        }
    }
private function addEvolution ( $ decoded_taf , $ evolution , $ result , $ entity_name ) { // clone the evolution entity /** @var Evolution $newEvolution */ $ new_evolution = clone ( $ evolution ) ; // add the new entity to it $ new_evolution -> setEntity ( $ result [ $ entity_name ] ) ; // possibly add cavok to it if ( $ entity_name == 'visibility' && $ this -> with_cavok == true ) { $ new_evolution -> setCavok ( true ) ; } // get the original entity from the decoded taf or a new one decoded taf doesn't contain it yet $ getter_name = 'get' . ucfirst ( $ entity_name ) ; $ setter_name = 'set' . ucfirst ( $ entity_name ) ; $ decoded_entity = $ decoded_taf -> $ getter_name ( ) ; if ( $ decoded_entity == null || $ entity_name == 'clouds' || $ entity_name == 'weatherPhenomenons' ) { // that entity is not in the decoded_taf yet, or it's a cloud layer which is a special case $ decoded_entity = $ this -> instantiateEntity ( $ entity_name ) ; } // add the new evolution to that entity $ decoded_entity -> addEvolution ( $ new_evolution ) ; // update the decoded taf's entity or add the new one to it if ( $ entity_name == 'clouds' ) { $ decoded_taf -> addCloud ( $ decoded_entity ) ; } elseif ( $ entity_name == 'weatherPhenomenons' ) { $ decoded_taf -> addWeatherPhenomenon ( $ decoded_entity ) ; } else { $ decoded_taf -> $ setter_name ( $ decoded_entity ) ; } }
Add the evolution to the decodedTaf's entity

@param DecodedTaf $decoded_taf
@param Evolution $evolution
@param array $result
@param string $entity_name
Add the evolution to the decodedTaf s entity