LazyRecord\BaseModel::__construct PHP Method

__construct() public method

This constructor simply does nothing if no argument is passed. If the first argument is an integer, the record object will try to load the record by primary key with the given integer. If the first argument is an array, the record object will try to look up the record by treating the array as conditions, just like where([ ... ]) To avoid record object load the data, you can specify ['load' => false] as the option
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);
                }
            }
        }
    }