Insert an object into the menu

@param $slug
@param $callback
@param $object
323521
private function insertMenuObject($slug, $callback, $object)
    {
        $object->slug = $this->snakeName($slug);
        $object->menu = $this->getMenu();

        call_user_func($callback, $object);

        if (! $object->insert) {
            $this->links[] = $object;
        }
    }
1082326
public function addCallback( $type, $callback ) {
		if ( !isset( $this->callbacks[$type] ) ) {
			$this->callbacks[$type] = [];
		}
		$this->callbacks[$type][] = $callback;
	}
1082154
public function executeForEach(Closure $callback): void
    {
        $query = $this->newQuery();

        foreach ($query->cursor() as $entity) {
            $callback($entity);
        }
    }
786401
public function executeFor($id, Closure $callback): void
    {
        $callback(
            $this->newQuery()->findOrFail($id)
        );
    }
1139839
public function setCallback($object, $callbackFunction, $parameters = array())
    {
        $this->callbackObject = $object;

        $this->callbackFunction = $callbackFunction;

        $this->callbackParameters = $parameters;

        return $this;
    }
1107383
protected function redirectTo($object)
    {
        $request = $this->getRequest();
        if ($request->get('btn_create_and_show')) {
            return new RedirectResponse($this->admin->generateObjectUrl('show', $object));
        } else {
            return parent::redirectTo($object);
        }
    }
628779
protected function addToDb(Database\Model &$object)
    {
        $this->FKValue[1] = $object->id;
        $this->doQuery($this->addToDbQuery());
    }
1069569
public function index($object){
        $this->index[(string) $object->slug->relativeTo($this->slug)] = $object;
        $this->paths[(string) $object->path] = $object;
        $this->size += $object->size;
        if ($this->parent){
            $this->parent->attach($object);
        }

    }
728095
public function addLifecycleCallback(string $callback, string $event) : void
    {
        if (isset($this->lifecycleCallbacks[$event]) && in_array($callback, $this->lifecycleCallbacks[$event])) {
            return;
        }

        $this->lifecycleCallbacks[$event][] = $callback;
    }
1274155
public function registerEvent($event, $object, $fn){
		$this->actions[$event][] = new \OWeb\manage\events\Event($object, $fn);
	}
39745
public function push(callable $callback)
    {
        if ($callback instanceof self) {
            $this->queue = array_merge($this->queue, $callback->queue);
            return;
        }

        $this->queue[] = $callback;
    }
52349
public function addItemBefore(mixed $object, string $latter_key, ?string $key = null) : void
    {
        // If the latter key doesn't exist, just add the item to the end.
        if (!isset($this->members[$latter_key])) {
            $this->addItem($object, $key);
            return;
        }
        $position = array_search($latter_key, array_keys($this->members));
        $this->array_insert($object, $key, $position);
    }
1283873
public function postRemove($object): void
    {
        /** @var BlockAdmin $block */
        $block = $this->blockManager->get($object);
        $block->postRemove($object);
    }
137886
public function addAction($slug, $name, $url, $options = [])
    {
        $this->actions[$slug] = ['name' => $name, 'url' => $url, 'options' => $options];

        return $this;
    }
1226145
public function hasCallback($callback, $object = null)
    {
        foreach ($this->callbacks as $rawObject) {
            if ($this->callbacks[$rawObject] === $callback && ($object === null || $object === $rawObject)) {
                return true;
            }
        }

        return false;
    }
288495
public static function register( $slug, $object, $parent = null ) {

		$caller = get_called_class();
		// get the current instance
		if ( empty( $object['type'] ) || ! uix()->is_callable( 'control\\' . $object['type'] ) ) {
			$object['type'] = 'text';
		}

		$caller = $caller . '\\' . $object['type'];

		return new $caller( $slug, $object, $parent );

	}
391506
function(o, callback) {
    var self = this;
    
    // Data is validated prior to being inserted
    var err = this.validateProperties(o);

    if (err) callback.call(self, err);
    
    else {
      
      // Convert object types to strings
      this.convertTypes(o);

      // Set model defaults
      this.setDefaults(o);

      // Save data into the database
      this.driver.insertInto({
        table: this.context,
        values: o
      }, function(err, id) {
        if (err) callback.call(self, err, null);
        else {
          callback.call(self, null, id);
        }
      });
      
    }

  }