Find active members by id

@param int   $intId
@param array $arrOptions

@return \MemberModel|\MemberModel[]|\Model\Collection|null
491392
public static function findActiveById($intId, array $arrOptions = [])
	{
		$t    = static::$strTable;
		$time = \Date::floorToMinute();

		$arrColumns = ["$t.login='1' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'" . ($time + 60) . "') AND $t.disable=''"];

		$arrColumns[] = "$t.id = ?";

		return static::findOneBy($arrColumns, $intId, $arrOptions);
	}
1139924
public static function findPublishedByIds(array $ids, $pid = null)
    {
        if (0 === \count($ids)) {
            return null;
        }

        $t = static::getTableAlias();
        $columns = ["$t.id IN (".\implode(',', \array_map('intval', $ids)).')'];
        $values = [];

        // Filter by pid
        if (null !== $pid) {
            $columns[] = "$t.pid=?";
            $values[] = $pid;
        }

        if (!BE_USER_LOGGED_IN) {
            $columns[] = "$t.published=?";
            $values[] = 1;
        }

        return static::findBy($columns, $values, ['order' => "$t.sorting"]);
    }
1183246
public function find($id, $inDeleted = false)
    {
        $qb = $this->db->createQueryBuilder();

        $qb->select($this->getSelect($this->profile))
            ->from($this->table, 't')
            ->where('t.'.$this->primaryKey." = :id");

        $this->addJoins($qb, $this->getJoins($this->profile));
        $params = $this->addFilters($qb, $this->getFilters($this->profile));
        $this->addGrouping($qb, $this->getGroupings($this->profile));

        $params['id'] = $id;

        return $this->getRow($qb, $params, $inDeleted);
    }
112029
public function getErrorMessage($intCode, $arrOptions=array()) {
		if (isset($arrOptions['error']))
			return $arrOptions['error'];

		if (isset($arrOptions['message']))
			return $this->locale->insert($arrOptions['message'], array('value' => isset($arrOptions['value']) ? $arrOptions['value'] : $arrOptions['field'], 'field' => $arrOptions['field']));

		$field = isset($arrOptions['label']) ? $arrOptions['label'] : (isset($arrOptions['field']) ? $this->locale->get($arrOptions['field']) : '');

		switch ($intCode) {
			case FILTER_VALIDATE_REQUIRED:
				return $this->locale->insert('error.empty', array('value' => $field));
			case FILTER_VALIDATE_PASSWORD:
				return $this->locale->get('error.password');
			case FILTER_VALIDATE_USERNAME:
				return $this->locale->insert('error.username', array('value' => '"'.$arrOptions['value'].'"'));
			case FILTER_VALIDATE_IDENTIFIER:
				return $this->locale->insert('error.identifier', array('value' => '"'.$arrOptions['value'].'"'));
			case FILTER_VALIDATE_RESOURCE:
				return $this->locale->insert('error.resource', array('value' => '"'.$arrOptions['value'].'"'));
			case FILTER_VALIDATE_EMAIL:
				return $this->locale->insert('error.not_a_address', array('value' => '"'.$arrOptions['value'].'"', 'type' => 'E-mail'));
			case FILTER_VALIDATE_IPV4:
				return $this->locale->insert('error.not_a_address', array('value' => '"'.$arrOptions['value'].'"', 'type' => 'IPv4'));
			case FILTER_VALIDATE_IPV6:
				return $this->locale->insert('error.not_a_address', array('value' => '"'.$arrOptions['value'].'"', 'type' => 'IPv6'));
			case FILTER_VALIDATE_IP:
				return $this->locale->insert('error.not_a_address', array('value' => '"'.$arrOptions['value'].'"', 'type' => 'IP'));
			case FILTER_VALIDATE_URL:
				return $this->locale->insert('error.not_a_url', array('value' => $arrOptions['value']));
			case FILTER_VALIDATE_FLOAT:
				return $this->locale->insert('error.not_a_number', array('value' => $field));
			case FILTER_VALIDATE_INT:
				if (isset($arrOptions['min_range']) && isset($arrOptions['max_range']))
					return $this->locale->insert('error.in_between', array('value' => $field, 'min' => $arrOptions['min_range'], 'max' => $arrOptions['max_range']));
				elseif (isset($arrOptions['min_range']))
					return $this->locale->insert('error.greater_than', array('value' => $field, 'count' => $arrOptions['min_range']));
				elseif (isset($arrOptions['max_range']))
					return $this->locale->insert('error.less_than', array('value' => $field, 'count' => $arrOptions['max_range']));
				else
					return $this->locale->insert('error.not_a_int', array('value' => $field));
			case FILTER_VALIDATE_BOOLEAN:
				break;
			case FILTER_VALIDATE_MIN_LENGTH:
				return $this->locale->insert('error.too_short', array('value' => $field, 'count' => $arrOptions['len']));
			case FILTER_VALIDATE_MAX_LENGTH:
				return $this->locale->insert('error.too_long', array('value' => $field, 'count' => $arrOptions['len']));
			case FILTER_VALIDATE_LENGTH:
				return $this->locale->insert('error.wrong_range', array('value' => $field, 'min' => $arrOptions['min'], 'max' => $arrOptions['max']));
			case FILTER_VALIDATE_DATE_RANGE:
				$arrOptions['format'] = isset($arrOptions['format']) ? $arrOptions['format'] : $this->locale->getDateFormat('date.format.default');
				return $this->locale->insert('error.date_range', array('value' => $field, 'min' => date($arrOptions['format'], $arrOptions['min']), 'max' => date($arrOptions['format'], $arrOptions['max'])));
			case FILTER_VALIDATE_DATE_START_END:
				$arrOptions['format'] = isset($arrOptions['format']) ? $arrOptions['format'] : $this->locale->getDateFormat('date.format.default');
				return $this->locale->insert('error.date_start_end', array('value' => $field, 'end' => date($arrOptions['format'], $arrOptions['end'])));
			default:
				// too_long
				// too_short
				// empty (Muss ausgefüllt werden)
				// invalid
				// start_before_end
				// range: Ist keine gültige {model}
				break;
		}

		return $this->locale->insert('error.invalid', array('value' => isset($arrOptions['value']) ? $arrOptions['value'] : $field, 'field' => $field));
	}
300093
public function getMember($id, array $params = array())
    {
        return $this->get($this->getPath().'/'.rawurlencode($id).'/member', $params);
    }
135614
function fetchMemberOf( $id )
    {
        $user = eZUser::fetch( $id );
        if ( $user instanceof eZUser )
            $roleList = $user->roles();
        else // user group or other non user classes:
            $roleList = eZRole::fetchByUser( array( $id ), true );

        return array( 'result' => $roleList );
    }
949548
public static function getByID($arLayoutColumnID)
    {
        $db = Loader::db();
        $row = $db->GetRow('select * from AreaLayoutThemeGridColumns where arLayoutColumnID = ?', array($arLayoutColumnID));
        if (is_array($row) && $row['arLayoutColumnID']) {
            $al = new static();
            $al->loadBasicInformation($arLayoutColumnID);
            $al->setPropertiesFromArray($row);

            return $al;
        }
    }
680718
public function findFirstPublishedElementByPid($intPid, array $arrOptions=array())
	{
		$t = static::$strTable;

		$arrColumns = array("$t.pid=? AND $t.invisible='' AND $t.type='element'");
	
		if (!isset($arrOptions['order']))
		{
			$arrOptions['order'] = "$t.sorting";
		}
	
		return static::findOneBy($arrColumns, $intPid, $arrOptions);
	}
107136
public function member($memberId)
	{
		if (isset($this->info['memberList'][$memberId]))
		{
			return $this->info['memberList'][$memberId];
		}

		// could not find the member
		return null;
	}
1034074
public function get(int $id)
    {
        $documents = $this->getClient()->call(null, $id, self::ENDPOINT, Document::class, true, 'GET');

        if (1 == count($documents)) {
            return current($documents);
        }

        return $documents;
    }
936634
public function get($id, $args = null) {
		if (isset($this->checkedIds[$id]) && ! $this->checkedIds[$id]) {
			throw new Exceptions\ServiceNotFound('Unable to found the service "' . $id . '"');
		}
		
		$args = $this->resolveArgs(func_get_args());
		
		try {
			$service = ($args === null)
				? $this->getService($id)
				: $this->getServiceByArgs($id, $args);
		}
		catch (Exceptions\ServiceNotFound $exception) {
			$this->checkedIds[$id] = false;
			throw $exception;
		}
		
		$this->checkedIds[$id] = true;
		return $service;
	}
112785
public function findDefaultPublishedElementByPid($intPid, array $arrOptions=array())
	{
		$t = static::$strTable;

		$arrColumns = array("$t.defaultType=1 AND $t.pid=? AND $t.invisible='' AND $t.type='element'");
	
		return static::findOneBy($arrColumns, $intPid, $arrOptions);
	}
84412
public function findAllBySource($source, array $arrOptions = [])
    {
        /** @var CfgTagModel $adapter */
        if (null === ($adapter = $this->framework->getAdapter(self::class))) {
            return null;
        }

        return $adapter->findBy('source', $source, $arrOptions);
    }
250789
public function getById($iId)
    {
        $aEvents = $this->getAll([
            'where' => [
                [$this->sTableAlias . '.id', $iId],
            ],
        ]);

        if (!$aEvents) {
            return false;
        }

        return $aEvents[0];
    }
129396
public function countInSection($id, $activeOnly = true)
    {
        $q = $this->createCountQuery();
        $where = array($q->expr->eq('section', $q->bindValue($id, null, PDO::PARAM_INT)));
        if ($this->hasActiveField && $activeOnly)
        {
            $where []= $q->expr->eq('active', $q->bindValue(true, null, PDO::PARAM_BOOL));
        }
        $q->where(call_user_func_array(array($q->expr, 'lAnd'), $where));
        return $this->count($q);
    }
252852
public function find($id, $properties = array('*')) {
        // If the dev did not specify the $id as an int it would break
        // so we cast it anyways.

        if (is_array($id)) {
            return $this->findMany(array_map(function($id) {
                                return (int) $id;
                            }, $id), $properties);
        } else {

            $id = $id;
        }

        $this->query->where($this->model->getKeyName(), '=', $id);

        return $this->first($properties);
    }
111127
private function __findAro($aro) {
        
        
        if(isset($aro->parent_id)) {
            $conditions = [
                'parent_id' => $aro->parent_id,
                'foreign_key' => $aro->foreign_key,
                'model' => $aro->model
            ];
        } else {
            $conditions = [
                'parent_id IS NULL',
                'foreign_key' => $aro->foreign_key,
                'model' => $aro->model
            ];
        }

        return $this->Acl->Aro->find('all', [
            'conditions' => $conditions,
            'recursive' => -1
        ])->count();
    }