abstract class Backend_Controller_Crud

This is the base class for creating controllers of the CRUD backend applications (creating, editing, updating, deleting) for ORM objects (DVelum 0.9 and higher).

abstract class Backend_Controller_Crud extends Backend_Controller
{
    /**
     * List of ORM object field names displayed in the main list (listAction)  
     * They may be assigned a value,
     * as well as an array 
     */
    protected $_listFields = '*';	

    /**
     * Get list of items. Returns JSON  reply with 
     * ORM object field data;
     * Filtering, pagination and search are available
     * Sends JSON reply in the result
     * and closes the application.
     */
    public function listAction()

    /**
     * Get ORM object data
     * Sends a JSON reply in the result and
     * closes the application
     */
    public function loaddataAction()

    /**
     * Get ready the data for fields of the ‘link to object list’ type;
     * Takes an array of identifiers as a parameter. expands the data adding object name, 
     * status (deleted or not deleted), publication status for objects under 
     * version control (used in child classes)
     * The provided data is necessary for the RelatedGridPanel component,
     * which is used for visual representation of relationship management.
     * @param array $data
     * @param string $objectName
     * @return array
     */
    protected function _collectLinksData(array $data , $objectName)

    /**
     * Create/edit object data
     * The type of operation is defined as per the parameters being transferred
     * Sends JSON reply in the result and
     * closes the application
     */
    public function editAction()

    /**
     * Create object
     * Sends JSON reply in the result and
     * closes the application
     */
    public function createAction()

    /**
     * Update object data
     * Sends JSON reply in the result and
     * closes the application
     */
    public function updateAction()

    /**
     * Delete object 
     * Sends JSON reply in the result and
     * closes the application
     */
    public function deleteAction()

    /**
     * Save new ORM object (insert data) 
     * Sends JSON reply in the result and
     * closes the application
     * @param Db_Object $object
     * @return void
     */
    public function insertObject(Db_Object $object)

    /**
     * Update ORM object data
     * Sends JSON reply in the result and
     * closes the application
     * @param Db_Object $object
     */
    public function updateObject(Db_Object $object)

    /**
     * Get name of the object, which edits the controller
     * @return string
     */
    public function getObjectName()
}

comments powered by Disqus