ConnectedInterface.php #1

  • //
  • guest/
  • perforce_software/
  • chronicle/
  • main/
  • library/
  • P4/
  • ConnectedInterface.php
  • View
  • Commits
  • Open Download .zip Download (2 KB)
<?php
/**
 * Provides a common interface for connected models.
 *
 * @copyright   2011 Perforce Software. All rights reserved.
 * @license     Please see LICENSE.txt in top-level folder of this distribution.
 * @version     <release>/<patch>
 */
interface P4_ConnectedInterface
{
    /**
     * Instantiate the model and set the connection to use.
     *
     * @param   P4_Connection_Interface $connection  optional - a connection to use for this instance.
     */
    public function __construct(P4_Connection_Interface $connection = null);

    /**
     * Set the Perforce connection to use when
     * issuing Perforce commands for this instance.
     *
     * @param   P4_Connection_Interface $connection     the connection to use for this instance.
     * @return  P4_ModelAbstract        provides fluent interface.
     */
    public function setConnection(P4_Connection_Interface $connection);

    /**
     * Get the Perforce connection used by this model.
     *
     * @return  P4_Connection_Interface  the connection instance used by this model.
     */
    public function getConnection();

    /**
     * Get the default Perforce connection to use.
     *
     * @return  P4_Connection_Interface  the default connection.
     */
    public static function getDefaultConnection();

    /**
     * Determine if this model has a connection to Perforce.
     *
     * @return  bool  true if the model has a connection to Perforce.
     */
    public function hasConnection();

    /**
     * Clear this model's connection. This is primarily for testing purposes.
     */
    public function clearConnection();
}
# Change User Description Committed
#1 16170 perforce_software Move Chronicle files to follow new path scheme for branching.
//guest/perforce_software/chronicle/library/P4/ConnectedInterface.php
#1 8972 Matt Attaway Initial add of the Chronicle source code