p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo} span.s1 {font-variant-ligatures: no-common-ligatures}
I've added a new class "Reflection":
class Reflection extends ElggObject {
It's registered in activate.php:
if (get_subtype_id('object', 'reflection')) {
update_subtype('object', 'reflection', 'Reflection');
} else {
add_subtype('object', 'reflection', 'Reflection');
}
But when I save it:
$reflection = new Reflection();
$reflection->subtype = 'reflection';
...
$reflection->save();
it fails:
Call to undefined method Reflection::save()
I'm new to PHP but the Object extension I'm doing seems standard. Anyone know what's wrong?
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- ihayredinov@ihayredinov
ihayredinov - 1 like
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- Tony Pianta@tpianta
Tony Pianta - 0 likes
You must log in to post replies.Reflection is a bundled PHP class: http://php.net/manual/en/book.reflection.php
Add a namespace or use something less likely to collide.
Make sure the class is PSR-0 compliant, so put it in /mod/cool_project/classes/CoolProject/Reflection.php
That makes perfect sense, thank you!