public function ensureElementalAreasExist($elementalAreaRelations)
    {
        foreach ($elementalAreaRelations as $eaRelationship) {
            $areaID = $eaRelationship . 'ID';

            if (!$this->owner->$areaID) {
                $area = ElementalArea::create();
                $area->OwnerClassName = get_class($this->owner);
                $area->write();
                $this->owner->$areaID = $area->ID;
            }
        }
        return $this->owner;
    }
public function ensureElementalAreasExist($elementalAreaRelations)
    {
        foreach ($elementalAreaRelations as $eaRelationship) {
            $areaID = $eaRelationship . 'ID';

            if (!$this->owner->$areaID) {
                $area = ElementalArea::create();
                $area->OwnerClassName = get_class($this->owner);
                $area->write();
                $this->owner->$areaID = $area->ID;
            }
        }
        return $this->owner;
    }
public function ensureElementalAreasExist ( $ elementalAreaRelations ) { foreach ( $ elementalAreaRelations as $ eaRelationship ) { $ areaID = $ eaRelationship . 'ID' ; if ( ! $ this -> owner -> $ areaID ) { $ area = ElementalArea :: create ( ) ; $ area -> OwnerClassName = get_class ( $ this -> owner ) ; $ area -> write ( ) ; $ this -> owner -> $ areaID = $ area -> ID ; } } return $ this -> owner ; }
Set all has_one relationships to an ElementalArea to a valid ID if they're unset

@param array $elementalAreaRelations indexed array of relationship names that are to ElementalAreas
@return DataObject
Set all has_one relationships to an ElementalArea to a valid ID if they re unset