chore: Move account data models and unit test for account repository.

Signed-off-by: Rubén D <nuxsmin@syspass.org>
This commit is contained in:
Rubén D
2022-07-02 18:01:56 +02:00
parent 11a2509bbb
commit de06ff5b0f
48 changed files with 862 additions and 1354 deletions

View File

@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
* @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org
* @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -42,18 +42,18 @@ trait SerializedModel
* @return mixed|null
* @throws NoSuchPropertyException
*/
public function hydrate(string $class = null, string $property = 'data')
public function hydrate(?string $class = null, string $property = 'data')
{
if (property_exists($this, $property)) {
if ($this->$property === null) {
if ($this->{$property} === null) {
return null;
}
if ($class !== null) {
return Util::unserialize($class, $this->$property);
return Util::unserialize($class, $this->{$property});
}
return unserialize($this->$property);
return unserialize($this->{$property});
}
throw new NoSuchPropertyException($property);