Get row values from a list of objects

This will almost always have the exact same body. This is provided for
convenience, commented out below the definition.

@param $meta Amiss\Meta or string used to call getMeta()
490312
public function mapObjectsToRows($objects, $meta=null, $context=null)
    {
        if (!$objects) { return []; }

        if (!$meta instanceof Meta) {
            $meta = $this->getMeta($meta ?: get_class(current($objects)));
        }

        $out = [];
        foreach ($objects as $key => $object) {
            $out[$key] = $this->mapObjectToRow($object, $meta, $context);
        }
        return $out;
    }
398624
protected function onMetaReceived($metaData)
    {
        $keys = array_keys($metaData["columns"]);
        $values = array_values($metaData["columns"]);

        for ($i = 0; $i < count($keys); $i++) {
            if (isset($this->params[$keys[$i]])) {
                $keys[$i] = $this->params[$keys[$i]];
            }
        }
        $metaData["columns"] = array_combine($keys, $values);
        return $metaData;
    }
278652
public function getMetaValue($name)
    {
        /** @var PostMeta $meta */
        foreach ($this->getMetas() as $meta) {
            if ($name == $meta->getKey()) {
                return $meta->getValue();
            }
        }

        return;
    }
263231
public function getMetaTables(){
        $stmt = $this->query(self::META_TABLES_SQL);
        if ($stmt === false){
            return array();
        }

        $rows = array();
        foreach ($stmt as $row){
            $rows[] = $row[0];
        }

        return $rows;
    }
1256852
protected function castPropertiesMeta(array $meta): array
    {
        $properties = [];
        foreach ($meta['@properties'] ?? [] as $name => $data) {
            $properties[$name] = new MetaProperty($data);
        }

        return $properties;
    }
1309815
public static function fromMetadata(string $metadata): ? array
    {
        $values = [];
        $splittedParts = explode('~~', $metadata);

        foreach ($splittedParts as $part) {
            $parts = explode('##', $part);
            if (count($parts) > 1) {
                $values[$parts[0]] = $parts[1];
            } else {
                $values[] = $part;
            }
        }

        if (1 == count($values)) {
            $firstAndUniqueElement = reset($values);
            $values = [
                'id' => $firstAndUniqueElement,
                'name' => $firstAndUniqueElement,
            ];
        }

        if (!array_key_exists('id', $values)) {
            return null;
        }

        return $values;
    }
881542
public function getMetaData(string $key, $default = null)
    {
        $meta = $this->getAttribute('meta');

        return $meta->get($key, $default);
    }
942705
public function unsetMeta($meta = null)
	{
		$args = func_get_args();
		
		if (0 == count($args)) {
			$args[] = $this->metas;
		}
		
		foreach ($args as $arg) {
			$metas = ($arg instanceof Collection) ? $arg->all() : is_array($arg) ? $arg : array($arg);
			
			foreach ($metas as $m) {
				if (!is_object($m)) {
					$m = $this->findMetaByName($m);
				}
				
				if (!$m || !$m instanceof Eloquent) {
					continue;
				}
				
				if (!$this->hasMeta($m)) {
					return;
				}
				
				$this->metas()->detach($m);
				
				$m->decrement('num_items');
				
				foreach ($this->metas as $idx => $cur_meta) {
					if ($cur_meta->getKey() == $m->getKey()) {
						$this->metas->pull($idx);
						break;
					}
				}
			}
		}
		
		return $this;
	}
654227
protected function collectMetaDataFromConnector()
    {
        $ret = array();

        $storeMeta = $this->getStoreMeta();

        // Std meta tags
        foreach ($storeMeta['meta'] as $metaKey => $metaValue) {
            if ($metaValue === null) {
                // Remove meta
                unset($this->tsSetupSeo[$metaKey]);
            } elseif (!empty($metaValue)) {
                $this->tsSetupSeo[$metaKey] = trim($metaValue);
            }
        }

        // Custom meta tags
        foreach ($storeMeta['custom'] as $metaKey => $metaValue) {
            if ($metaValue === null) {
                // Remove meta
                unset($ret[$metaKey]);
            } elseif (!empty($metaValue)) {
                $ret[$metaKey] = trim($metaValue);
            }
        }

        return $ret;
    }
1318908
protected function _getMetadatas($id)
    {
        if (isset($this->_metadatasArray[$id])) {
            return $this->_metadatasArray[$id];
        } else {
            $metadatas = $this->_loadMetadatas($id);
            if (!$metadatas) {
                return false;
            }
            $this->_setMetadatas($id, $metadatas, false);
            return $metadatas;
        }
    }
349652
function getMeta($metaKey = null)
    {
        if ($metaKey !== null)
            return (isset($this->meta[$metaKey])) ? $this->meta[$metaKey] : null;

        return $this->meta;
    }
955084
protected QueryExprMeta arguments(QueryExprMeta meta) {
        if (this.arguments == null) this.arguments = Lists.newArrayList();
        this.arguments.add(Val.of(meta));
        return this;
    }
160620
public function setMeta(array $meta)
    {
        $this->took = isset($meta['took']) ? $meta['took'] : null;
        $this->timed_out = isset($meta['timed_out']) ? $meta['timed_out'] : null;
        $this->shards = isset($meta['_shards']) ? $meta['_shards'] : null;
        $this->hits = isset($meta['hits']) ? $meta['hits'] : null;
        $this->aggregations = isset($meta['aggregations']) ? $meta['aggregations'] : [];

        return $this;
    }
343471
public function getMetadata()
    {
        if (isset($this->raw->metadata)) {
            if (is_object($this->raw->metadata)) {
                return (array) $this->raw->metadata;
            }

            return $this->raw->metadata;
        }

        return null;
    }
1316147
public function whereAnyMeta(array $metas)
	{
		$filters = array();
		
		foreach ($metas as $meta => $data) {
			$value = is_array($data) ? Arr::get($data, 0) : $data;
			$operator = is_array($data) ? Arr::get($data, 1, '=') : '=';
			
			if (is_object($meta)) {
				$filters[] = array('id' => $meta->id, 'value' => $value, 'operator' => $operator);
			}
			else {
				$filters[] = array('name' => $meta, 'value' => $value, 'operator' => $operator);
			}
		}
		
		$this->filters[]['metas'] = $filters;
		
		return $this;
	}
452000
function findMeta(meta, names) {
  if (!meta) return null;

  if (!_.isArray(names)) names = [ names ];

  let record;

  names.some((name) => {
    record = _.find(meta, (item) => item.name === name);
    return record;
  });

  return (record || {}).value;
}
319570
function metadata($tablename) {
        $sql = "SHOW COLUMNS FROM ".$tablename;
        $q = self::queryReturnError($sql);
        if ( $q->success ) {
            return $q->fetchAll();
        } else {
            return false;
        }
    }