EnhancedElementInterface.php #1

  • //
  • guest/
  • perforce_software/
  • chronicle/
  • main/
  • library/
  • P4Cms/
  • Content/
  • EnhancedElementInterface.php
  • View
  • Commits
  • Open Download .zip Download (2 KB)
<?php
/**
 * Provides a contract for form elements to be enhanced for
 * use with content records:
 *
 *  - Specifies methods to associate an element with a content
 *    record. This is useful when rendering "display" decorators
 *    for an element as it allows decorators to access the content
 *    record and pull out other information (e.g. a download link
 *    when decorating a file element).
 *
 *  - Specifies method to provide default decorators to use when
 *    rendering content values for display. Not to be confused with
 *    standard form element decorators which render form inputs.
 *
 * @copyright   2011 Perforce Software. All rights reserved.
 * @license     Please see LICENSE.txt in top-level folder of this distribution.
 * @version     <release>/<patch>
 */
interface P4Cms_Content_EnhancedElementInterface
{
    /**
     * Get the associated content record (if set).
     * 
     * @return  null|P4Cms_Content  the associated content record or null if none set.
     */
    public function getContentRecord();

    /**
     * Set the associated content record for this element.
     *
     * @param  P4Cms_Content  $content  the associated content record for this element.
     */
     public function setContentRecord($content);

    /**
     * Get the default decorators to use when rendering content
     * element values of this type for display.
     *
     * @return  array   decorators configuration array suitable for passing
     *                  to element setDecorators().
     */
    public function getDefaultDisplayDecorators();
}
# Change User Description Committed
#1 16170 perforce_software Move Chronicle files to follow new path scheme for branching.
//guest/perforce_software/chronicle/library/P4Cms/Content/EnhancedElementInterface.php
#1 8972 Matt Attaway Initial add of the Chronicle source code