LMongo\Eloquent\Model::boot PHP Method

boot() protected static method

The "booting" method of the model.
protected static boot ( ) : void
return void
    protected static function boot()
    {
        $class = get_called_class();
        static::$mutatorCache[$class] = array();
        // Here we will extract all of the mutated attributes so that we can quickly
        // spin through them after we export models to their array form, which we
        // need to be fast. This will let us always know the attributes mutate.
        foreach (get_class_methods($class) as $method) {
            if (preg_match('/^get(.+)Attribute$/', $method, $matches)) {
                if (static::$snakeAttributes) {
                    $matches[1] = snake_case($matches[1]);
                }
                static::$mutatorCache[$class][] = lcfirst($matches[1]);
            }
        }
    }
Model