Andi Gutmans wrote:
> I haven't quite understood what is wrong with instantiating the object.
i think its faster to just pull out the name (single value) from a
database than the whole object (row or even rows from different tables)
> After all, it most probably reflects some external data (or t
I haven't quite understood what is wrong with instantiating the object.
After all, it most probably reflects some external data (or the name
wouldn't mean anything). Not creating the object itself won't save you
anything. Anyway, you can still do Foo::getName($object_id), if that
$object_id cor
patrick müller wrote:
> Sebastian Mendel wrote:
>
>> how about if i need a name for object not loaded?
>>
>> Class::getName( $object_id );
>>
>
> Weird, i thought you must know the classname for a static
> call :)
not the classname, the objectname f.e. the name for the object of type
customer wit
Sebastian Mendel wrote:
how about if i need a name for object not loaded?
Class::getName( $object_id );
Weird, i thought you must know the classname for a static
call :)
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Sean Coates wrote:
>> i know this hack, but it does not work, if the statically called method
>> is from the same class as the calling object
>
> Good point. Sorry for not noticing.
> ... I have no idea WHY someone would want to do this.. that said, I
> don't know of a way to do it, either.
a fun
i know this hack, but it does not work, if the statically called method
is from the same class as the calling object
Good point. Sorry for not noticing.
.. I have no idea WHY someone would want to do this.. that said, I don't
know of a way to do it, either.
S
--
PHP Internals - PHP Runtime D
Sean Coates schrieb:
>> how can i check if a method is called statically when called from inside
>> another object? (without debug_bactrace())
>
> type="own">http://blog.phpdoc.info/archives/4-Schizophrenic-Methods.html
>
> Short answer:
> $isStatic = !(isset($this) && get_class($this) == __CLAS
how can i check if a method is called statically when called from inside
another object? (without debug_bactrace())
type="own">http://blog.phpdoc.info/archives/4-Schizophrenic-Methods.html
Short answer:
$isStatic = !(isset($this) && get_class($this) == __CLASS__);
HTH
S
--
PHP Internals - P