/*
*
Convert any alert modal to Toast

@param string $position

@return RealRashid\SweetAlert\Toaster::alert();
336501
public function toToast($position = 'top-right')
    {
        $this->config['toast'] = true;
        $this->config['showCloseButton'] = false;
        $this->config['position'] = $position;

        $this->flash();

        return $this;
    }
519908
protected static function handleColumnPosition($position)
    {
        $query = static::getQuery();

        if (!$position) {
            return null;
        }

        $posColumn = '';

        $position = trim($position);

        if (strpos(strtoupper($position), 'AFTER') !== false) {
            list($position, $posColumn) = explode(' ', $position, 2);

            $posColumn = $query->quoteName($posColumn);
        }

        return $position . ' ' . $posColumn;
    }
312579
public static function createInvalidArrayPosition($name, array $position)
    {
        return new self(sprintf(
            'The %s form uses position as array or you must define the "before" or "after" option (current: %s).',
            self::decorateValue($name),
            implode(', ', self::decorateValues(array_keys($position)))
        ));
    }
1081812
public function charAt($position)
	{
		ArgumentValidator::validateUnsignedInteger($position);
		if ($position >= $this->length()) {
			throw new \InvalidArgumentException('Position invalid');
		}
		return mb_substr($this->string, $position, 1);
	}
944186
public function stepURL($position)
    {
        $s = 's_'.$position;
        $s = $this->$s;

        return $this->url(null, array('step' => $s));
    }
595214
public function getTabByPosition($position)
    {
        if (is_numeric($position) && $position < count($this->tabs)) {
            return $this->tabs[$position];
        }

        return null;
    }
233379
function warning( $text, $position = false )
    {
        if ( $position )
        {
            $str = $position['file'] . ':' . $position['from'][0] . ' C' . $position['from'][1];
            if ( isset( $position['to'] ) )
                $str .= ' -> L' . $position['to'][0] . ' C' . $position['to'][1];
            $str .= ':';
        }
        $str .= $text;
        if ( class_exists( 'ezcli' ) )
        {
            $cli = eZCLI::instance();
            $cli->warning( $str );
        }
        else
        {
            eZDebug::writeWarning( $str, __METHOD__ );
        }
    }
26830
public function prune($position = null)
    {
        if ($position) {
            $this->addUsingAlias(PositionTableMap::COL_ID, $position->getId(), Criteria::NOT_EQUAL);
        }

        return $this;
    }
1023643
public function getSegment($position = 1)
	{
		$position = ($position > 0) ? --$position : 0;

		if (array_key_exists($position, $this->pattern))
		{
			return $this->pattern[$position];
		}

		return false;
	}
1075162
public function removeAt($position)
    {
        if (!is_numeric($position) || $position < 0) {
            throw new \InvalidArgumentException();
        }

        if ($position < count($this->items)) {
            array_splice($this->items, $position, 1);
        }

        $this->isUpdated = true;

        return $this;
    }
153482
public function setPosition($position)
	{
		if ( $position == $this->getPosition() ) { return; }

		$this->_values['pos'] = (int) $position;
		$this->setModified();
	}
82629
public function setPosition($position)
    {
        if (in_array($position, [self::ADDON_LEFT, self::ADDON_RIGHT])) {
            $this->position = $position;
        }

        return $this;
    }
630399
protected function decrementPositionsOfItemsBelow($position = null)
    {
        if ($this->isNotInList()) return;

        if (null === $position) {
            $position = $this->getListifyPosition();
        }

        $this->listifyScopedQuery()
            ->where($this->positionColumn(), '>', $position)
            ->decrement($this->positionColumn());
    }
1058300
protected function children($position = null, $order = 'asc')
    {
        $query = $this->queryByParentId();

        if (!is_null($position)) {
            if (is_array($position)) {
                $query->buildWherePosition($this->getPositionColumn(), $position);
            } else {
                if ($position === static::QUERY_LAST) {
                    $query->orderBy($this->getPositionColumn(), 'desc');
                } else {
                    $query->where($this->getPositionColumn(), '=', $position);
                }
            }
        }

        if ($position !== static::QUERY_LAST) {
            $query->orderBy($this->getPositionColumn(), $order);
        }

        return $query;
    }
496251
public function set_seek_position($position)
    {
        $this->seek_position = isset($position) ? (integer)$position : null;

        return $this;
    }
635579
public function getByPosition($position)
    {
        $position = (int) $position;

        if (!isset($this->parametersByPosition[$position])) {
            throw new \Exception('Parameter is not defined !');
        }

        return $this->parametersByPosition[$position];
    }
741502
public static function findByPosition($position)
    {
        try {
            $offset = $position - 1;
            $tableName = self::getTableName();
            $conn = self::getConnection();

            $stmt = $conn->query('SELECT * FROM '.$tableName.' LIMIT '.$offset.', 1'); //mysql syntax
            if(! $stmt) {
                $stmt = $conn->query('SELECT * FROM '.$tableName.' OFFSET '.$offset.' LIMIT 1'); //pgsql syntax
            }

            return self::find($stmt);;
        }
        catch(PDOException $pe) {
            return $pe->getMessage();
        }
        catch(Exception $e) {
            return $e->getMessage();
        }
    }