获取随机颜色
@return array
185598
private function getRandColor()
    {
        $red = mt_rand(1,254);
        $green = mt_rand(1,254);

        if($red + $green > 400){
            $blue = 0;
        }else{
            $blue = 400 -$green - $red;
        }
        return [$red,$green,$blue];
    }
889781
public function getValuesAsArray() {
		$values = [];
		foreach($this->getValues() as $value) {
			$values[$value->getId()] = $value->getName();
		}

		return $values;
	}
466543
public function getValues() : array
    {
        $values = [];

        foreach ($this->inputs as $input) {
            $values[] = $input->getValue();
        }

        return $values;
    }
1343933
public function getFields()
    {
        $fields = $this->getInput('fields');

        if (! is_array($fields)) {
            return [];
        }

        return array_map(function ($fields) {
            return explode(',', $fields);
        }, $fields);
    }
886028
public function getParams() {
        $return       = $this->_params;
        $paramSources = $this->getParamSources();
        if (in_array('_GET', $paramSources)
            && isset($this->GET)
            && is_array($this->GET)
        ) {
            $return += $this->GET;
        }
        if (in_array('_POST', $paramSources)
            && isset($this->POST)
            && is_array($this->POST)
        ) {
            $return += $this->POST;
        }
        return $return;
    }
754688
public function getData()
    {
        return [
            'recipient' => $this->user_ref ? ['user_ref' => $this->recipient] : ['id' => $this->recipient],
            'message' => [
                'text' => $this->text
            ],
            'tag'=> $this->tag,
            'notification_type'=> $this->notification_type,
            'messaging_type' => $this->messaging_type
        ];
    }
941213
public function toArray() {

        return [
            'uid' => $this->uid,
            'method' => $this->method,
            'parameters' => $this->parameters,
            'special_types' => $this->special_types,
            'id' => $this->id
        ];

    }
1297024
public static function getParam()
	{
		$paramFile = Yii::$app->params[Enum::PARAMS_FILE];
		$param = require($paramFile);

		if (!is_array($param)) return [];

		return $param;
	}
586750
public function get_error(){
    if ( $this->error ){
      return [
        'code' => $this->error,
        'text' => $this->class_cfg['errors'][$this->error]
      ];
    }
    return false;
  }
236667
public function getValues() : array
    {
        $values = [];

        foreach ($this->checkboxes as $checkbox) {
            if ($checkbox->isChecked()) {
                $values[] = $checkbox->getValue();
            }
        }

        return $values;
    }
1147638
public function get(): array
    {
        $data = [];

        foreach ($this->data as $row) {
            $data[] = $row->get();
        }

        return $data;
    }
1339547
public function get()
	{
		if ( ! file_exists($this->file))
			return array();

		$data = unserialize(base64_decode(file_get_contents($this->file)));

		return $data ?: array();
	}
796887
public function getAttributes(): array
    {
        $attributes = [];
        if (null !== $this->from) {
            $attributes['from'] = $this->from->getTimestamp();
        }
        return $attributes;
    }
16201
public static function get() : array
  {
    return [
      'csrf_token' => CSRF::generate(),
      'errors' => Variable::has('validation.errors') ? Variable::get('validation.errors') : (new ValidatorFactory())->make([], [])->errors(),
      'old' => Variable::has('form.old') ? Variable::get('form.old') : [],
    ];
  }
849966
public function data()
    {
        return [
            'property'    => $this->property(),
            'table'       => $this->table(),
            'value'       => $this->value(),
            'func'        => $this->func(),
            'operator'    => $this->operator(),
            'conjunction' => $this->conjunction(),
            'filters'     => $this->filters(),
            'condition'   => $this->condition(),
            'active'      => $this->active(),
            'name'        => $this->name(),
        ];
    }
1342992
public function getParams()
    {
        $params = [];
        foreach ($this as $key => $value) {
            $pname = (string) ltrim(strtolower(preg_replace('/[A-Z]/', '_$0', $key)), '_');
            $params[$pname] = $value;
        }
        return $params;
    }
857171
protected function getValues()
    {
        $uri = uri();
        $key = $this->session->has($uri) ? $uri : request()->path();

        $params = $this->session->get($key . '.' . get_called_class());
        if (is_null($params) or ! isset($params['column']) or ! $params['column'] == $this->column) {
            return [];
        }
        if (!isset($params['value'])) {
            return [];
        }
        if (empty((array) $params['value'])) {
            $params = $this->session->get($uri);
            unset($params[get_called_class()]);
            $this->session->put($key, $params);
            $this->session->save();
        } else {
            return $params['value'];
        }
        return [];
    }