mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
WIP mc search nodes
This commit is contained in:
parent
81cdfdbaa1
commit
9d40f900ba
@ -51,6 +51,26 @@ abstract class Entity
|
|||||||
protected $table = '';
|
protected $table = '';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instances a new object using array definition.
|
||||||
|
*
|
||||||
|
* @param string $class_str Class name.
|
||||||
|
* @param array $data Fields data.
|
||||||
|
*
|
||||||
|
* @return object With current definition.
|
||||||
|
*/
|
||||||
|
public static function build(string $class_str, array $data=[])
|
||||||
|
{
|
||||||
|
$obj = new $class_str();
|
||||||
|
// Set values.
|
||||||
|
foreach ($data as $k => $v) {
|
||||||
|
$obj->{$k}($v);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines a generic constructor to extract information of the object.
|
* Defines a generic constructor to extract information of the object.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user