我正在尝试使用R中的create unique_index(:people, [:phone_number)
函数进行变量选择。但它一直出错。
然后我发现现在没有像以前那样的基本step()
功能。混合模型的step()
包中有一个阶梯函数。
有没有人知道替代功能呢?
以下是错误的屏幕截图:
答案 0 :(得分:1)
显然private void OnMenuItemSelected(object sender, SelectedItemChangedEventArgs e)
{
var item = (SideMenuItem)e.SelectedItem;
var page = item.TargetType;
if (page == typeof(PageToDisableMenu))
IsGestureEnabled = false;
Detail = new NavigationPage((Page)Activator.CreateInstance(page));
IsPresented = false;
}
(我假设它是你想要使用的函数)被另一个包掩盖(可能是class DB
{
private static $_instance = null;
private $_conn,
$_query,
$_error = false,
$_result,
$_count = 0;
/**
*
*/
private function __construct()
{
$servername = Config::get("mysql/host");
$username = Config::get("mysql/username");
$password = Config::get("mysql/password");
$database = Config::get("mysql/db");
$this->_conn = new mysqli($servername, $username, $password, $database);
}
public static function getInstance()
{
if(!isset(self::$_instance)){
self::$_instance = new DB;
}
return self::$_instance;
}
public function query($sql)
{
$this->_error = false;
if ($this->_query = $this->_conn->query($sql)) {
$this->_result = $this->_query->fetch_object();
$this->_count = $this->_query->num_rows;
} else {
$this->_error = true;
}
return $this;
}
private function action($action, $table, $where = array())
{
if(count($where) === 3) {
$operators = array('=', '>', '<', '>=', '<=');
$field = $where[0];
$operator = $where[1];
$value = $where[2];
if(in_array($operator, $operators)) {
$sql = "{$action} FROM {$table} WHERE {$field} {$operator} '{$value}'";
if (!$this->query($sql)->error()) {
return $this;
}
}
} elseif (count($where) === 0) {
$sql = "{$action} FROM {$table}";
if (!$this->query($sql)->error()) {
return $this;
}
}
return false;
}
public function get($table, $where = array())
{
return $this->action("SELECT *", $table, $where);
}
)。
您是否尝试使用包名?
$db = DB::getInstance();
$results1 = $db->get('pages')->results();
$results2 = $db->get('pages', ["id", "=", 2])->results();
var_dump($results1); // Returns first row
var_dump($results2); // Returns second row