lithium\data\model\Relationship::_list()

protected method

Extract embedded hasMany foreign keys from collection.

Parameters

  • mixed

    $collection An collection to extract keys from.

  • string $name

    The field name of the key.

Returns

array

An array of keys.

Source

	protected function _list($collection, $name) {
		$list = [];
		foreach ($collection as $key => $entity) {
			$array = is_object($entity) ? $entity->{$name} : $entity[$name];
			foreach ($array as $id) {
				$list[] = $id;
			}
		}
		return $list;
	}