@param string $buttonId

@return FormSchemaTrait
972081
public function dropButton($buttonId)
    {
        if (array_key_exists($buttonId, $this->buttons)) {
            unset($this->buttons[$buttonId]);
        }
        return $this;
    }
793457
public function setMenuId( $menuId )
    {
        $this->menuId = empty( $menuId ) ? null : (int) $menuId;

        if ( null !== $this->_menu &&
             $this->_menu->id != $this->menuId )
        {
            $this->_menu = null;
        }

        return $this;
    }
1306320
public static function & GetById ($formId) {
		if (isset(self::$instances[$formId])) {
			return self::$instances[$formId];
		} else {
			throw new \RuntimeException(
				'No form instance exists under form id `'.$formId.'`.'
				. ' Check if searched form instance has been already initialized'
				. ' or if form id has been already set.'
			);
		}
	}
1149627
protected static function validate_database($databaseid) {
        global $DB;

        // Request and permission validation.
        $database = $DB->get_record('data', array('id' => $databaseid), '*', MUST_EXIST);
        list($course, $cm) = get_course_and_cm_from_instance($database, 'data');

        $context = context_module::instance($cm->id);
        self::validate_context($context);
        require_capability('mod/data:viewentry', $context);

        return array($database, $course, $cm, $context);
    }
790742
public function setColumnId($columnId)
    {
        $columnId = (string) $columnId;
        if ($columnId === '') {
            throw new \InvalidArgumentException('$columnId cannot be empty');
        }

        $this->columnId = $columnId;

        return $this;
    }
859032
public function getSchema($schemaId = null)
    {

        if (is_null($schemaId)) {
            $schemaId = $this->getCurrentlyUsedDatabaseId();
        }

        if (!$this->schemaExists(self::DATABASE_ID_DEFAULT)) {
            $this->createSchema(self::DATABASE_ID_DEFAULT);
        }

        $pattern = InternalDsn::PATTERN;
        if (!preg_match("/{$pattern}/is", $schemaId)) {
            throw new ErrorException("Invalid database-id '{$schemaId}' given! (Does not match pattern '{$pattern}')");
        }

        if (!isset($this->schemas[$schemaId])) {
            $schemaFilePath = sprintf(FilePathes::FILEPATH_SCHEMA, $schemaId);
            $schemaFile = $this->filesystem->getFile($schemaFilePath);
            $this->schemas[$schemaId] = new DatabaseSchema($schemaFile);
        }

        return $this->schemas[$schemaId];
    }
1200243
public function get($agentId)
    {
        $menus = $this->http->get(self::API_GET.'?agentid='.$agentId);

        return empty($menus['menu']['button']) ? array() : $menus['menu']['button'];
    }
1294723
protected function getAutoSearchForm($targetId)
    {
        if ($this->autoFilter) {
            $model = $this->getModel();
            $data  = $this->getCachedRequestData();

            $this->form = $form = $this->createForm(array('name' => 'autosubmit', 'class' => 'form-inline', 'role' => 'form')); // Assign a name so autosubmit will only work on this form (when there are others)
            $elements = $this->getAutoSearchElements($model, $data);

            if ($elements) {
                //$form = $this->createForm(array('name' => 'autosubmit')); // Assign a name so autosubmit will only work on this form (when there are others)
                $form->setHtml('div');

                $div = $form->getHtml();
                $div->class = 'search';

                $span = $div->div(array('class' => 'panel panel-default'))->div(array('class' => 'inputgroup panel-body'));

                $elements[] = $this->getAutoSearchSubmit($model, $form);

                if ($reset = $this->getAutoSearchReset()) {
                    $elements[] = $reset;
                }

                foreach ($elements as $element) {
                    if ($element instanceof \Zend_Form_Element) {
                        if ($element->getLabel()) {
                            $span->label($element);
                        }
                        $span->input($element);
                        // TODO: Elementen automatisch toevoegen in \MUtil_Form
                        $form->addElement($element);
                    } elseif (null === $element) {
                        $span = $div->div(array('class' => 'panel panel-default'))->div(array('class' => 'inputgroup panel-body'));
                    } else {
                        $span[] = $element;
                    }
                }

                if ($this->_request->isPost()) {
                    if (! $form->isValid($data)) {
                        $this->addMessage($form->getErrorMessages(), 'danger');
                        $this->addMessage($form->getMessages());
                    }
                } else {
                    $form->populate($data);
                }

                $href = $this->getAutoSearchHref();
                $form->setAutoSubmit($href, $targetId);
                //$div[] = new \Gems_JQuery_AutoSubmitForm($href, $targetId, $form);

                return $form;
            }
        }
    }
1233745
public function bulkUploadAction($folderId)
    {
        $em = $this->getDoctrine()->getManager();

        /* @var Folder $folder */
        $folder = $em->getRepository('KunstmaanMediaBundle:Folder')->getFolder($folderId);

        return ['folder' => $folder];
    }
764534
public static function getFolderTreeIds($folderId, $depth = 1)
    {
        $result = \is_array($folderId) ? $folderId : [ $folderId ];

        if ($depth > 1) {
            $folders = self::create()
                ->filterByParent($folderId, Criteria::IN)
                ->withColumn('id')
                ->find();

            foreach ($folders as $folder) {
                $result = array_merge(
                    $result,
                    self::getFolderTreeIds($folder->getId(), $depth - 1)
                );
            }
        }

        return $result;
    }
1075285
private function createDeleteForm($attributeId, $id)
    {
        return $this->createFormBuilder(array('attributeId' => $attributeId, 'id' => $id))
            ->add('attributeId', 'hidden')
            ->add('id', 'hidden')
            ->getForm();
    }
446240
public function &createButton($button_class='Bootstrap\Button\Button')
    {
        $button = $this->factory->create($button_class);

        $this->addButton($button);

        return $button;
    }
147577
public function checkout($layoutId)
    {
        $this->getLogger()->info('Checking out layout ID ' . $layoutId);
        $response = $this->doPut('/layout/checkout/' . $layoutId);

        $layout = $this->constructLayoutFromResponse($response);

        $this->getLogger()->info('LayoutId is now: ' . $layout->layoutId);

        return $layout;
    }
653198
function(formId, customRule) {
        var $form = null, _id = formId;


        if ( !instance['$forms'] ) {
            throw new Error('`$forms` collection not found')
        }


        if ( typeof(_id) == 'undefined') {
            if ( typeof(this.id) != 'undefined' && this.id != '' && this.id != null ) {
                _id = this.id
            } else {
                throw new Error('[ FormValidator::validateFormById(formId, customRule) ] `formId` is missing')
            }
        }

        if ( typeof(_id) == 'string') {
            _id = _id.replace(/\#/, '')
        } else if ( typeof(_id) == 'object' && !Array.isArray(_id) ) { // weird exception

            var $target = _id.form;
            _id = $target.getAttribute('id') || 'form.'+uuid.v1();

            $target.setAttribute('id', _id);// just in case

        } else {
            throw new Error('[ FormValidator::validateFormById(formId[, customRule]) ] `formId` should be a `string`');
        }

        if ( typeof(instance['$forms'][_id]) != 'undefined' ) {
            $form   = this.$forms[_id] = instance['$forms'][_id];
        } else { // binding a form out of context (outside of the main instance)
            var $target             = document.getElementById(_id);
            $validator.id           = _id;
            $validator.target       = $target;

            $form = this.$forms[_id] = instance.$forms[_id] = merge({}, $validator);

            var rule    = null;
            if ( typeof(customRule) == 'undefined') {
                rule = _id.replace(/\-/g, '.');

                if ( typeof(instance.rules[rule]) != 'undefined' ) {
                    $form['rule'] = customRule = instance.rules[rule];
                } else if ( $form.target.getAttribute('data-gina-form-rule') ) {
                    rule = $form.target.getAttribute('data-gina-form-rule').replace(/\-/g, '.');

                    if ( typeof(instance.rules[rule]) != 'undefined' ) {
                        $form['rule'] = instance.rules[rule]
                    } else {
                        throw new Error('[ FormValidator::validateFormById(formId) ] using `data-gina-form-rule` on form `'+$form.target+'`: no matching rule found')
                    }
                } // no else to allow form without any rule
            } else {
                rule = customRule.replace(/\-/g, '.');

                if ( typeof(instance.rules[rule]) != 'undefined' ) {
                    $form['rule'] = instance.rules[rule]
                } else {
                    throw new Error('[ FormValidator::validateFormById(formId, customRule) ] `'+customRule+'` is not a valid rule')
                }
            }

            if ($target && !$form.binded)
                bindForm($target, rule);
        }

        if (!$form) throw new Error('[ FormValidator::validateFormById(formId, customRule) ] `'+_id+'` not found');

        return $form || null;

    }
1280689
public function findButton($id = null, array $relations = array())
    {
        return new Accessor\Form\ButtonAccessor($id, $relations, $this->con);
    }
670759
public function refreshToken($tokenId) {

		$this->storage->removeToken($tokenId);

		$token = new CsrfToken(
			$tokenId,
			$this->generateValue((int) $this->tokenLength)
		);

		$this->storage->setToken($tokenId, $token);

		return $token;

	}
1095888
protected function fillForm($buttonText, $inputs = [])
    {
        if (! is_string($buttonText)) {
            $inputs = $buttonText;

            $buttonText = null;
        }

        return $this->getForm($buttonText)->setValues($inputs);
    }