Emiliano wrote:
> "Philipp Rotmann, Linksystem Muenchen" wrote:
>
>> On 27.02.01 (21:48), Emiliano wrote:
>>
>>> You mean you added a parameter to the host record? In that
>>> case, lets say you attached a parameter with domain='emile',
>>> name='heyns':
>>>
>>> <?
>>>
>>> $host = mgd_get_host($midgard->host);
>>> echo $host->emile_heyns;
>>>
>>> ?>
>>
>> Does this actually work for all record types?
>
>
> Yes.
>
>
>> Where is this documented,
>
>
> Uhm... good point, I'll add this to the manual right away. I've added
> this
> a long while ago, don't think I really advertized it at all.
>
>
>> how is character conversion done?
>
>
> None is performed. I don't think you'd want to use this with
> non-lower-ascii
> symbols.
>
> I hadn't thought about this before. Of course the parameter is also
> available as
> $host->param('emile', 'heyns'), so there's always a way around this, but
> thinking
> about it, the automatic promotion of params to fields could even be a
> potential
> troublespot. I'm open to suggestions of making this safe, or even
> removal if it
> cannot be made safe.
there are three different cases:
1. removing it, but with a big number of needed parameters, it could be
bad for performance to get them with the method ->parameter()
2. keeping it and get only those that are 'variable safe', but in this
case also, with a big number of un-needed parameters, this is not really
performant when getting only the object (mgd_get_object())
3. create a new function that would fetch all the parameters (or all the
parameters in a domain) in an associative array on-demand.
The third solution is feasible now with the $midgard->types["object"] as
the first parameter of a generic function:
mgd_get_parameters($midgard->types["article"], $id [, $domain]);
or even:
mgd_get_parameters($midgard->types[$obj->__table__], $obj->id [, $domain]);
> Emile
--
Best Regards,
David Guerizec Free Software Developer
Aurora R&D [EMAIL PROTECTED]
Midgard core developer http://www.midgard-project.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]