feed column from array or hive key
@param string|array $args
431900
public function copyfrom($args) {
        if (($args || \Base::instance()->exists($args,$args))
        && is_array($args))
            foreach ($args as $arg => $val)
                $this->{$arg} = $val;
    }
643242
public function getColumn($sql, array $args = [])
    {
        $result = $this->query($sql, $args);
        
        if (!$result) {
            return  null;
        }
        
        $row = $result->fetch_row();
        
        return $row[0];
    }
981566
public function buildQueryString($args = array()) {
		$args = array_merge($args, array("token" => $this->token));
		
		$query = "";
		if (isset($args)) {
			while (list($key, $val) = each($args)) {
				if ( strlen($query) > 0 ) {
					$query .= "&";
				} else {
					$query .= "?";
				}
				$query .= $key . '=' . $val;
			}
		}
		return $query;
	}
757851
public function filter($query, array $args = [])
    {
        $valuesGroupedByFilterKey = [];

        /**
         * @var string
         * @var mixed  $value
         */
        foreach ($args as $key => $value) {
            /**
             * @var string
             * @var string[] $argNames
             */
            foreach ($this->multiArgumentFiltersArgNames as $filterKey => $argNames) {
                // Group together the values if multiple arguments are given the same key
                if (in_array($key, $argNames)) {
                    $valuesGroupedByFilterKey[$filterKey][] = $value;
                }
            }

            // Filters that only take a single argument can be applied directly
            if ($filterInfo = Arr::get($this->singleArgumentFilters, $key)) {
                /** @var \Nuwave\Lighthouse\Support\Contracts\ArgFilterDirective $argFilterDirective */
                $argFilterDirective = $filterInfo['filter'];
                $columnName = $filterInfo['columnName'];

                $query = $argFilterDirective->applyFilter($query, $columnName, $value);
            }
        }

        /**
         * @var string
         * @var array  $values
         */
        foreach ($valuesGroupedByFilterKey as $filterKey => $values) {
            $columnName = Str::before($filterKey, '.');

            if ($values) {
                $argFilterDirective = $this->multiArgumentFilters[$filterKey];

                $query = $argFilterDirective->applyFilter($query, $columnName, $values);
            }
        }

        return $query;
    }
388797
public function data($args)
    {
        foreach (func_get_args() as $arg) {
            if (is_array($arg)) {
                $this->data = array_merge_recursive($arg, $this->data);
            } else {
                $this->data[] = $arg;
            }
        }

        return $this;
    }
693053
public function update( array $args ) {

		if ( self::$ran ) {
			return new NullLog();
		}

		if ( $this->is_cron() || $this->is_cli() ) {
			$this->register_event_listener();
		}

		return new NullLog();
	}
1013153
public function run(array $args)
    {
		if(count($args) < 3) {
            Index::error('Not enough arguments.', 'Usage: eve job random-mail subject=hi&body=hello...');
        }
		
		$data = array();
		
		if(strpos($args[2], '?') === 0) {
			parse_str(substr($args[2], 1), $data);
		} else {
			$data = json_decode($args[2], true);
		}
		
		$namespace = 'Eve';
		
		if(file_exists($this->cwd.'/composer.json')) {
			$json = $this('file', $this->cwd.'/composer.json')->getContent();
			$json = json_decode($json, true);

			if(isset($json['autoload']['psr-4'])
				&& is_array($json['autoload']['psr-4'])
			) {
				foreach($json['autoload']['psr-4'] as $namespace => $path) {
					if(strlen($path) === 0) {
						$namespace = substr($namespace, 0, -1);
						break;
					}
				}
			}
		}
		
		$queue = \Eve\Framework\Index::i($this->cwd, $namespace)
			// set default paths
			->defaultPaths()
			// set default database
			->defaultDatabases()
			->queue($args[1])
			->setData($data);
			
		if(isset($args[3]) && is_string($args[3])) {
			$queue->setPriority(trim($args[3]));
		} else if(isset($args[3]) && is_numeric($args[3])) {
			$queue->setPriority($args[3]);
		}
		
		if(isset($args[4]) && is_numeric($args[4])) {
			$queue->setDelay($args[4]);
		}
		
		$queue->save();
		
		Index::success('`'.$args[1].'` has been successfully queued.');
    }
686914
protected function serializeArguments(array $args)
    {
        // first we have to sort the args by key to avoid that different orders
        // lead to different cache entries!
        ksort($args);

        $result = '';
        $invalidKeys = array('userid', 'apikey', 'keyid', 'vcode');
        foreach ($args as $key => $value) {
            $key   = trim($key);
            $value = trim($value);
            if (empty($value) || in_array($key, $invalidKeys)) {
                // ignore the invalid keys...
                continue;
            }
            $result .= ';' . $key . '=' . $value;
        }

        return $result;
    }
587779
public function beforeFetch(array &$args) {
        $model = $args[0];
        $select = &$args[1];
        if (!$model->isCmsContext()) {
            return;
        }
        if (!Garp_Auth::getInstance()->isAllowed(get_class($model), 'fetch')
            && Garp_Auth::getInstance()->isAllowed(get_class($model), 'fetch_own')
        ) {
            $currentUserData = Garp_Auth::getInstance()->getUserData();
            $currentUserId   = $currentUserData['id'];
            $select->where(self::_AUTHOR_COLUMN . ' = ?', $currentUserId);
        }
    }
398807
public static function createOrderByFromArray(string &$sql, array &$args) : void
    {
        if (!preg_match('/ORDER BY\s+:(\w+)/', $sql, $matches)) {
            return;
        }

        if (!array_key_exists($matches[1], $args) || !\is_array($args[$matches[1]])) {
            return;
        }

        $sort = [];
        foreach ($args[$matches[1]] as $field => $direction) {
            if (preg_match('/\s/', $field . $direction)) {
                return;
            }

            $sort[] = "$field $direction";
        }

        $sql = preg_replace($matches[0], 'ORDER BY ' . implode(', ', $sort), $sql);
        unset($args[$matches[1]]);
    }
1375024
public function start($args)
    {
        parent::start($args);
        $this->_dotWidth = max($this->_columns - 11 - strlen($this->_total) * 2, 10);
        $this->write("\n");
    }
107996
private function preserveOldArgFormat(array $args)
    {
        if (isset($args[0]) && !is_array($args[0])) {
            $args = [$args];
        } elseif (empty($args)) {
            $args = [[]];
        }

        return $args;
    }
490121
public function beforeFetch(&$args) {
        $model = &$args[0];
        $select = &$args[1];

        $isCms = $model->isCmsContext();
        if (!$isCms && !$this->_forceI18nOutput) {
            return;
        }
        $this->_modifySearchQuery($select, $model);
        $this->bindWithI18nModel($model);
    }
191231
private function _parseArgs(array $args)
	{
		$arg = '';
		if(count($args) > 0)
		{
			foreach($args as $number => $argument)
			{
				if($number === 0)
				{
					$arg .= $argument;
				}
				else
				{
					$arg .= ', ' . $argument;
				}
			}
		}

		return $arg;
	}
1124580
public function vars($args)
    {
        $this->_query .= implode(',', array_fill(0, count($args), '?'));
        foreach ($args as $arg) {
            $this->_args[] = $arg;
        };
        return $this;
    }
467777
public function run(array $args)
    {
        Index::info('Help Menu');
        Index::info('- `eve generate <schema*> <namespace>`    Generates files based on schema');
        Index::info('- `eve database <schema*>`                Generates database table/s schema');
        Index::info('- `eve install`                           Generates default framework files');
        Index::info('- `eve job <name*> <data*>`               Executes a job');
		Index::info('- `eve queue <name*> <data*>`             Queues a job');

        die(0);
    }
380529
public function run($args) {
        if (!isset($this->servers)) {
            echo "No server specified in config!";
            exit;
        }

        if (!isset($this->aliases)) {
            echo "No alias defined in config!";
            exit;
        }

        if (!isset($args[2])) {
            $this->getHelp();
            exit;
        }
        $src = $args[0];
        $dest = $args[1];
        $alias = $args[2];
        $file = (isset($args[3])) ? $args[3] : "";

        $path = Yii::getPathOfAlias($this->aliases[$alias]);
        $relativePath = str_replace(Yii::app()->basePath,"",$path);

        $srcUrl = $this->servers[$src].$relativePath."/".$file;
        $destUrl = $this->servers[$dest].$relativePath."/".$file;

        $cmd = "rsync {$this->params} -av ".$srcUrl." ".$destUrl;
        echo "\n".$cmd."\n\n";
        echo "Start rsync of '".$alias."' (".$relativePath."/".$file.") from '".$src."' to '".$dest."'? [Yes|No] ";
        if(!strncasecmp(trim(fgets(STDIN)),'y',1)) {
            system($cmd, $output);
        } else {
            echo "Skipped.\n";
        }
    }