ModelAbstract.php #1

  • //
  • guest/
  • perforce_software/
  • chronicle/
  • main/
  • library/
  • P4/
  • ModelAbstract.php
  • View
  • Commits
  • Open Download .zip Download (675 B)
<?php
/**
 * Provides a base implementation for models that utilize fields.
 *
 * @copyright   2011 Perforce Software. All rights reserved.
 * @license     Please see LICENSE.txt in top-level folder of this distribution.
 * @version     <release>/<patch>
 */
abstract class P4_ModelAbstract extends P4_ConnectedAbstract implements P4_ModelInterface
{
    /**
     * Get the model data as an array.
     *
     * @return  array   the model data as an array.
     */
    public function toArray()
    {
        $values = array();
        foreach ($this->getFields() as $field) {
            $values[$field] = $this->getValue($field);
        }

        return $values;
    }
}
# Change User Description Committed
#1 16170 perforce_software Move Chronicle files to follow new path scheme for branching.
//guest/perforce_software/chronicle/library/P4/ModelAbstract.php
#1 8972 Matt Attaway Initial add of the Chronicle source code