orm intefrace changes and cleanup
This commit is contained in:
@@ -81,7 +81,7 @@ abstract class Entity implements IEntity
|
||||
}
|
||||
}
|
||||
|
||||
public function clear($name = null)
|
||||
public function clear(?string $name = null)
|
||||
{
|
||||
if (is_null($name)) {
|
||||
$this->reset();
|
||||
@@ -126,7 +126,7 @@ abstract class Entity implements IEntity
|
||||
}
|
||||
}
|
||||
|
||||
public function get($name, $params = [])
|
||||
public function get(string $name, $params = [])
|
||||
{
|
||||
if ($name == 'id') {
|
||||
return $this->id;
|
||||
@@ -148,7 +148,7 @@ abstract class Entity implements IEntity
|
||||
return null;
|
||||
}
|
||||
|
||||
public function has($name)
|
||||
public function has(string $name)
|
||||
{
|
||||
if ($name == 'id') {
|
||||
return !!$this->id;
|
||||
|
||||
@@ -33,4 +33,3 @@ interface ICollection
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -56,37 +56,27 @@ interface IEntity
|
||||
const HAS_CHILDREN = 'hasChildren';
|
||||
|
||||
/**
|
||||
* Push values from the array.
|
||||
* E.g. insert values into the bean from a request data.
|
||||
* @param array $arr Array of field - value pairs
|
||||
*/
|
||||
function populateFromArray(array $arr);
|
||||
|
||||
/**
|
||||
* Resets all fields in the current model.
|
||||
* Resets all attributes in the current model.
|
||||
*/
|
||||
function reset();
|
||||
|
||||
/**
|
||||
* Set field.
|
||||
* Set attribute.
|
||||
*/
|
||||
function set($name, $value);
|
||||
|
||||
/**
|
||||
* Get field.
|
||||
* Get attribute.
|
||||
*/
|
||||
function get($name);
|
||||
function get(string $name);
|
||||
|
||||
/**
|
||||
* Check field is set.
|
||||
* Check attribute is set.
|
||||
*/
|
||||
function has($name);
|
||||
function has(string $name);
|
||||
|
||||
/**
|
||||
* Clear field.
|
||||
* Clear attribute.
|
||||
*/
|
||||
function clear($name);
|
||||
|
||||
function clear(?string $name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -65,4 +65,3 @@ class RepositoryFactory
|
||||
$this->defaultRepositoryClassName = $defaultRepositoryClassName;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user