Interface.php #1

  • //
  • guest/
  • perforce_software/
  • chronicle/
  • main/
  • library/
  • P4/
  • Validate/
  • Interface.php
  • View
  • Commits
  • Open Download .zip Download (1 KB)
<?php
/**
 * Provide a validate interface that is compatible with Zend_Validate
 * but does not require it. If Zend_Validate is present, extends from
 * Zend_Validate_Interface. Otherwise, declares a compatible interface
 * from scratch.
 */
if (interface_exists('Zend_Validate_Interface')) {

/**
 * Zend_Validate is present, use it. This is important if
 * outside code is type-checking against this interface.
 *
 * @copyright   2011 Perforce Software. All rights reserved.
 * @license     Please see LICENSE.txt in top-level folder of this distribution.
 * @version     <release>/<patch>
 */
interface P4_Validate_Interface extends Zend_Validate_Interface
{
}

} else {

/**
 * Define a interface compatible with Zend_Validate.
 *
 * @copyright   2011 Perforce Software. All rights reserved.
 * @license     Please see LICENSE.txt in top-level folder of this distribution.
 * @version     <release>/<patch>
 */
interface P4_Validate_Interface
{
    /**
     * Check if value meets validation requirements.
     *
     * If the given value is invalid, this method will return false
     * and getMessages() will provide an array of errors.
     *
     * @param   mixed   $value  the value to validate
     * @return  bool    true if the value is valid; false otherwise.
     */
    public function isValid($value);

    /**
     * Get errors for the most recent isValid() check.
     *
     * @return  array   list of error messages.
     */
    public function getMessages();
}

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