public __construct ( mixed $args = null, array $options = [] ) | ||
$args | mixed | arguments for finding |
$options | array | constructor options |
public function __construct($args = null, array $options = array())
{
// Load the data only when the ID is defined.
if ($args) {
if (is_int($args)) {
$this->load($args);
} elseif (is_array($args)) {
if (isset($options['load']) && $options['load'] === false) {
$this->setData($args);
} else {
$this->load($args);
}
}
}
}