public static function log(AuditEntry $entry, $exception) { $error = new static(); $error->entry = $entry; $error->record($exception); return $error->save(false) ? $error : null; }
public static function create($initialise = true) { $entry = new static(); if ($initialise) { $entry->record(); } return $entry; }
public static function open(AccountNumber $number) { $account = new static(); $account->applyAccountOpenedEvent($account->record(new AccountOpenedEvent($number))); return $account; }
/** * @param TaskListId $id * * @return TaskList */ public static function start(TaskListId $id) { $taskList = new static($id); $taskList->record(new TaskListWasStarted($id)); return $taskList; }
/** * Массив результатов работы фильтров * * @param string|array $filter - фильтры * @return array */ protected function filters_result($filter) { $filters = array(); if (is_array($filter)) { foreach ($filter as $name) { $filters = array_merge($filters, $this->filters_result($name)); } } else { static::$record = false; $filters[] = array_key_exists($filter, $this->filters) ? (bool) call_user_func($this->filters[$filter]) : false; static::$record = true; } return $filters; }