get

@param mixed $conditions

@return  array
352382
public function get($conditions)
    {
        $sql = 'SELECT * FROM ' . $this->table .
            ' WHERE id = :id';

        $stat = $this->pdo->prepare($sql);
        $stat->bindValue(':id', $conditions);
        $stat->execute();

        return $stat->fetch(\PDO::FETCH_ASSOC);
    }
1011526
public function where($conditions, $values=null) {
		if(!$conditions)
			return $this;
		if($values !== null)
			$this->where[] = [$conditions => $values];
		else
			$this->where[] = $conditions;

		return $this;
	}
1354883
public function & get($property, array $conditions = array())
	{
		// database columns
		if (array_key_exists($property, static::properties()))
		{
			if ( ! array_key_exists($property, $this->_data))
			{
				$result = null;
			}
			elseif ($this->_sanitization_enabled)
			{
				// use a copy
				$result = $this->_data[$property];
			}
			else
			{
				// use a reference
				$result =& $this->_data[$property];
			}
		}

		// related models
		elseif ($rel = static::relations($property))
		{
			if ( ! array_key_exists($property, $this->_data_relations))
			{
				$this->_data_relations[$property] = $rel->get($this, $conditions);
				$this->_update_original_relations(array($property));
			}

			$result =& $this->_data_relations[$property];
		}

		// EAV properties
		elseif (($result = $this->_get_eav($property)) !== false)
		{
			// nothing else to do here
		}

		// database view columns
		elseif ($this->_view and in_array($property, static::$_views_cached[get_class($this)][$this->_view]['columns']))
		{
			if ($this->_sanitization_enabled)
			{
				// use a copy
				$result = $this->_data[$property];
			}
			else
			{
				// use a reference
				$result =& $this->_data[$property];
			}
		}

		// stored custom data
		elseif (array_key_exists($property, $this->_custom_data))
		{
			if ($this->_sanitization_enabled)
			{
				// use a copy
				$result = $this->_custom_data[$property];
			}
			else
			{
				// use a reference
				$result =& $this->_custom_data[$property];
			}
		}
		else
		{
			throw new \OutOfBoundsException('Property "'.$property.'" not found for '.get_class($this).'.');
		}

		// do we need to clean before returning the result?
		if ($this->_sanitization_enabled)
		{
			$result = $this->_sanitize($property, $result);
		}

		return $result;
	}
1131767
public static function fetchs($condition = NULL, $params = NULL, $fields=null, $order='', $object = true) {
        return static::dao($object)->fetchs($condition,$params,$fields,$order);
    }
144201
public function autoNullConditionsArray(array $conditions) {
		foreach ($conditions as $k => $v) {
			if ($v !== null) {
				continue;
			}

			$conditions[$k . ' IS'] = $v;
			unset($conditions[$k]);
		}

		return $conditions;
	}
502827
public function setConditions($conditions)
    {
        $this->conditions = [];
        if (!is_array($conditions)) {
            $conditions = [$conditions];
        }
        foreach ($conditions as $condition) {
            $this->addCondition($condition);
        }

        return $this;
    }
392388
protected function _createWhere(array $conditions) {
		$where = [];
		foreach ($conditions as $field => $value) {
			$where[] = $field . '=?';
		}
		$where = implode(' AND ', $where);
		if (!empty($where)) $where = 'WHERE ' . $where;
		return $where;
	}
914965
public function getItems(array $conditions = array())
    {
        $list = $this->getList($conditions);

        if (empty($list)) {
            return array();
        }

        $handler_id = null;

        $items = array();
        foreach ((array) $list as $item) {
            $handler_id = $item['type'];
            $items[$item['entity_id']] = $item;
        }

        $handlers = $this->collection->getHandlers();

        $entity_conditions = array(
            'status' => isset($conditions['status']) ? $conditions['status'] : null,
            $handlers[$handler_id]['entity'] . '_id' => array_keys($items)
        );

        $entities = $this->getListEntities($handler_id, $entity_conditions);

        if (empty($entities)) {
            return array();
        }

        foreach ($entities as $entity_id => &$entity) {
            if (isset($items[$entity_id])) {
                $entity['weight'] = $items[$entity_id]['weight'];
                $entity['collection_item'] = $items[$entity_id];
                $entity['collection_handler'] = $handlers[$handler_id];
            }
        }

        gplcart_array_sort($entities);
        return $entities;
    }
368122
public function getCategories($conditions = array(), $options = array())
    {
        $conditions += array(
            'status' => 1,
            'type' => 'catalog',
            'store_id' => $this->store_id
        );

        $options += array(
            'entity' => 'category',
            'imagestyle' => $this->configTheme('image_style_category_child', 3));

        $categories = $this->category->getTree($conditions);
        $this->prepareEntityItems($categories, $options);
        return $categories;
    }
1369270
public static function get()
    {
        return [
            self::$equals,
            self::$lessThan,
            self::$lessThanEqualTo,
            self::$greaterThan,
            self::$greaterThanEqualTo,
            self::$doesNotEqual,
            self::$doesNotEqualAlt,
            self::$is,
            self::$isA,
            self::$isNot,
            self::$like,
        ];
    }
1152675
public function buildConditions($conditions)
    {
        if (!is_array($conditions)) {
            if (null === $conditions) {
                return '';
            }
            return $conditions;
        } elseif ($conditions === array()) {
            return '';
        }

        $n = count($conditions);
        $operator = strtoupper($conditions[0]);
        if ($operator === 'AND' || $operator === 'OR') {
            $result = array();
            for ($i = 1; $i < $n; $i++) {
                $condition = $this->buildConditions($conditions[$i]);
                if ('' !== $condition) {
                    $result[] = '(' . $condition . ')';
                }
            }
            if ($result === array()) {
                return '';
            } else {
                return implode(' ' . $operator . ' ', $result);
            }
        }

        if (!isset($conditions[1], $conditions[2])) {
            return '';
        }

        $column = $this->db->quoteColumn($conditions[1]);
        $values = $conditions[2];
        if (!is_array($values)) {
            $values = array($values);
        }
        if ($operator === 'IN' || $operator === 'NOT IN') {
            if ($values === array()) {
                return $operator === 'IN' ? '0' : '';
            }
            foreach ($values as $k => $value) {
                $values[$k] = $this->db->quote($value);
            }

            return $column . ' ' . $operator . ' (' . implode(',', $values) . ')';
        } elseif ($operator === 'LIKE' || $operator === 'NOT LIKE' || $operator === 'OR LIKE' || $operator === 'OR NOT LIKE') {
            if ($values === array()) {
                return ($operator === 'LIKE' || $operator === 'OR LIKE') ? '0' : '';
            }
            if ($operator === 'LIKE' || $operator === 'NOT LIKE') {
                $andor = 'AND';
            } else {
                $andor = 'OR';
                $operator = $operator === 'OR LIKE' ? 'LIKE' : 'NOT LIKE';
            }

            $result = array();
            foreach ($values as $k => $value) {
                $result[] = $column . ' ' . $operator . ' ' . $this->db->quote($value);
            }

            return implode($andor, $result);
        } else {
            throw new Exception('Invalid operator "' . $operator . '"');
        }
    }
122317
public function findAll($conditions = false)
    {
        $this->isColl = true;
        $data = $this->fetchAll($conditions);

        $records = array();
        foreach ($data as $key => $row) {
            /** @var $records Record[] */
            $records[$key] = $this->db->init($this->table, $row, false);
            $records[$key]->triggerCallback('afterFind');
        }

        $this->data = $records;
        return $this;
    }
56774
public function having($conditions)
    {
        if ($conditions = is_array($conditions) && func_num_args() === 1 ? $conditions : func_get_args()) {
            $this->_parts['having'][] = $conditions;
        }
        return $this;
    }
1108829
public function findWhere(array $conditions, $limit = null)
    {
        foreach ($conditions as $field => $criteria) {
            if (strpos($field, '.') === false) {
                $field = $this->table . '.' . $field;
            }
            $this->qb->where($field, $criteria);
        }

        if ($result = $this->qb
            ->from($this->table)
            ->get($limit)) {
            $this->result = new DataObjects\Result($result, $this);
            $this->result->setInfo($result->getInfo());

            if ($limit == 1) {
                return $this->result->first();
            }

            return $this->result;
        }

        return false;
    }
288754
protected function getCount($condition)
    {
        $class = $this->className;
        return $class::find()
            ->select(['id', $this->leftAttribute, $this->rightAttribute, $this->rootAttribute])
            ->where($condition)
            ->count();
    }
591650
public function sequence(array $conditions) {
      $range = new Collection();
      foreach ($conditions as $value) {
        $range[] = $this->checkFromSequence($value);
      }

      return $range;
    }
1235127
public function codeList($conditions = []) {
		$conditions += ['status' => 1];
		$res = $this->find('all', ['conditions' => $conditions, 'fields' => ['code', 'name']]);
		$ret = [];
		foreach ($res as $language) {
			$ret[$language['code']] = $language['name'];
		}
		return $ret;
	}