本文整理汇总了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 . ""));
}