I want to create instances of objects using PDO. I know that there's plently of questions already but I have only found that it is possible to send an array of paramters to a constructor. To me it seems that the constructor can only accept an array as argument. However this would make the constructor less meaningful.
I want to create a class with my own getters and setters like this:
class MyClass {
private propertyA
private propertyB
public __constructor($argA, $argB) {
$this->setPropertyA($argA);
$this->setPropertyB($argB);
}
public setPropertyA($arg) {
$this->proprtyA = $arg;
}
}
Is there an elgant way to create an instance of such a class using data from a database, preferably using PDO.