Skip to content

Instantly share code, notes, and snippets.

@jimbojsb
Created November 29, 2012 20:25
Show Gist options
  • Save jimbojsb/4171673 to your computer and use it in GitHub Desktop.
Save jimbojsb/4171673 to your computer and use it in GitHub Desktop.
deduplicator
<?php
class Deduplicator
{
protected $items = [];
public function add($item)
{
// name field will be in $item->name
$this->items[] = $item;
}
/**
* @return array an array of objects
*/
public function getDeduplicatedItems()
{
// magic
// assume we might want to add functionality to this beyond just name-based deduplication in the future at some point
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment