src/Draggy/Autocode/Project.php
public function getActualAttributeName(Entity $entity, $name, $hint = '', $force = false)
    {
        if ($entity->hasAttributeByName($name) || $force) {
            if (!$entity->hasAttributeByName($name . $hint)) {
                return [$name, $hint];
            }

            $append = 1;

            while ($entity->hasAttributeByName($name . $append . $hint)) {
                $append++;
            }

            return [$name . $append, $hint];
        }

        return [$name, ''];
    }
public function getActualAttributeName(Entity $entity, $name, $hint = '', $force = false)
    {
        if ($entity->hasAttributeByName($name) || $force) {
            if (!$entity->hasAttributeByName($name . $hint)) {
                return [$name, $hint];
            }

            $append = 1;

            while ($entity->hasAttributeByName($name . $append . $hint)) {
                $append++;
            }

            return [$name . $append, $hint];
        }

        return [$name, ''];
    }
public function getActualAttributeName ( Entity $ entity , $ name , $ hint = '' , $ force = false ) { if ( $ entity -> hasAttributeByName ( $ name ) || $ force ) { if ( ! $ entity -> hasAttributeByName ( $ name . $ hint ) ) { return [ $ name , $ hint ] ; } $ append = 1 ; while ( $ entity -> hasAttributeByName ( $ name . $ append . $ hint ) ) { $ append ++ ; } return [ $ name . $ append , $ hint ] ; } return [ $ name , '' ] ; }
Sometimes the automatic name cannot be used because the entity already has an attribute with that name or because is linked many times.
This method gives an actual final name that will be unique.

@param Entity  $entity
@param string  $name
@param string  $hint
@param boolean $force If it should force the use of the hint

@return array
Sometimes the automatic name cannot be used because the entity already has an attribute with that name or because is linked many times . This method gives an actual final name that will be unique .