Get the index of a migration by name. It return -1 if not found.

@param string $name

@return int
546914
public function getMigrationIndex($name)
    {
        foreach ($this->getMigrations() as $key => $migration) {
            if ($migration->name == $name) {
                return $key;
            }
        }

        return -1;
    }
122596
private function getAttributeIndex(string $name): ?int
    {
        $index = $this->ruleMainIndexes[$name] ?? null;

        return $index;
    }
677019
public function offsetGet($name)
    {
        $result = null;

        if (isset($this->_data[$name])) {
            $result = $this->_data[$name]->value;
        }

        return $result;
    }
547807
public function getQueueId($name)
    {
        $sql = 'SELECT queue_id FROM ' . $this->queueTable . ' WHERE queue_name = ? LIMIT 1';
        $stmt = $this->getDb()->prepare($sql);
        $stmt->execute(array($name));
        return $stmt->fetchColumn();
    }
1244947
public static function getLevelValue($name)
    {
        $name = strtoupper($name);
        $map = (new \ReflectionClass(self::class))->getConstants();

        return (isset($map[$name]))? $map[$name] : null;
    }
69557
public int getFieldTemplateIndex(final String name) {
        for ( int index = 0; index < this.fields.length; index++ ) {
            if ( this.fields[index].getName().equals( name ) ) {
                return index;
            }
        }
        return -1;
    }
508775
static int getIndex(CharSequence name) {
        Integer index = STATIC_INDEX_BY_NAME.get(name);
        if (index == null) {
            return -1;
        }
        return index;
    }
812101
protected function getFieldNumber($name)
    {
        $no = pg_field_num($this->handler, "\"$name\"");

        if ($no ===  -1) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Could not find field name '%s'. Available fields are {%s}.",
                    $name,
                    join(', ', array_keys(pg_fetch_assoc($this->handler)))
                )
            );
        }

        return $no;
    }
1346128
private function getAttributeIndex(string $name): ?int
    {
        $indexes = $this->getSerializer()::readRulesIndexes($this->getAttributeRules());
        $index   = $indexes[$name] ?? null;

        return $index;
    }
526047
final public function findIndexColumnByName(string $name): ? IndexColumn
    {
        /** @var IndexColumn $indexColumn */
        foreach ($this->columns as $indexColumn) {
            $column = $indexColumn->getColumn();
            if ($column::getName() === $name) {
                return $indexColumn;
            }
        }

        return null;
    }
553362
protected function getTid($name)
    {
        return sha1($this->connection->resourceId . $this->connection->WAMP->sessionId . $name);
    }
813667
public static function getValues($name, $index = 'code') {
		if($property_id = self::getId($name)) {
			$a = [];
			foreach(Lookup::find()
				->select(['position', 'name'])
				->where(['property_id' => $property_id])
				->orderBy($index)->all() as $item)
				$a[$item->$index] = $item->name;
			return $a;
		} else
			return null;
	}
376934
protected function getIniSize($name)
    {
        $size = ini_get($name);
        return is_numeric($size) ? $this->fromBytes($size) : $size;
    }
1028128
protected function getPath($name)
    {
        $name = str_replace($this->laravel->getNamespace(), '', $name);
        $datePrefix = date('Y_m_d_His');

        return database_path('/migrations/') . $datePrefix . '_create_' . $name . '_table.php';
    }
880610
function dropIndex($name)
    {

        $index = new Index($name);

        $index->connection = $this->connection;

        return $index->drop();
    }
1833
final public function &__get($name)
    {
        $value = $this->data[$name];

        //Apply accessor
        $this->applyModifier($name, $value, 'get');

        return $value;
    }
491712
public function getMigrationName($name = '') {
        $name = $name ? : $this->prefix . $this->tableNameRaw;

        $components = Yii::$app->getComponents();
        if (isset($components['session'])) {
            Yii::$app->session->set($this->tableName, '');
        }
        $this->migrationName= $this->migrationName ? : 'm' . gmdate('ymd_His') . '_' . $name;

        $name = $this->saveTblNameInSession($this->migrationName);

        return $name;
    }