本文整理匯總了PHP中Base::query方法的典型用法代碼示例。如果您正苦於以下問題:PHP Base::query方法的具體用法?PHP Base::query怎麽用?PHP Base::query使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Base
的用法示例。
在下文中一共展示了Base::query方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: findByColumn
public function findByColumn($column, $value)
{
$sql = "SELECT * FROM " . static::$table . " WHERE {$column}=:value";
$class = get_called_class();
$db = new Base();
$db->setClassName($class);
return $db->query($sql, [':value' => $value])[0];
}
示例2: setTKPunishMode
/**
* Sets punish mode for team kills.
*
* @param int $value
*/
public function setTKPunishMode($value)
{
Base::query("exec admin.TKPunishMode {$value}");
}
示例3: setKillCam
/**
* Leftover from BFBC2
* Try admin (admin = role) instead of vars.
*
* @param boolean $enabled Enable or Disable Killcam
*
* @return
*/
public function setKillCam($enabled = true)
{
$data = Base::query('admin.killCam ' . (bool) $enabled);
// $data = Base::query('vars.killCam ' . ((boolean)$enabled));
return $data;
}
示例4: sendPlayer
/**
* Sends a Private Message to a Player
*
* @param string|int $player Must be exact soldier name or playerindex
* @param string $message text
*
* @return string
*/
public function sendPlayer($player, $message)
{
return trim(Base::query('exec game.sayToPlayerWithName ' . $player . ' "' . $message . '"'));
//return trim(Base::query('bf2cc sendplayerchat \"' . $player . '\" ' . $message . ""));
}