Back to Extension class

Method find

public string
find
(mixed $options = array())
Method to create and execute a SELECT WHERE query.
Parameters
  • array $options Array of options
Returns
  • string The database query result
Since
  • 1.7.0
Class: Extension
Project: Joomla

Method find - Source code

/**
 * Method to create and execute a SELECT WHERE query.
 *
 * @param   array  $options  Array of options
 *
 * @return  string  The database query result
 *
 * @since   1.7.0
 */
public function find($options = array())
{
    // Get the DatabaseQuery object
    $query = $this->_db->getQuery(true);
    foreach ($options as $col => $val) {
        $query->where($col . ' = ' . $this->_db->quote($val));
    }
    $query->select($this->_db->quoteName('extension_id'))->from($this->_db->quoteName('#__extensions'));
    $this->_db->setQuery($query);
    return $this->_db->loadResult();
}