Question

I have a Model which I would like to use all variables in a drop down lis on a form.

protected $_scheduledTime;
protected $_isLive;
protected $_isQueued;
protected $_url;

I was hoping, something like this would work, but it doesn't

public function getMethods() {
    $methods = getclass_methods($this);
    return $methods;
}

Calling this returns this fatal error:

Fatal error: Call to undefined function getclass_methods()

What I want to achieve is an automatically updated form options when I update the model (which, could be quite frequently)

I might have answered my own question, in that I would build an array in the model that returns upon a call... but if there is already a method that can do this, then it would be much appreciated.

Thank you in advance.

Was it helpful?

Solution

get_declared_classes() // gives you all declared classes
get_class_methods() // gives you all methods of class
get_class_vars() // gives you properties of the class
get_object_vars() // gives you propertis of an object
get_parent_class()  // gives you parent class of the current class

OTHER TIPS

The function is get_class_methods, not getclass_methods (missing an '_')

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top