PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Authentication » LiveUser » Bug #1924

Possibility to define Aliases for Tablefields in LiveUser::Admin

Details

Request #1924Possibility to define Aliases for Tablefields in LiveUser::Admin
Submitted2004-07-20 11:44 UTC
Fromnaturalkiller at gmx dot net
StatusClosed
PackageLiveUser
PHP VersionIrrelevant
OSIrrelevant
Roadmaps(Not assigned)

Comments

[2004-07-20 11:44 UTC] naturalkiller at gmx dot net

Description:
------------
To integrate LiveUser in other packages like Quickform it might be handsom to be able to define alias names for table fields in LiveUser::Admin. Currently there is the possibility to define name and type of a requires|optional field in the liveuser config array:

'authContainers' => array(
array(
'authTableCols' => array(
'optional' => array(
'owner_user_id' => array('type' => 'text', 'name' => 'owner_user_id' ),
...

This is used to build the query in this way ( ie searchUser ):

...
if (isset($this->authTableCols['optional']['owner_user_id'])) {
$customFields[] = $this->authTableCols['optional']['owner_user_id']['name'] . ' AS auth_user_id';
}
...

Now my idea was to add a third value to the configuration called 'alias' and change the code to:

...
if (isset($this->authTableCols['optional']['owner_user_id'])) {
$customFields[] = $this->authTableCols['optional']['owner_user_id']['name'] . ' AS ' . $this->authTableCols['optional']['owner_user_id']['alias'];
}
...

So you can predefine the aliases to pass the result directly to other classes.

[2004-07-20 18:21 UTC] smith at backendmedia dot com

I think we have alias support for custom fields. For required and optional fields it might be taking things too far. However using aliasing and the custom fields you could even fetch the required and optional fields again.

[2004-10-11 11:46 UTC] smith at backendmedia dot com

We have complete support for aliasing via the authTableCols and permGroupsCols conf options:
'alias' => ('type' => 'field_type', 'name' => 'field_name')