Return an array of aggregated IDs.

@param  string

@return array
779725
public function getIds($key = null)
    {
        if (!isset($this->_mixer->__ids)) {
            $this->_mixer->__ids = array();
        }

        $prop = $key ? $key : 'id';
        $key = $key ? $key.'_ids' : 'ids';

        if (!isset($this->_mixer->__ids[$key])) {
            $columns = $this->getRowData();

            if (!empty($columns[$key])) {
                $ids = explode(',', $columns[$key]);
            } else {
                $ids = isset($this->$prop) ? ($prop == 'id' ? array($this->id) : array($this->$prop->id)) : array();
            }

            $this->_mixer->__ids[$key] = $ids;
        }

        return $this->_mixer->__ids[$key];
    }
596496
public static function objectsToIds($h)
    {
        if ($h instanceof \Stripe\ApiResource) {
            return $h->id;
        } elseif (static::isList($h)) {
            $results = [];
            foreach ($h as $v) {
                array_push($results, static::objectsToIds($v));
            }
            return $results;
        } elseif (is_array($h)) {
            $results = [];
            foreach ($h as $k => $v) {
                if (is_null($v)) {
                    continue;
                }
                $results[$k] = static::objectsToIds($v);
            }
            return $results;
        } else {
            return $h;
        }
    }
827588
public function getGroupIdArr()
    {
        $return = [];
        if ($this->group_ids) {
            $return = array_filter(StringHelper::explode($this->group_ids, ',', true, true), function ($groupId) {
                return is_numeric($groupId) && DpAdminGroup::find()->findByGroupId($groupId)->exists();
            });
        }

        return $return;
    }
283601
private function getIdsWithAttributes($id, $attributes = [])
    {
        $ids = [];

        if ($id instanceof Model) {
            $ids[$id->getKey()] = $attributes;
        } elseif ($id instanceof Collection) {
            foreach ($id as $model) {
                $ids[$model->getKey()] = $attributes;
            }
        } elseif (is_array($id)) {
            foreach ($id as $key => $attributesArray) {
                if (is_array($attributesArray)) {
                    $ids[$key] = array_merge($attributes, $attributesArray);
                } else {
                    $ids[$attributesArray] = $attributes;
                }
            }
        } elseif (is_int($id) || is_string($id)) {
            $ids[$id] = $attributes;
        }

        $idsOnly = array_keys($ids);

        return [$idsOnly, $ids];
    }
290949
public function id($as_array = false)
    {
        $keys = static::getMapper()->getPrimaryKey();
        $id = [];

        foreach ($keys as $key) {
            $id[$key] = $this->get($key);
        }

        if ($as_array || count($id) > 1) {
            return $id;
        }

        return current($id);
    }
381655
public function getUsedTypeIds()
    {
        $types = array();

        $db   = $this->getDb();
        $rows = $db->fetchAll("SELECT DISTINCT `type` as typeid FROM " . $this->table);

        foreach ($rows as $row) {
            $types[] = $row['typeid'];
        }

        return $types;
    }
1261217
protected function getIDListFromDB() : array
    {
        if ($this->sValue == ProductListStore::SORT_PRICE_ASC) {
            $arElementIDList = $this->getByPriceASC();
        } elseif ($this->sValue == ProductListStore::SORT_PRICE_DESC) {
            $arElementIDList = $this->getByPriceDESC();
        } elseif ($this->sValue == ProductListStore::SORT_NEW) {
            $arElementIDList = $this->getNewProductList();
        } elseif ($this->sValue == ProductListStore::SORT_NO) {
            $arElementIDList = $this->getProductList();
        } elseif (preg_match('%^'.ProductListStore::SORT_PRICE_ASC.'\|.+%', $this->sValue)) {
            $arElementIDList = $this->getByPriceTypeASC();
        } elseif (preg_match('%^'.ProductListStore::SORT_PRICE_DESC.'\|.+%', $this->sValue)) {
            $arElementIDList = $this->getByPriceTypeDESC();
        } else {
            $arElementIDList = $this->getCustomSortingList();
        }

        return $arElementIDList;
    }
945617
function getAwaitingsByID(string $id) {
        $objs = array();
        
        foreach($this->awaiting as $key => $value) {
            if(\strpos($key, $id) !== false) {
                $objs[$key] = $value;
            }
        }
        
        return $objs;
    }
443664
public function itemsGet($ids) {
		if ((!is_array($ids)) || (empty($ids))) {
			BLog::addToLog('[BItems.' . $this->tableName . '] itemsGet() $ids empty=' . var_export($ids, true) . ')', LL_ERROR);
			return array();
		}
		if (DEBUG_LOG_BITEMS) {
			BLog::addToLog('[BItems.' . $this->tableName . '] itemsGet(' . implode(',', $ids) . ')');
		}
		$items = array();
		//-------------------------------------------------
		//Trying to get items from internal cache
		//-------------------------------------------------
		$ids_c = array(); //IDs as integer
		$ids_k = array(); //IDs as external cache key
		foreach ($ids as $id) {
			$idd = is_array($id) ? implode(':', $id) : $id;
			if (isset($this->cacheItems[$idd])) {
				$items[$idd] = $this->cacheItems[$idd];
			} else {
				if (!empty($idd)) {
					$items[$idd] = NULL;
					$ids_c[$idd] = $id;
					$ids_k[$idd] = $this->tableName . ':itemid:' . $idd;
				}
			}
		}
		if (empty($ids_c)) {
			return $items;
		}

		//-------------------------------------------------
		//Trying to get left items from external cache
		//-------------------------------------------------
		$cache = BFactory::getCache();
		if (!empty($cache)) {
			$ids_m = array();
			$ids_q = array();
			$items_c = $cache->mget($ids_k);
			foreach ($ids_c as $id) {
				$idd = is_array($id) ? implode(':', $id) : $id;
				$key = $this->tableName . ':itemid:' . $idd;
				if ((isset($items_c[$key])) && (!empty($items_c[$key]))) {
					$classname = $this->itemClassName;
					$items[$idd] = new $classname();
					$items[$idd]->load($items_c[$key]);
					$this->cacheItems[$idd] = $items[$idd];
				} else {
					array_push($ids_m, $id);
					array_push($ids_q, $id);
				}
			}
		} else {
			$ids_m = $ids_c;
			$ids_q = $ids_c;
		}
		if (empty($ids_m)) {
			return $items;
		}
		//-------------------------------------------------
		// Trying to get left items from database
		//-------------------------------------------------
		$db = BFactory::getDBO();
		if (empty($db)) {
			return $items;
		}
		if (is_array($this->primaryKeyName)) {
			$whi = array();
			foreach ($ids_q as $id) {
				$s = array();
				foreach ($id as $idk => $idv) {
					$s[] = '(`' . $idk . '`=' . $db->escapeString($idv) . ')';
				}
				$whi[] = '(' . implode(' AND ', $s) . ')';
			}
			$wh = implode(' OR ', $whi);
			$qr = 'SELECT * from `' . $this->tableName . '` WHERE (' . $wh . ')';
		} else {
			$qr = 'SELECT * from `' . $this->tableName . '` WHERE (`' . $this->primaryKeyName . '` in (' . implode(',', $ids_q) . '))';
		}
		$q = $db->Query($qr);
		if (empty($q)) {
			BLog::addToLog('[items]: itemsGet(): Could not execute query! MySQL error: ' . $db->lasterror(), LL_ERROR);
			return $items;
		}
		$tocache = array();
		$item_obj = array();
		while ($l = $db->fetch($q)) {
			if (is_array($this->primaryKeyName)) {
				$id = array();
				foreach ($this->primaryKeyName as $pk) {
					$id[$pk] = $l[$pk];
				}
				$idd = implode(':', $id);
				$item_obj[$idd] = $l;
			} else {
				$idd = (int)$l[$this->primaryKeyName];
				$item_obj[$idd] = $l;
			}
			foreach ($this->linkedTables as $tbl) {
				$item_obj[$idd][$tbl['field']] = array();
			}
		}
		//-------------------------------------------------
		// Loading data from external tables...
		//-------------------------------------------------
		if (DEBUG_LOG_BITEMS) {
			BLog::addToLog('[BItems.' . $this->tableName . '] itemsGet() Loading data from external tables...');
		}
		foreach ($this->linkedTables as $tbl) {
			$wh = array();
			$wh[] = '(`' . $tbl['extkey'] . '` in (' . implode(',', $ids_q) . '))';
			if (!empty($tbl['filter'])) {
				$wh[] = $tbl['filter'];
			}
			$qrl = 'SELECT * from `' . $tbl['name'] . '` WHERE (' . implode(' AND ', $wh) . ')';
			$ql = $db->Query($qrl);
			if (empty($ql)) {
				BLog::addToLog('[items]: itemsGet(): Could not execute external tables query! MySQL error: ' . $db->lasterror(), LL_ERROR);
				return false;
			}
			$datal = array();
			while ($ll = $db->fetch($ql)) {
				$itemid = (int)$ll[$tbl['extkey']];
				$item_obj[$itemid][$tbl['field']][] = $ll;
			}
		}
		//-------------------------------------------------
		// Creating item object...
		//-------------------------------------------------
		if (DEBUG_LOG_BITEMS) {
			BLog::addToLog('[BItems.' . $this->tableName . '] itemsGet() Creating item objects...');
		}
		foreach ($item_obj as $k => $l) {
			$classname = $this->itemClassName;
			if (!class_exists($classname)) {
				$msg = 'Class "' . $classname . '" does not exist!';
				BLog::addToLog($msg, LL_ERROR);
				die($msg);
			}
			$items[$k] = new $classname();
			$items[$k]->load($l);
			$this->cacheItems[$k] = $items[$k];
			if (CACHE_TYPE) {
				$tocache[$this->tableName . ':itemid:' . $k] = $l;
			}
		}
		//-------------------------------------------------
		// Cache storing, if necessary.
		//-------------------------------------------------
		if ((!empty($cache)) && (count($tocache) != 0)) {
			$cache->mset($tocache, $this->cacheTime);//1 hour
		}
		if (DEBUG_LOG_BITEMS) {
			BLog::addToLog('[BItems.' . $this->tableName . '] itemsGet() All done! Returning items.');
		}
		return $items;
	}
595837
public function many( array $ids = [] ) {
        if( count( $ids ) === 0 ) {
            return [];
        }

        $pages = array_chunk( $ids, $this->maxPageSize() );

        $requests = [];
        foreach( $pages as $page ) {
            $requests[] = [ 'ids' => implode( ',', $page ) ];
        }

        $responses = $this->requestMany( $requests );

        $result = [];
        foreach( $responses as $response ) {
            $result = array_merge( $result, $response->json() );
        }

        return $result;
    }
1129473
static public function getIdParents($id = null)
    {
        $id = ($id) ? $id : self::getIdActiveMenu();
        
        $idParent = self::getMapIdParent();
        
        if (!is_array( $id ))
        {
            if (isset( $idParent[ $id ] ))
            {
                $id = array($id);
            }
            else
            {
                return array();
            }
        }
        
        if (isset( $idParent[ end( $id ) ] ))
        {
            if (isset($idParent[ $idParent[ end( $id ) ] ]))
            {
                $id[] = $idParent[ end( $id ) ];
                return self::getIdParents($id);
            }
        }        
        
        return array_reverse( $id );       
    }
526109
protected function getIDListFromDB() : array
    {
        switch ($this->sValue) {
            case PromoBlockListStore::SORT_DATE_BEGIN_ASC:
                $arElementIDList = $this->getByDateBeginASC();
                break;
            case PromoBlockListStore::SORT_DATE_BEGIN_DESC:
                $arElementIDList = $this->getByDateBeginDESC();
                break;
            case PromoBlockListStore::SORT_DATE_END_ASC:
                $arElementIDList = $this->getByDateEndASC();
                break;
            case PromoBlockListStore::SORT_DATE_END_DESC:
                $arElementIDList = $this->getByDateEndDESC();
                break;
            case PromoBlockListStore::SORT_DEFAULT:
                $arElementIDList = $this->getBySortOrder();
                break;
            default:
                $arElementIDList = $this->getCustomSortingList();
                break;
        }

        return $arElementIDList;
    }
1105991
public function getIds($toArray = true): array
    {
        $ids = array_keys($this->services);

        return $toArray ? $ids : implode(', ', $ids);
    }
598234
public function keys(int $fd): array
    {
        $existsKeys = [];

        $keys = $this->redis->keys('*');
        foreach ($keys as $key) {
            if ($this->redis->sismember($key, $fd)) {
                $existsKeys[] = $key;
            }
        }

        return $existsKeys;
    }
956611
public function getCostCenterChildrenIds($id)
  {
    $ids = array();

    $this->CostCenter->byParent($id)->each(function($CostCenter) use (&$ids)
    {
      if($CostCenter->is_group)
      {
        $ids = array_merge($ids, $this->getCostCenterChildrenIds($CostCenter->id));
      }

      array_push($ids, $CostCenter->id);
    });

    return $ids;
  }
889182
function _getId($string)
	{
		if (preg_match('/id=("([^"]*)"|\'([^\']*)\'|[^>\s]*)([^>]*)?>/is', $string, $match)) {
			//preg_match('/name=["\']?([\w\s]*)["\']?[\s>]/i', $string, $match)) { -- did not work as expected
			$val_match = trim($match[1]);
			$val_match = trim($val_match, '"\'');
			unset($string);
			return $val_match;
		}
		return false;
	}
636556
public function all($status = 'ACTIVE')
    {
        $ids = [$this->data->primary_id];
        foreach ($this->data->user_identifier as $identifier) {
            if (is_null($status) || $identifier->status == $status) {
                $ids[] = $identifier->value;
            }
        }

        return $ids;
    }