Find.
@param  any $param
@return Oppa\ActiveRecord\Entity
@throws Oppa\Exception\InvalidValueException
779359
public final function find($param): Entity
    {
        if ($param === null || $param === '') {
            throw new InvalidValueException('You need to pass a parameter for select action!');
        }

        $queryBuilder = new QueryBuilder($this->db->getLink());
        $queryBuilder->setTable($this->table);

        $queryBuilder->select("{$this->table}.*");

        if (method_exists($this, 'onFind')) {
            $queryBuilder = $this->onFind($queryBuilder);
            if (!$queryBuilder || !($queryBuilder instanceof QueryBuilder)) {
                throw new InvalidValueException('You should return query builder back from onFind()!');
            }
        }

        $queryBuilder->where("{$this->table}.{$this->tablePrimary} = ?", [$param])
            ->limit(1);

        $result = $queryBuilder->run()->itemFirst();

        $entity = new Entity($this, (array) $result);
        if (method_exists($this, 'onEntity')) {
            $this->onEntity($entity);
        }

        return $entity;
    }
766584
public static function getInstance($param = null)
    {
        if (self::$instance === null) {
            if (isset($param['type'])) {
                $type = $param['type'];
                unset($param['type']);
            } else {
                throw new \LogicException('Config Type was not specified in the param array $param[\'type\']');
            }

            self::$instance = ConfigFactory::make($type, $param);
        }

        // return singelton instance
        return self::$instance;
    }
600978
public function search($params)
    {
        $query = ImageManager::find();

        // add conditions that should always apply here

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
			'pagination' => [
				'pagesize' => 100,
			],
			'sort'=> ['defaultOrder' => ['created'=>SORT_DESC]]
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        // Get the module instance
        $module = Module::getInstance();

        if ($module->setBlameableBehavior) {
            $query->andWhere(['createdBy' => Yii::$app->user->id]);
        }

        $query->orFilterWhere(['like', 'fileName', $this->globalSearch])
            ->orFilterWhere(['like', 'created', $this->globalSearch])
			->orFilterWhere(['like', 'modified', $this->globalSearch]);

        return $dataProvider;
    }
1081190
public static function findOrNew($param, $field = '*', $parameters = array()) {
	    if (empty($param)) {
	        return new static();
        }
	    $model = static::find($param, $field, $parameters);
	    if (empty($model)) {
	        return new static();
        }
        return $model;
    }
1235909
public static function find( $param = null, $param2 = null ) 
	{
		$settings = static::_model();

		$query = DB::select( $settings['table'] );

		// Do we have a find modifier?
		if ( !is_null( $settings['find_modifier'] ) ) 
		{
			$callbacks = $settings['find_modifier'];

			if ( !\CCArr::is_collection( $callbacks ) )
			{
				$callbacks = array( $callbacks );
			}

			foreach( $callbacks as $call )
			{
				if ( is_callable( $call ) ) 
				{
					call_user_func_array( $call, array( &$query ) );
				}
				else 
				{
					throw new ModelException( "Invalid Callback given to find modifiers." );
				}
			}
		}

		if ( !is_null( $param ) )
		{
			// Check if paramert 1 is a valid callback and not a string.
			// Strings as function callback are not possible because
			// the user might want to search by key like:
			// Model::find( 'key', 'type' );
			if ( is_callable( $param ) && !is_string( $param ) ) 
			{
				call_user_func_array( $param, array( &$query ) );
			}
			// When no param 2 isset we try to find the record by primary key
			elseif ( is_null( $param2 ) ) 
			{
				$query->where( $settings['table'].'.'.$settings['primary_key'], $param )
					->limit(1);
			}
			// When param one and two isset we try to find the record by
			// the given key and value.
			elseif ( !is_null( $param2 ) )
			{
				$query->where( $param, $param2 )
					->limit(1);
			}
		}

		// alway group the result
		$query->forward_key( $settings['primary_key'] );

		// and we have to fetch assoc
		$query->fetch_arguments = array( 'assoc' );

		// and assign
		return static::assign( $query->run() );
	}
221895
public static function load($param)
    {
        if (!($node = self::loadById($param))) {
            $node = self::loadByPath($param);
        }

        return $node;
    }
901937
public function fromParameter($param)
    {
        $object = new \StdClass;

        if (is_string($param)) {
            
            foreach (self::$prefixMap as $prefix => $setter) {
                $regex = "/(?<=~" . $prefix . ").*/m";

                if (preg_match($regex, $param, $matches)) {
                    $end    = stripos($matches[0], '~');

                    if ($end !== false) {
                        $part = substr($matches[0], 0, $end);
                    } else {
                        $part = $matches[0];
                    }

                    $key = self::$prefixToPropertyMap[$prefix];

                    if ($prefix == self::PREFIX_ROUNDS) {
                        $part = (int) $part;
                    }

                    $object->$key = $part;

                    if (method_exists($this, $setter)) {
                        $this->$setter($part);
                    }
                }
            }
        }

        return $object;
    }
349684
public function getParam($param)
    {
        if (!is_string($param)) {
            throw new \Erebot\InvalidValueException('Bad parameter name');
        }
        if (!isset($this->params[$param])) {
            throw new \Erebot\NotFoundException('No such parameter');
        }
        return $this->params[$param];
    }
81392
public function filter($param = null) : \SplObjectStorage
    {
        if (!$param) {
            return null;
        }

        if ($param->count() === 1) {
            return $param;
        }

        $idValue          = $returnNode = null;
        $returnCollection = new \SplObjectStorage();
        foreach ($param as $node) {
            if (!$idValue || $this->compare($idValue, $node->getId())) {
                $idValue    = $node->getId();
                $returnNode = $node;
            }
        }

        $returnCollection->attach($returnNode);

        return $returnCollection;
    }
82972
public static function find($args = false)
    {
        /* @var ActiveRecord $model */

        $query = null;
        $model = new static();

        if ($args && $args instanceof Query) {
            $query = $args;
            $query->limit = 1;

            if (empty($query->from)) {
                $query->addFrom($model->getTableName().' T');
            }
        } elseif ($args && is_array($args)) {
            $args['limit'] = 1;
            if (!isset($args['from'])) {
                $args['from'] = $model->getTableName().' T';
            }
            $query = new Query($args);
        } elseif (!$args) {
            $query = new Query(
                [
                    'from' => $model->getTableName().' T',
                    'limit' => 1,
                ]
            );
        } else {
            throw new Exception(translate('Bad arguments'), 500, Exception::BADARGUMENTS);
        }

        $stmt = $model->getDB()->prepare($query->toSql());
        $stmt->execute($query->params);
        $record = $stmt->fetchObject(get_class($model), [false]);
        $stmt->closeCursor();

        return $record;
    }
280695
protected function getParam($param)
    {
        $params = $this->getParams();
        if (! isset($params[$param])) {
            return false;
        }
        return $params[$param];
    }
1372174
final protected function getValueFromArray(string $param)
  {
    $value = null;

    preg_match_all(self::$regEx['array'], $param, $args);
    $array = Fixtures::get($args['var'][0]);
    if (array_key_exists($args['key'][0], $array)) {
        $value = $array[$args['key'][0]];
    }
    return $value;
  }
132169
public static function getIsSet($param)
    {
        $blnReturn = (isset($_REQUEST[$param]));

        if (!$blnReturn) {
            //*** Try PUT or DELETE.
            $strPutValue = static::getHttpBodyValue($param);

            $blnReturn = (!is_null($strPutValue));
        }

        return $blnReturn;
    }
1292318
public static function find($id, array $params = [])
    {
        $instance = new static([], static::getParentID());

        return $instance->request($instance->getEndpoint(), 'find', [$id, $params]);
    }
659123
public function search($params)
    {
        $query = Seo::find();
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'sort' => [
                'defaultOrder' => ['id' => SORT_DESC],
            ],
        ]);
        $this->load($params);
        if (!$this->validate()) {
            return $dataProvider;
        }
        $query->andFilterWhere([
            Seo::tableName() . '.id' => $this->id,
        ])->andFilterWhere(['LIKE', Seo::tableName() . '.title', $this->title])
            ->andFilterWhere(['LIKE', Seo::tableName() . '.description', $this->description]);
        return $dataProvider;
    }
1309986
public function get($param = '') {
        $this->validate();

        if ($param) {
            if (array_key_exists($param, $this->config)) {
                return $this->config[$param];
            }
            else {
                throw new OptionConfigException('option param not valid: ' . $param);
            }
        }

        return $this->config;
    }
442140
public function search($params)
	{
		$query = Event::find()
			->join('INNER JOIN', 'post', 'event.post_id = post.id')
			->where(['post.status' => Post::STATUS_PUBLISHED])
			->orderBy('begin DESC');

		return new ActiveDataProvider([
			'query' => $query,
			'pagination' => [
				'pageSize' => Yii::$app->params['itemsPerPage'],
			],
		]);
	}