Returns the definition.

@return Definition
186822
protected function getDefinition(): Definition
    {
        if (isset(self::$definitions[static::class])) {
            return self::$definitions[static::class];
        }

        $definition = new Definition();

        $this->buildDefinition($definition);

        return self::$definitions[static::class] = $definition;
    }
780073
protected function getDefinition(): DefinitionInterface
    {
        if ($this->definition === null) {
            $this->definition = (new Definition())
                ->addOption(new Option('verbose', 'Be more verbose.', 'v', 'verbose', true, true))
                ->addOption(new Option('help', 'Show help about shell or command.', 'h', 'help'));
        }

        return $this->definition;
    }
93758
public ProcessDefinitionEntity getPreviousDefinition() {
    ProcessDefinitionEntity previousProcessDefinition = null;

    String previousProcessDefinitionId = getPreviousProcessDefinitionId();
    if (previousProcessDefinitionId != null) {

      previousProcessDefinition = loadProcessDefinition(previousProcessDefinitionId);

      if (previousProcessDefinition == null) {
        resetPreviousProcessDefinitionId();
        previousProcessDefinitionId = getPreviousProcessDefinitionId();

        if (previousProcessDefinitionId != null) {
          previousProcessDefinition = loadProcessDefinition(previousProcessDefinitionId);
        }
      }
    }

    return previousProcessDefinition;
  }
918272
public function getNamespaceDefinition() {
        $namespaceDefinition = $this instanceof NamespaceDefinition
            ? $this
            : $this->getFirstAncestor(NamespaceDefinition::class, SourceFileNode::class);

        if ($namespaceDefinition instanceof NamespaceDefinition && !($namespaceDefinition->parent instanceof SourceFileNode)) {
            $namespaceDefinition = $namespaceDefinition->getFirstAncestor(SourceFileNode::class);
        }

        if ($namespaceDefinition === null) {
            // TODO provide a way to throw errors without crashing consumer
            throw new \Exception("Invalid tree - SourceFileNode must always exist at root of tree.");
        }

        $fullStart = $this->getFullStart();
        $lastNamespaceDefinition = null;
        if ($namespaceDefinition instanceof SourceFileNode) {
            foreach ($namespaceDefinition->getChildNodes() as $childNode) {
                if ($childNode instanceof NamespaceDefinition && $childNode->getFullStart() < $fullStart) {
                    $lastNamespaceDefinition = $childNode;
                }
            }
        }

        if ($lastNamespaceDefinition !== null && $lastNamespaceDefinition->compoundStatementOrSemicolon instanceof Token) {
            $namespaceDefinition = $lastNamespaceDefinition;
        } elseif ($namespaceDefinition instanceof SourceFileNode) {
            $namespaceDefinition = null;
        }

        return $namespaceDefinition;
    }
224919
public final function definition() {
        global $CFG;
        $mform = $this->_form;
        $editoroptions = $this->_customdata['editoroptions'];

        if ($this->qtypestring != 'selectaqtype') {
            if ($this->_customdata['edit']) {
                $mform->addElement('header', 'qtypeheading', get_string('edit'. $this->qtypestring, 'lesson'));
            } else {
                $mform->addElement('header', 'qtypeheading', get_string('add'. $this->qtypestring, 'lesson'));
            }
        }

        if (!empty($this->_customdata['returnto'])) {
            $mform->addElement('hidden', 'returnto', $this->_customdata['returnto']);
            $mform->setType('returnto', PARAM_URL);
        }

        $mform->addElement('hidden', 'id');
        $mform->setType('id', PARAM_INT);

        $mform->addElement('hidden', 'pageid');
        $mform->setType('pageid', PARAM_INT);

        if ($this->standard === true) {
            $mform->addElement('hidden', 'qtype');
            $mform->setType('qtype', PARAM_INT);

            $mform->addElement('text', 'title', get_string('pagetitle', 'lesson'), array('size'=>70));
            $mform->addRule('title', get_string('required'), 'required', null, 'client');
            if (!empty($CFG->formatstringstriptags)) {
                $mform->setType('title', PARAM_TEXT);
            } else {
                $mform->setType('title', PARAM_CLEANHTML);
            }

            $this->editoroptions = array('noclean'=>true, 'maxfiles'=>EDITOR_UNLIMITED_FILES, 'maxbytes'=>$this->_customdata['maxbytes']);
            $mform->addElement('editor', 'contents_editor', get_string('pagecontents', 'lesson'), null, $this->editoroptions);
            $mform->setType('contents_editor', PARAM_RAW);
            $mform->addRule('contents_editor', get_string('required'), 'required', null, 'client');
        }

        $this->custom_definition();

        if ($this->_customdata['edit'] === true) {
            $mform->addElement('hidden', 'edit', 1);
            $mform->setType('edit', PARAM_BOOL);
            $this->add_action_buttons(get_string('cancel'), get_string('savepage', 'lesson'));
        } else if ($this->qtype === 'questiontype') {
            $this->add_action_buttons(get_string('cancel'), get_string('addaquestionpage', 'lesson'));
        } else {
            $this->add_action_buttons(get_string('cancel'), get_string('savepage', 'lesson'));
        }
    }
189077
public function getSchema()
    {
        if ($this->_schema === null) {
            $this->_schema = $this->_initializeSchema($this->getWebservice()->describe($this->getName()));
        }

        return $this->_schema;
    }
1273562
public function getUsage()
    {
        if (!$this->isParsed) {
            $this->parseDefinitions();
        } //if

        /* build list of argument names and calculate
           the first column width so we can pad to 
           align definitions */
        $firstCol = array();
        $longestDef = 0;
        foreach (array_keys($this->longNames) as $longName) {
            ob_start();
            echo "--{$longName}|-{$this->getShortName($longName)}";

            if ($this->allowsValue($longName)) {
                echo "={$this->getValueType($longName)}";
            } //if

            if ($this->allowsMultiple($longName)) {
                echo "+";
            } //if

            $defLength = ob_get_length();

            $longestDef = max($longestDef, $defLength);

            $firstCol[$longName] = ob_get_contents();
            ob_end_clean();

        } //foreach

        $firstColMaxWidth = $longestDef + 4;

        ob_start();

        foreach ($firstCol as $longName => $def) {
            $currentDefLength = strlen($def);

            $padding = str_repeat(" ", $firstColMaxWidth - $currentDefLength);

            echo "{$def}{$padding}{$this->getDescription($longName)}", PHP_EOL;
        } //foreach

        echo PHP_EOL;

        $usage = ob_get_contents();
        ob_end_clean();
        
        return $usage;

    }
1138148
public function typeDefinitions(): Collection
    {
        return $this->definitionMap
            ->filter(function (DefinitionNode $node) {
                return $node instanceof ScalarTypeDefinitionNode
                    || $node instanceof ObjectTypeDefinitionNode
                    || $node instanceof InterfaceTypeDefinitionNode
                    || $node instanceof UnionTypeDefinitionNode
                    || $node instanceof EnumTypeDefinitionNode
                    || $node instanceof InputObjectTypeDefinitionNode;
            });
    }
63541
public static function &GetDefinitions()
    {
        if(!self::ValidExtension())
        {
            CommandLine\Error::Show(t("Invalid extension directory, definitions could not be loaded."));
        }

        if(!is_object(self::$symbols))
        {
            self::$symbols = new Definitions\Symbols;
            
            $importer = new Definitions\Importer(
                self::$symbols, 
                "definitions",
                Definitions\Type::JSON
            );
            
            $importer->Start();
        }

        return self::$symbols;
    }
208455
public function getSchema()
    {
        if ($this->_schema === null) {
            $this->_schema = $this->_initializeSchema(
                $this->getConnection()
                    ->getSchemaCollection()
                    ->describe($this->getTable())
            );
        }

        return $this->_schema;
    }
1442
public function getName()
    {
        if ($this->_name === null) {
            $this->_name = ((new \ReflectionClass($this))->getShortName());
        }
        
        return $this->_name;
    }
876364
public function getFormatted()
    {
        if ($this->getUnit() != "") {
            return $this->getValue() . " " . $this->getUnit();
        } else {
            return (string)$this->getValue();
        }
    }
978367
public function definition() {
        $mform =& $this->_form;

        $types = (FILE_INTERNAL | FILE_REFERENCE | FILE_CONTROLLED_LINK);
        $options = array('subdirs' => 0, 'maxfiles' => -1, 'accepted_types' => '*', 'return_types' => $types);

        $mform->addElement('filemanager', 'files_filemanager', get_string('files'), null, $options);

        $mform->addElement('hidden', 'contextid', $this->_customdata['contextid']);
        $mform->setType('contextid', PARAM_INT);

        $mform->addElement('hidden', 'currentcontext', $this->_customdata['currentcontext']);
        $mform->setType('currentcontext', PARAM_INT);

        $mform->addElement('hidden', 'filearea', $this->_customdata['filearea']);
        $mform->setType('filearea', PARAM_AREA);

        $mform->addElement('hidden', 'component', $this->_customdata['component']);
        $mform->setType('component', PARAM_COMPONENT);

        $mform->addElement('hidden', 'returnurl', $this->_customdata['returnurl']);
        $mform->setType('returnurl', PARAM_URL);

        $this->add_action_buttons(true, get_string('savechanges'));
        $this->set_data($this->_customdata['data']);
    }
1276841
public function getDefinition(string $name)
    {
        if ($this->hasDefinition($name)) {
            return $this->definitions[$name];
        }
        return null;
    }
101329
static public function definition()
    {
        return array( 'fields'              => array( 'id'               => array( 'name'     => 'ID',
                                                                                   'datatype' => 'integer',
                                                                                   'default'  => 0,
                                                                                   'required' => true ),
                                                      'parent_id'        => array( 'name'     => 'ParentID',
                                                                                   'datatype' => 'integer',
                                                                                   'default'  => null,
                                                                                   'required' => false ),
                                                      'main_tag_id'      => array( 'name'     => 'MainTagID',
                                                                                   'datatype' => 'integer',
                                                                                   'default'  => null,
                                                                                   'required' => false ),
                                                      'keyword'          => array( 'name'     => 'Keyword',
                                                                                   'datatype' => 'string',
                                                                                   'default'  => '',
                                                                                   'required' => false ),
                                                      'depth'            => array( 'name'     => 'Depth',
                                                                                   'datatype' => 'integer',
                                                                                   'default'  => 1,
                                                                                   'required' => false ),
                                                      'path_string'      => array( 'name'     => 'PathString',
                                                                                   'datatype' => 'string',
                                                                                   'default'  => '',
                                                                                   'required' => false ),
                                                      'modified'         => array( 'name'     => 'Modified',
                                                                                   'datatype' => 'integer',
                                                                                   'default'  => 0,
                                                                                   'required' => false ),
                                                      'remote_id'        => array( 'name'     => 'RemoteID',
                                                                                   'datatype' => 'string',
                                                                                   'default'  => '',
                                                                                   'required' => true ),
                                                      'main_language_id' => array( 'name'     => 'MainLanguageID',
                                                                                   'datatype' => 'integer',
                                                                                   'default'  => 0,
                                                                                   'required' => false ),
                                                      'language_mask'    => array( 'name'     => 'LanguageMask',
                                                                                   'datatype' => 'integer',
                                                                                   'default'  => 0,
                                                                                   'required' => false ) ),
                      'function_attributes' => array( 'parent'                    => 'getParent',
                                                      'children'                  => 'getChildren',
                                                      'children_count'            => 'getChildrenCount',
                                                      'related_objects'           => 'getRelatedObjects',
                                                      'related_objects_count'     => 'getRelatedObjectsCount',
                                                      'subtree_limitations'       => 'getSubTreeLimitations',
                                                      'subtree_limitations_count' => 'getSubTreeLimitationsCount',
                                                      'main_tag'                  => 'getMainTag',
                                                      'synonyms'                  => 'getSynonyms',
                                                      'synonyms_count'            => 'getSynonymsCount',
                                                      'is_synonym'                => 'isSynonym',
                                                      'icon'                      => 'getIcon',
                                                      'url'                       => 'getUrl',
                                                      'clean_url'                 => 'getCleanUrl',
                                                      'path'                      => 'getPath',
                                                      'path_count'                => 'getPathCount',
                                                      'keyword'                   => 'getKeyword',
                                                      'available_languages'       => 'getAvailableLanguages',
                                                      'current_language'          => 'getCurrentLanguage',
                                                      'language_name_array'       => 'languageNameArray',
                                                      'main_translation'          => 'getMainTranslation',
                                                      'translations'              => 'getTranslations',
                                                      'translations_count'        => 'getTranslationsCount',
                                                      'always_available'          => 'isAlwaysAvailable' ),
                      'keys'                => array( 'id' ),
                      'increment_key'       => 'id',
                      'class_name'          => 'eZTagsObject',
                      'name'                => 'eztags' );
    }
1071567
public function getDefinition($name)
    {
        if (!class_exists($name) && !interface_exists($name)) {
            return null;
        }

        $class = new \ReflectionClass($name);
        if(isset($name::$__enableDIAnnotations__) && $name::$__enableDIAnnotations__){
            $context = $this->loader->build($name);
            /**@var $context ObjectDefinitionContext */
            $definition = $context->definition;
        }else{
            $definition = new ObjectDefinition($name);
        }

        $constructor = $class->getConstructor();
        if ($constructor && $constructor->isPublic()) {
            $definition->setConstructorInjection(
                MethodInjection::constructor($this->getParametersDefinition($constructor))
            );
        }

        return $definition;
    }
204563
public Map<String, AnnotationDefinition> getDefinitionMap() {
        if (definitions == null) {
            return emptyMap();
        }
        final Map<String, AnnotationDefinition> ret =
                new HashMap<String, AnnotationDefinition>(definitions.size());
        for (final AnnotationDefinition ad : definitions) {
            ret.put(ad.getId(), ad);
        }
        return ret;
    }