-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set private properties in CodeIgniter\Database\BaseResult::getCustomResultObject() #3051
Comments
This is more like a support question so in the future please post questions on our forum. Well... obviously constructor arguments are not supported, but you can handle setters via magic |
In this case not entity, It is std Object. |
I don't think that |
class CustomClass $this->customResultObject[$className][$i]->$key = $value; |
As I mentioned before - use magic public function __set($key, $value)
{
$method = 'set' . ucfirts($key);
if (method_exists($this, $method))
{
$this->$method($value);
}
} |
CodeIgniter\Database\BaseResult::getCustomResultObject(string $className)
In this function directly access member properties and assign values
like this
$this->customResultObject[$className][$i]->$key = $value;
So, can't set private properties.
But. How to use 'setter' or 'constructor arguments'?
The text was updated successfully, but these errors were encountered: