Skip to content

Commit

Permalink
Use base collection for unique(), contains()
Browse files Browse the repository at this point in the history
  • Loading branch information
RemiCollin committed May 30, 2018
1 parent 8c09f91 commit d1548cb
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions src/EntityCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,27 +139,6 @@ public function offsetSet($key, $value)
}
}

/**
* Determine if a key exists in the collection.
*
* @param mixed $key
* @param mixed|null $value
*
* @return bool
*/
// public function contains($key, $value = null)
// {
// if (func_num_args() == 2) {
// return !$this->where($key, $value)->isEmpty();
// }

// if ($this->useAsCallable($key)) {
// return !is_null($this->first($key));
// }

// return !is_null($this->find($key));
// }

/**
* Fetch a nested element of the collection.
*
Expand Down Expand Up @@ -427,23 +406,6 @@ public function lists($value, $key = null)
return $this->pluck($value, $key);
}

/**
* Return only unique items from the collection.
*
* @param string|null $key
* @param bool $strict
*
* @throws MappingException
*
* @return self
*/
public function unique($key = null, $strict = false)
{
$dictionary = $this->getDictionary();

return new static(array_values($dictionary));
}

/**
* Unset the item at a given offset.
*
Expand Down

0 comments on commit d1548cb

Please sign in to comment.