Perforce Chronicle 2012.2/486814
API Documentation

P4Cms_Diff_ResultCollection Class Reference

Collection of named diff results. More...

List of all members.

Public Member Functions

 __construct (array $results, P4Cms_Diff_OptionsCollection $options)
 Create a new diff result collection from array of results.
 getDiffCount ()
 Count all of the differences across all diff results.
 getOptionsCollection ()
 Get the original options collection that produced this result (ie.
 hasDiffs ()
 Determine if there are any differences in this collection.

Protected Attributes

 $_options = null

Detailed Description

Collection of named diff results.

Copyright:
2011-2012 Perforce Software. All rights reserved
License:
Please see LICENSE.txt in top-level folder of this distribution.
Version:
2012.2/486814

Constructor & Destructor Documentation

P4Cms_Diff_ResultCollection::__construct ( array $  results,
P4Cms_Diff_OptionsCollection options 
)

Create a new diff result collection from array of results.

Parameters:
array$resultsarray of diff results.
P4Cms_Diff_OptionsCollection$optionsoriginal options collection.
    {
        $this->_options = $options;
        parent::__construct($results);
    }

Member Function Documentation

P4Cms_Diff_ResultCollection::getDiffCount ( )

Count all of the differences across all diff results.

Returns:
int the total count of differences.
    {
        $count = 0;
        foreach ($this as $result) {
            if ($result instanceof P4Cms_Diff_Result) {
                $count += $result->getDiffCount();
            }
        }

        return $count;
    }
P4Cms_Diff_ResultCollection::getOptionsCollection ( )

Get the original options collection that produced this result (ie.

the options passed to the compare method).

Returns:
P4Cms_Diff_OptionsCollection the original options collection.
    {
        return $this->_options;
    }
P4Cms_Diff_ResultCollection::hasDiffs ( )

Determine if there are any differences in this collection.

Returns:
bool true if there are differences; false otherwise.
    {
        return (bool) $this->getDiffCount();
    }

Member Data Documentation

P4Cms_Diff_ResultCollection::$_options = null [protected]

The documentation for this class was generated from the following file: