OrderItem::uniquedata PHP Method

uniquedata() public method

This is used for uniquely adding items to the cart.
public uniquedata ( )
    public function uniquedata()
    {
        $required = self::config()->required_fields;
        //TODO: also combine with all ancestors of this->class
        $data = $this->record;
        $unique = array();
        //reduce record to only required fields
        if ($required) {
            foreach ($required as $field) {
                if ($this->has_one($field)) {
                    $field = $field . "ID";
                    //add ID to hasones
                }
                $unique[$field] = $this->{$field};
            }
        }
        return $unique;
    }