Gets a specific or all convention rules.

@param  string    $name The name of the convention or `null` to get all.
@return mixed           The closure or an array of closures.
@throws Exception       Throws a `ORMException` if no rule has been found.
178319
public function get($name = null)
    {
        if (!$name) {
            return $this->_conventions;
        }
        if (!isset($this->_conventions[$name])) {
            throw new ORMException("Convention for `'{$name}'` doesn't exists.");
        }
        return $this->_conventions[$name];
    }
1296188
public function getSettingError(string $name): array
    {
        $errors = get_settings_errors($this->getSlug());

        if (empty($errors)) {
            return [];
        }

        return collect($errors)->first(function ($error) use ($name) {
            return $error['code'] === $name;
        });
    }
357076
protected static function getAlgorithm($name)
    {
        if (!isset(self::$algorithms[$name])) {
            self::$algorithms[$name] = new $name();
        }

        return self::$algorithms[$name];
    }
318352
public function findByName($name)
    {
        if (is_null($name)) {
            throw new \Exception('name is required');
        }
        $role = $this->getRepository('\erdiko\users\entities\Role');

        return $role->findOneBy(array('name' => $name));
    }
147253
protected function get($name)
    {
        if (isset($this->site[$name])) {
            return $this->site[$name];
        }

        throw new Exception("The property $name could not be found on the website ID " . (int)$this->id);
    }
1198622
protected function getInstanceRule($name, array $arguments)
    {
        $reflect = new \ReflectionClass($this->rules[$name]);
        return $reflect->newInstanceArgs($arguments);
    }
197389
public function getPattern($name = '')
    {
        if ('' === $name) {
            return $this->pattern;
        }

        return isset($this->pattern[$name]) ? $this->pattern[$name] : null;
    }
234322
public function getReferencedDocumentList($name)
    {
        $referenceList = $this->get($name);
        if (null === $referenceList) {
            return null;
        }

        if (!isset($referenceList[0])) {
            throw new Exception('List of references not found');
        }

        // build list of referenced collections and ids
        $documentIdList = array();
        foreach ($referenceList as $reference) {
            if (empty($reference['$ref']) || empty($reference['$id'])) {
                throw new Exception(sprintf(
                    'Invalid reference in list for document %s in field %s',
                    $this->getId(),
                    $name
                ));
            }

            $documentIdList[$reference['$ref']][] = $reference['$id'];
        }

        // get list
        $documentList = array();
        $database = $this->collection->getDatabase();
        foreach ($documentIdList as $collectionName => $documentIdList) {
            $documentList += $database->getCollection($collectionName)->find()->byIdList($documentIdList)->findAll();
        }

        return $documentList;
    }
616617
private function get(string $name){
		$method = 'magic_get_'.$name;

		return \method_exists($this, $method) ? $this->$method() : null;
	}
507200
public function getErrors($name)
    {
        $field  = $this->getField($name);
        $errors = (null !== $field) ? $field->getErrors() : [];
        return $errors;
    }
693695
public function parseSimpleAnnotation($name) {
    $m = array();
    if (Preg::match($this->body, '/@'.$name.'\s+([^\n]+)/i', $m)) {
      return rtrim($m[1]);
    }
    
    return NULL;
  }
13686
public function GetElement($name)
    {
        $element = $this->Elements()->GetElement($name);
        if (!$element)
        {
            throw new \Exception(Trans('Core.Form.Error.ElementNotFound.Name_{0}', $name));
        }
        return $element;
    }
122596
private function getAttributeIndex(string $name): ?int
    {
        $index = $this->ruleMainIndexes[$name] ?? null;

        return $index;
    }
533847
public function retrieveRule($field, $name = null)
    {
        $key = $this->generateKey(self::DYNAMIC_RULE_KEY, $field);
        $allRules = self::storage()->get($key, []);
        if (empty($name)) {
            return $allRules;
        }

        return isset($allRules[$name]) ? $allRules[$name] : null;
    }
255009
public static function getConstantByName($name)
    {
        switch (strtolower($name)) {
            case 'default':
                return self::DEF;
            break;

            case 'rect':
                return self::RECT;
            break;

            case 'circle':
                return self::CIRCLE;
            break;

            case 'poly':
                return self::POLY;
            break;

            case 'ellipse':
                return self::ELLIPSE;
            break;

            default:
                return false;
            break;
        }
    }
272150
public function getAll($name)
    {
        $s = $this->getNormalizedHeaderName($name);
        $ret = [];
        if (!empty($this->headerMap[$s])) {
            foreach ($this->headerMap[$s] as $index) {
                $ret[] = $this->getByIndex($index);
            }
        }
        return $ret;
    }
1023351
public function get($name)
    {
        if (array_key_exists($name, $this->queryDefinitionMap)) {
            return $this->queryDefinitionMap[$name];
        }

        throw new OutOfBoundsException(
            "Could not find QueryDefinition with name '{$name}'"
        );
    }