本文整理汇总了PHP中Site::id方法的典型用法代码示例。如果您正苦于以下问题:PHP Site::id方法的具体用法?PHP Site::id怎么用?PHP Site::id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Site
的用法示例。
在下文中一共展示了Site::id方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: constructValuesCondition
public function constructValuesCondition($data)
{
$result = '';
foreach ($data as $k => $v) {
if (!empty($result)) {
$result .= ',';
}
if ($this->fields[$k] == "site_id") {
$v = Site::id();
}
$result .= "'" . $this->db->escape($v) . "'";
}
return '(' . $result . ')';
}
示例2: get
public static function get($module_key, $key, $siteId = false)
{
if (empty($siteId)) {
$siteId = Site::id();
}
if (isset(self::$temp[$siteId][$module_key][$key])) {
return self::$temp[$siteId][$module_key][$key];
}
if (empty(self::$loaded[$siteId])) {
self::init($siteId);
}
if (!isset(self::$data[$siteId][$module_key][$key])) {
return false;
}
return self::$data[$siteId][$module_key][$key];
}
示例3: prepareDir
public static function prepareDir($filename, $ext = false)
{
if (!empty($ext)) {
$filename .= "." . $ext;
}
$r = App::uploads() . '/' . static::$dir . '/';
@mkdir($r, 0777);
@chmod($r, 0777);
$r .= Site::id();
@mkdir($r, 0777);
@chmod($r, 0777);
$hash = md5($filename);
$first = substr($hash, 0, 2);
$second = substr($hash, 2, 2);
@mkdir($r . "/" . $first, 0777);
@chmod($r, 0777);
@mkdir($r . "/" . $first . "/" . $second, 0777);
@chmod($r, 0777);
}
示例4: __construct
public function __construct($siteId = false)
{
//TODO: make tables prefixes
if (empty($this->primaryKey)) {
$this->primaryKey = str_replace("cody_", "", $this->table) . "_id";
}
$db = DB::get();
parent::__construct($this->table, $db);
if ($siteId !== false) {
$this->siteId = intval($siteId);
$this->accountId = Site::accountId($siteId);
} else {
$this->siteId = Site::id();
$this->accountId = Site::accountId();
}
if ($this->useSiteId) {
$this->whereBy('site_id', $this->siteId);
}
if ($this->useAccountId) {
$this->whereBy('account_id', $this->accountId);
}
}
示例5: forSite
public static function forSite()
{
return self::where('site_id', '=', Site::id());
}