Back to TableInterface class

Method load

public bool
load
(mixed $keys = null, mixed $reset = true)
Method to load a row from the database by primary key and bind the fields to the TableInterface instance properties.
Parameters
  • mixed $keys An optional primary key value to load the row by, or an array of fields to match. If not set the instance property value is used.
  • bool $reset True to reset the default values before loading the new row.
Returns
  • bool True if successful. False if row not found.
Since
  • 3.2
-
  • \RuntimeException
  • \UnexpectedValueException

Method load - Source code

/**
 * Method to load a row from the database by primary key and bind the fields to the TableInterface instance properties.
 *
 * @param   mixed    $keys   An optional primary key value to load the row by, or an array of fields to match.  If not
 *                           set the instance property value is used.
 * @param   boolean  $reset  True to reset the default values before loading the new row.
 *
 * @return  boolean  True if successful. False if row not found.
 *
 * @since   3.2
 * @throws  \RuntimeException
 * @throws  \UnexpectedValueException
 */
public function load($keys = null, $reset = true);