Source for file note.php
Documentation is available at note.php
* @package Joomla.Administrator
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @package Joomla.Administrator
* The type alias for this content type.
* Method to get the record form.
* @param array $data Data for the form.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
* @return mixed A JForm object on success, false on failure
public function getForm($data =
array(), $loadData =
true)
$form =
$this->loadForm('com_users.note', 'note', array('control' =>
'jform', 'load_data' =>
$loadData));
* Method to get a single record.
* @param integer $pk The id of the primary key.
* @return mixed Object on success, false on failure.
public function getItem($pk =
null)
$result =
parent::getItem($pk);
// Get the dispatcher and load the users plugins.
// Trigger the data preparation event.
$dispatcher->trigger('onContentPrepareData', array('com_users.note', $result));
* Method to get a table object, load it if necessary.
* @param string $name The table name. Optional.
* @param string $prefix The class prefix. Optional.
* @param array $options Configuration array for model. Optional.
* @return JTable The table object
public function getTable($name =
'Note', $prefix =
'UsersTable', $options =
array())
* Method to get the data that should be injected in the form.
* @return mixed The data for the form.
// Check the session for previously entered form data.
$data =
$app->getUserState('com_users.edit.note.data', array());
// Prime some default values.
$data->set('catid', $app->input->get('catid', $app->getUserState('com_users.notes.filter.category_id'), 'int'));
$userId =
$app->input->get('u_id', 0, 'int');
$data->user_id =
$userId;
* Method to auto-populate the model state.
* Note. Calling getState in this method will result in recursion.
$this->setState('note.user_id', $userId);
* Method to save the form data.
* @param array $data The form data.
* @return boolean True on success.
/*public function save($data)
$pk = (!empty($data['id'])) ? $data['id'] : (int) $this->getState('note.id');
$table = $this->getTable();
if (!$table->bind($data))
$this->setError($table->getError());
// JTableCategory doesn't bind the params, so we need to do that by hand.
if (isset($data['params']) && is_array($data['params']))
$registry = new JRegistry();
$registry->loadArray($data['params']);
$table->params = $registry->toString();
// This will give us INI format.
$this->setError($table->getError());
$this->setError($table->getError());
$this->setState('note.id', $table->id);
Documentation generated on Tue, 19 Nov 2013 15:09:37 +0100 by phpDocumentor 1.4.3