本文整理汇总了PHP中SessionAccountHandler::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP SessionAccountHandler::getId方法的具体用法?PHP SessionAccountHandler::getId怎么用?PHP SessionAccountHandler::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SessionAccountHandler
的用法示例。
在下文中一共展示了SessionAccountHandler::getId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insertNewTag
private function insertNewTag()
{
$InsertTag = new Model\Tag\Inserter($this->PDO, $this->TagObject);
$InsertTag->setAccountID(\SessionAccountHandler::getId());
$InsertTag->insert();
return $InsertTag->insertedID();
}
示例2: getFieldsetBlock
/**
* Get fieldset block
* @return string
*/
private function getFieldsetBlock()
{
$String = '';
foreach ($this->TrainingObjects as $i => $TrainingObject) {
$activityIDs[] = $TrainingObject->getActivityId();
}
$duplicates = (new DuplicateFinder(DB::getInstance(), SessionAccountHandler::getId()))->checkForDuplicates($activityIDs);
$countDuplicates = count(array_filter($duplicates));
$String .= HTML::info(sprintf(__('Found %s activities.'), count($this->TrainingObjects)));
if ($countDuplicates > 0) {
$String .= HTML::warning(_n('Found <strong>one</strong> duplicate activity.', 'Found duplicate activities.', $countDuplicates));
}
$String .= '<table class="fullwidth multi-import-table zebra-style c" id="multi-import-table">';
$String .= '<thead><tr><th>' . __('Import') . '</th><th>' . __('Date') . '</th><th>' . __('Duration') . '</th><th>' . __('Distance') . '</th><th colspan="4"></th></tr></thead>';
$String .= '<tbody>';
foreach ($this->TrainingObjects as $i => $TrainingObject) {
$String .= '<tr>' . $this->getTableRowFor($TrainingObject, $i, $duplicates[$TrainingObject->getActivityId()]) . '</tr>';
}
$String .= '</tbody>';
$String .= '</table>';
$String .= Ajax::wrapJSforDocumentReady('
$("#multi-import-table td").click(function(e){
if ($(e.target).closest(\'input[type="checkbox"]\').length == 0)
$(this).parent().find(\'input:checkbox\').attr(\'checked\', !$(this).parent().find(\'input:checkbox\').attr(\'checked\'));
});
');
return $String;
}
示例3: displayContent
/**
* Display the content
* @see PluginPanel::displayContent()
*/
protected function displayContent()
{
echo $this->getStyle();
echo '<div id="schuhe">';
// TODO: Use data from shoe factory
$inuse = true;
$schuhe = DB::getInstance()->query('SELECT * FROM `' . PREFIX . 'shoe` WHERE accountid = ' . SessionAccountHandler::getId() . ' ORDER BY `inuse` DESC, `km` DESC')->fetchAll();
foreach ($schuhe as $schuh) {
$Shoe = new Shoe($schuh);
if ($inuse && $Shoe->isInUse() == 0) {
echo '<div id="hiddenschuhe" style="display:none;">';
$inuse = false;
}
echo '<p style="position:relative;">
<span class="right">' . $Shoe->getKmString() . '</span>
<strong>' . ShoeFactory::getSearchLink($schuh['id']) . '</strong>
' . $this->getShoeUsageImage($Shoe->getKm()) . '
</p>';
}
if (empty($schuhe)) {
echo HTML::em(__('You don\'t have any shoes'));
}
if (!$inuse) {
echo '</div>';
}
echo '</div>';
if (!$inuse) {
echo Ajax::toggle('<a class="right" href="#schuhe" name="schuhe">' . __('Show unused shoes') . '</a>', 'hiddenschuhe');
}
echo HTML::clearBreak();
}
示例4: __construct
/**
* Construct importer
* @param string $fileName relative to FRONTEND_PATH
*/
public function __construct($fileName)
{
$this->Reader = new BigFileReaderGZip($fileName);
$this->DB = DB::getInstance();
$this->AccountID = USER_MUST_LOGIN ? SessionAccountHandler::getId() : 0;
$this->Results = new RunalyzeJsonImporterResults();
}
示例5: __construct
/**
* Constructor
* @param string $Type
*/
public function __construct($Type)
{
$ExporterClass = 'Exporter' . $Type;
if (class_exists($ExporterClass)) {
$this->Exporter = new $ExporterClass(new Context(Request::sendId(), SessionAccountHandler::getId()));
}
}
示例6: fetchByID
/**
* Fetch row by id
* @param string $table without PREFIX
* @param int $ID
* @return array
*/
public function fetchByID($table, $ID)
{
$table = str_replace(PREFIX, '', $table);
if ($table == 'account' || $table == 'plugin_conf') {
return $this->query('SELECT * FROM `' . PREFIX . $table . '` WHERE `id`=' . (int) $ID . ' LIMIT 1')->fetch();
}
return $this->query('SELECT * FROM `' . PREFIX . $table . '` WHERE `id`=' . (int) $ID . ' AND `accountid`="' . SessionAccountHandler::getId() . '" LIMIT 1')->fetch();
}
示例7: initTraining
/**
* Init training
*/
private function initTraining()
{
// TODO: Cache?
$this->ActivityContext = new Activity\Context(SharedLinker::getTrainingId(), SessionAccountHandler::getId());
if ($this->ActivityContext->activity()->id() <= 0) {
$this->ActivityContext = null;
}
}
示例8: equipmentTypeIdForNewStuff
/**
* @return int|null
*/
protected function equipmentTypeIdForNewStuff()
{
if (null === $this->NewEquipmentTypeId) {
$this->NewEquipmentTypeId = DB::getInstance()->insert('equipment_type', ['name', 'accountid'], ['RunningAHEAD', SessionAccountHandler::getId()]);
DB::getInstance()->exec('INSERT INTO `' . PREFIX . 'equipment_sport` (`sportid`, `equipment_typeid`) SELECT `id`, "' . $this->NewEquipmentTypeId . '" FROM `runalyze_sport` WHERE `accountid`=' . SessionAccountHandler::getId());
}
return $this->NewEquipmentTypeId;
}
示例9: __construct
/**
* Construct summary table
* @param \Runalyze\Dataset\Configuration $datasetConfig
* @param int $sportid
* @param int $year
*/
public function __construct(Dataset\Configuration $datasetConfig, $sportid, $year)
{
$this->AccountID = SessionAccountHandler::getId();
$this->DatasetQuery = new Dataset\Query($datasetConfig, DB::getInstance(), $this->AccountID);
$this->DatasetTable = new Runalyze\View\Dataset\Table($datasetConfig);
$this->Sportid = $sportid;
$this->Year = $year;
}
示例10: handleRequest
/**
* Handle request
*/
private function handleRequest()
{
if (strlen(Request::param('public')) > 0) {
$Updater = new Activity\Updater(DB::getInstance());
$Updater->setAccountID(SessionAccountHandler::getId());
$Updater->update(new Activity\Object(array('id' => $this->TrainingID, Activity\Object::IS_PUBLIC => Request::param('public') == 'true' ? 1 : 0)), array(Activity\Object::IS_PUBLIC));
}
}
示例11: cacheAllClothes
/**
* Cache Clothes
*/
private static function cacheAllClothes()
{
$clothes = Cache::get(self::CACHE_KEY);
if (is_null($clothes)) {
$clothes = DB::getInstance()->query('SELECT * FROM `' . PREFIX . 'clothes` WHERE accountid = ' . SessionAccountHandler::getId())->fetchAll();
Cache::set(self::CACHE_KEY, $clothes, '3600');
}
return $clothes;
}
示例12: fetchAllPlugins
/**
* Cache all from Table plugin for a user
*/
private static function fetchAllPlugins()
{
$data = Cache::get(self::CACHE_KEY);
if ($data == NULL) {
$data = self::fetchAllPluginsFrom(DB::getInstance(), SessionAccountHandler::getId());
Cache::set(self::CACHE_KEY, $data, '3600');
}
return $data;
}
示例13: uninstall
/**
* Uninstall
* @return bool
*/
public function uninstall()
{
$Factory = new PluginFactory();
$Plugin = $Factory->newInstance($this->Key);
DB::getInstance()->deleteByID('plugin', $Plugin->id());
DB::getInstance()->query('DELETE FROM `' . PREFIX . 'plugin_conf` WHERE `pluginid`=' . $Plugin->id() . ' AND accountid = ' . SessionAccountHandler::getId());
PluginFactory::clearCache();
return true;
}
示例14: __construct
/**
* Construct importer
* @param string $fileName relative to FRONTEND_PATH
* @param int $accountID optional, session account id is used otherwise
*/
public function __construct($fileName, $accountID = false)
{
$this->Reader = new GZipReader(FRONTEND_PATH . $fileName);
$this->DB = DB::getInstance();
$this->AccountID = SessionAccountHandler::getId();
$this->Results = new RunalyzeJsonImporterResults();
if ($accountID !== false) {
$this->AccountID = $accountID;
}
}
示例15: loadAccountID
/**
* Load account ID
* @return int
*/
private static function loadAccountID()
{
if (defined('RUNALYZE_TEST')) {
return null;
}
if (\AccountHandler::$IS_ON_REGISTER_PROCESS) {
return \AccountHandler::$NEW_REGISTERED_ID;
}
return \SessionAccountHandler::getId();
}