Upgrade to 3.2.4
This commit is contained in:
@@ -70,14 +70,6 @@ class File extends ModelWithContent
|
||||
*/
|
||||
public static $methods = [];
|
||||
|
||||
/**
|
||||
* Registry with all File models
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $models = [];
|
||||
|
||||
|
||||
/**
|
||||
* The parent object
|
||||
*
|
||||
@@ -266,18 +258,13 @@ class File extends ModelWithContent
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a File object and also
|
||||
* takes File models into account.
|
||||
* Constructs a File object
|
||||
*
|
||||
* @internal
|
||||
* @return self
|
||||
*/
|
||||
public static function factory($props)
|
||||
{
|
||||
if (empty($props['model']) === false) {
|
||||
return static::model($props['model'], $props);
|
||||
}
|
||||
|
||||
return new static($props);
|
||||
}
|
||||
|
||||
@@ -375,27 +362,6 @@ class File extends ModelWithContent
|
||||
return $this->content();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a file model if it has been registered
|
||||
*
|
||||
* @internal
|
||||
* @param string $name
|
||||
* @param array $props
|
||||
* @return Kirby\Cms\File
|
||||
*/
|
||||
public static function model(string $name, array $props = [])
|
||||
{
|
||||
if ($class = (static::$models[$name] ?? null)) {
|
||||
$object = new $class($props);
|
||||
|
||||
if (is_a($object, 'Kirby\Cms\File') === true) {
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
|
||||
return new static($props);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the file's last modification time.
|
||||
*
|
||||
|
Reference in New Issue
Block a user