Get or Set a unique alias for the query or a query's relation if $relpath is set.
public alias ( mixed $alias = true, string $relpath = null ) : string | ||
$alias | mixed | The value of the alias to set for the passed `$relpath`. For getting an alias value set alias to `true`. |
$relpath | string | A dotted relation name or `null` for identifying the query's model. |
return | string | An alias value or `null` for an unexisting `$relpath` alias. |