public function update( string $name, string $title = "", bool $completable = false ): Prop
	{
		$row = self::getEventItem($name);
		if( !$row )
		{
			throw new NotFoundException("Event '{$name}' not found");
		}

		$this->permissible($row->module_id, $name);

		$title = trim($title);
		if( strlen($title) < 1 )
		{
			$title = $name . " event";
		}

		$prop = new Prop([
			"action" => "update",
			"updated" => false
		]);

		if( $title === $row->title && $completable === $row->completable )
		{
			return $prop;
		}

		// dispatch event
		$event = new EventUpdateDriverEvent($this, $name, $title, $completable);
		$dispatcher = EventManager::dispatcher($event->getName());
		$dispatcher->dispatch($event);

		$prop->set(
			"updated",
			\DB::
				table("events")
					->whereId($row->id)
					->update(compact('title', 'completable')) > 0
		);

		$prop->get("updated") && $this->addLogDebug(Text::createInstance("The %s event is successfully updated", $name));
		$dispatcher->complete($prop);
		return $prop;
	}
public function update( string $name, string $title = "", bool $completable = false ): Prop
	{
		$row = self::getEventItem($name);
		if( !$row )
		{
			throw new NotFoundException("Event '{$name}' not found");
		}

		$this->permissible($row->module_id, $name);

		$title = trim($title);
		if( strlen($title) < 1 )
		{
			$title = $name . " event";
		}

		$prop = new Prop([
			"action" => "update",
			"updated" => false
		]);

		if( $title === $row->title && $completable === $row->completable )
		{
			return $prop;
		}

		// dispatch event
		$event = new EventUpdateDriverEvent($this, $name, $title, $completable);
		$dispatcher = EventManager::dispatcher($event->getName());
		$dispatcher->dispatch($event);

		$prop->set(
			"updated",
			\DB::
				table("events")
					->whereId($row->id)
					->update(compact('title', 'completable')) > 0
		);

		$prop->get("updated") && $this->addLogDebug(Text::createInstance("The %s event is successfully updated", $name));
		$dispatcher->complete($prop);
		return $prop;
	}
public function update ( string $ name , string $ title = "" , bool $ completable = false ) : Prop { $ row = self :: getEventItem ( $ name ) ; if ( ! $ row ) { throw new NotFoundException ( "Event '{$name}' not found" ) ; } $ this -> permissible ( $ row -> module_id , $ name ) ; $ title = trim ( $ title ) ; if ( strlen ( $ title ) < 1 ) { $ title = $ name . " event" ; } $ prop = new Prop ( [ "action" => "update" , "updated" => false ] ) ; if ( $ title === $ row -> title && $ completable === $ row -> completable ) { return $ prop ; } // dispatch event $ event = new EventUpdateDriverEvent ( $ this , $ name , $ title , $ completable ) ; $ dispatcher = EventManager :: dispatcher ( $ event -> getName ( ) ) ; $ dispatcher -> dispatch ( $ event ) ; $ prop -> set ( "updated" , \ DB :: table ( "events" ) -> whereId ( $ row -> id ) -> update ( compact ( 'title' , 'completable' ) ) > 0 ) ; $ prop -> get ( "updated" ) && $ this -> addLogDebug ( Text :: createInstance ( "The %s event is successfully updated" , $ name ) ) ; $ dispatcher -> complete ( $ prop ) ; return $ prop ; }
Update event data

@param string $name
@param string $title
@param bool $completable
@return Prop
@throws NotFoundException
Update event data