Pagekit\Database\ORM\MetadataManager::subscribe PHP Method

subscribe() protected method

Subscribes model lifecycle callbacks.
protected subscribe ( Pagekit\Database\ORM\Metadata $metadata )
$metadata Pagekit\Database\ORM\Metadata
    protected function subscribe(Metadata $metadata)
    {
        foreach ($metadata->getEvents() as $event => $methods) {
            foreach ($methods as $method) {
                $this->events->on($metadata->getEventPrefix() . '.' . $event, [$metadata->getClass(), $method]);
            }
        }
    }