Upgrade to 3.2.4

This commit is contained in:
Bastian Allgeier
2019-09-03 11:01:57 +02:00
parent f79bc3248c
commit ff9b5b1861
25 changed files with 1053 additions and 140 deletions

View File

@@ -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.
*