Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- abstract class Entity {
- abstract public function getEntityType() : int;
- public function compareHash(array $dataItem) : bool {
- // todo
- // Return big array from data base
- $hashBase = (new HashBase())->getData($this->getEntityType());
- }
- }
- abstract class Entity {
- abstract public function getEntityType() : int;
- public static $hashBaseArr = [];
- public function compareHash(array $dataItem) : bool {
- // todo
- // Return big array from data base
- if ( !isset(static::$hashBaseArr[get_called_class()]) ) {
- static::$hashBaseArr[get_called_class()] = (new HashBase())->getData($this->getEntityType());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement