feat: remove unused cc_sess table (#1907)
This commit is contained in:
parent
ec8c18097d
commit
4837a1885d
|
@ -1,4 +1,4 @@
|
|||
from .auth import LoginAttempt, Session, UserToken
|
||||
from .auth import LoginAttempt, UserToken
|
||||
from .country import Country
|
||||
from .preference import Preference, StreamSetting
|
||||
from .role import Role
|
||||
|
|
|
@ -15,22 +15,6 @@ class UserToken(models.Model):
|
|||
db_table = "cc_subjs_token"
|
||||
|
||||
|
||||
class Session(models.Model):
|
||||
sessid = models.CharField(primary_key=True, max_length=32)
|
||||
userid = models.ForeignKey(
|
||||
"User",
|
||||
on_delete=models.DO_NOTHING,
|
||||
blank=True,
|
||||
null=True,
|
||||
)
|
||||
login = models.CharField(max_length=255, blank=True, null=True)
|
||||
ts = models.DateTimeField(blank=True, null=True)
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = "cc_sess"
|
||||
|
||||
|
||||
class LoginAttempt(models.Model):
|
||||
ip = models.CharField(primary_key=True, max_length=32)
|
||||
attempts = models.IntegerField(blank=True, null=True)
|
||||
|
|
|
@ -6,7 +6,6 @@ from .views import (
|
|||
LoginAttemptViewSet,
|
||||
PreferenceViewSet,
|
||||
ServiceRegisterViewSet,
|
||||
SessionViewSet,
|
||||
StreamSettingViewSet,
|
||||
ThirdPartyTrackReferenceViewSet,
|
||||
UserTokenViewSet,
|
||||
|
@ -18,7 +17,6 @@ router.register("countries", CountryViewSet)
|
|||
router.register("login-attempts", LoginAttemptViewSet)
|
||||
router.register("preferences", PreferenceViewSet)
|
||||
router.register("service-registers", ServiceRegisterViewSet)
|
||||
router.register("sessions", SessionViewSet)
|
||||
router.register("stream-settings", StreamSettingViewSet)
|
||||
router.register("users", UserViewSet)
|
||||
router.register("user-tokens", UserTokenViewSet)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from .auth import LoginAttemptSerializer, SessionSerializer, UserTokenSerializer
|
||||
from .auth import LoginAttemptSerializer, UserTokenSerializer
|
||||
from .country import CountrySerializer
|
||||
from .preference import PreferenceSerializer, StreamSettingSerializer
|
||||
from .service import ServiceRegisterSerializer
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from rest_framework import serializers
|
||||
|
||||
from ..models import LoginAttempt, Session, UserToken
|
||||
from ..models import LoginAttempt, UserToken
|
||||
|
||||
|
||||
class UserTokenSerializer(serializers.HyperlinkedModelSerializer):
|
||||
|
@ -9,12 +9,6 @@ class UserTokenSerializer(serializers.HyperlinkedModelSerializer):
|
|||
fields = "__all__"
|
||||
|
||||
|
||||
class SessionSerializer(serializers.HyperlinkedModelSerializer):
|
||||
class Meta:
|
||||
model = Session
|
||||
fields = "__all__"
|
||||
|
||||
|
||||
class LoginAttemptSerializer(serializers.HyperlinkedModelSerializer):
|
||||
class Meta:
|
||||
model = LoginAttempt
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from .auth import LoginAttemptViewSet, SessionViewSet, UserTokenViewSet
|
||||
from .auth import LoginAttemptViewSet, UserTokenViewSet
|
||||
from .country import CountryViewSet
|
||||
from .preference import PreferenceViewSet, StreamSettingViewSet
|
||||
from .service import ServiceRegisterViewSet
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from rest_framework import viewsets
|
||||
|
||||
from ..models import LoginAttempt, Session, UserToken
|
||||
from ..serializers import LoginAttemptSerializer, SessionSerializer, UserTokenSerializer
|
||||
from ..models import LoginAttempt, UserToken
|
||||
from ..serializers import LoginAttemptSerializer, UserTokenSerializer
|
||||
|
||||
|
||||
class UserTokenViewSet(viewsets.ModelViewSet):
|
||||
|
@ -10,12 +10,6 @@ class UserTokenViewSet(viewsets.ModelViewSet):
|
|||
model_permission_name = "usertoken"
|
||||
|
||||
|
||||
class SessionViewSet(viewsets.ModelViewSet):
|
||||
queryset = Session.objects.all()
|
||||
serializer_class = SessionSerializer
|
||||
model_permission_name = "session"
|
||||
|
||||
|
||||
class LoginAttemptViewSet(viewsets.ModelViewSet):
|
||||
queryset = LoginAttempt.objects.all()
|
||||
serializer_class = LoginAttemptSerializer
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
# pylint: disable=invalid-name
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
from ._migrations import legacy_migration_factory
|
||||
|
||||
UP = """
|
||||
DROP TABLE IF EXISTS "cc_sess";
|
||||
"""
|
||||
|
||||
DOWN = """
|
||||
CREATE TABLE "cc_sess"
|
||||
(
|
||||
"sessid" CHAR(32) NOT NULL,
|
||||
"userid" INTEGER,
|
||||
"login" VARCHAR(255),
|
||||
"ts" TIMESTAMP,
|
||||
PRIMARY KEY ("sessid")
|
||||
);
|
||||
|
||||
CREATE INDEX "cc_sess_login_idx" ON "cc_sess" ("login");
|
||||
|
||||
CREATE INDEX "cc_sess_userid_idx" ON "cc_sess" ("userid");
|
||||
|
||||
ALTER TABLE "cc_sess" ADD CONSTRAINT "cc_sess_userid_fkey"
|
||||
FOREIGN KEY ("userid")
|
||||
REFERENCES "cc_subjs" ("id")
|
||||
ON DELETE CASCADE;
|
||||
"""
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("legacy", "0031_3_0_0_alpha_13_5"),
|
||||
]
|
||||
operations = [
|
||||
migrations.RunPython(
|
||||
code=legacy_migration_factory(
|
||||
target="3.0.0-alpha.13.6",
|
||||
sql=UP,
|
||||
)
|
||||
)
|
||||
]
|
|
@ -1 +1 @@
|
|||
LEGACY_SCHEMA_VERSION = "3.0.0-alpha.13.5"
|
||||
LEGACY_SCHEMA_VERSION = "3.0.0-alpha.13.6"
|
||||
|
|
|
@ -386,25 +386,6 @@ CREATE TABLE "cc_schedule"
|
|||
|
||||
CREATE INDEX "cc_schedule_instance_id_idx" ON "cc_schedule" ("instance_id");
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
-- cc_sess
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS "cc_sess" CASCADE;
|
||||
|
||||
CREATE TABLE "cc_sess"
|
||||
(
|
||||
"sessid" CHAR(32) NOT NULL,
|
||||
"userid" INTEGER,
|
||||
"login" VARCHAR(255),
|
||||
"ts" TIMESTAMP,
|
||||
PRIMARY KEY ("sessid")
|
||||
);
|
||||
|
||||
CREATE INDEX "cc_sess_login_idx" ON "cc_sess" ("login");
|
||||
|
||||
CREATE INDEX "cc_sess_userid_idx" ON "cc_sess" ("userid");
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
-- cc_subjs
|
||||
-----------------------------------------------------------------------
|
||||
|
@ -884,11 +865,6 @@ ALTER TABLE "cc_schedule" ADD CONSTRAINT "cc_show_stream_fkey"
|
|||
REFERENCES "cc_webstream" ("id")
|
||||
ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE "cc_sess" ADD CONSTRAINT "cc_sess_userid_fkey"
|
||||
FOREIGN KEY ("userid")
|
||||
REFERENCES "cc_subjs" ("id")
|
||||
ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE "cc_subjs_token" ADD CONSTRAINT "cc_subjs_token_userid_fkey"
|
||||
FOREIGN KEY ("user_id")
|
||||
REFERENCES "cc_subjs" ("id")
|
||||
|
|
185
api/schema.yml
185
api/schema.yml
|
@ -3249,151 +3249,6 @@ paths:
|
|||
responses:
|
||||
"204":
|
||||
description: No response body
|
||||
/api/v2/sessions/:
|
||||
get:
|
||||
operationId: sessions_list
|
||||
tags:
|
||||
- sessions
|
||||
security:
|
||||
- cookieAuth: []
|
||||
- basicAuth: []
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/Session"
|
||||
description: ""
|
||||
post:
|
||||
operationId: sessions_create
|
||||
tags:
|
||||
- sessions
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Session"
|
||||
application/x-www-form-urlencoded:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Session"
|
||||
multipart/form-data:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Session"
|
||||
security:
|
||||
- cookieAuth: []
|
||||
- basicAuth: []
|
||||
responses:
|
||||
"201":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Session"
|
||||
description: ""
|
||||
/api/v2/sessions/{sessid}/:
|
||||
get:
|
||||
operationId: sessions_retrieve
|
||||
parameters:
|
||||
- in: path
|
||||
name: sessid
|
||||
schema:
|
||||
type: string
|
||||
description: A unique value identifying this session.
|
||||
required: true
|
||||
tags:
|
||||
- sessions
|
||||
security:
|
||||
- cookieAuth: []
|
||||
- basicAuth: []
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Session"
|
||||
description: ""
|
||||
put:
|
||||
operationId: sessions_update
|
||||
parameters:
|
||||
- in: path
|
||||
name: sessid
|
||||
schema:
|
||||
type: string
|
||||
description: A unique value identifying this session.
|
||||
required: true
|
||||
tags:
|
||||
- sessions
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Session"
|
||||
application/x-www-form-urlencoded:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Session"
|
||||
multipart/form-data:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Session"
|
||||
security:
|
||||
- cookieAuth: []
|
||||
- basicAuth: []
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Session"
|
||||
description: ""
|
||||
patch:
|
||||
operationId: sessions_partial_update
|
||||
parameters:
|
||||
- in: path
|
||||
name: sessid
|
||||
schema:
|
||||
type: string
|
||||
description: A unique value identifying this session.
|
||||
required: true
|
||||
tags:
|
||||
- sessions
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/PatchedSession"
|
||||
application/x-www-form-urlencoded:
|
||||
schema:
|
||||
$ref: "#/components/schemas/PatchedSession"
|
||||
multipart/form-data:
|
||||
schema:
|
||||
$ref: "#/components/schemas/PatchedSession"
|
||||
security:
|
||||
- cookieAuth: []
|
||||
- basicAuth: []
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Session"
|
||||
description: ""
|
||||
delete:
|
||||
operationId: sessions_destroy
|
||||
parameters:
|
||||
- in: path
|
||||
name: sessid
|
||||
schema:
|
||||
type: string
|
||||
description: A unique value identifying this session.
|
||||
required: true
|
||||
tags:
|
||||
- sessions
|
||||
security:
|
||||
- cookieAuth: []
|
||||
- basicAuth: []
|
||||
responses:
|
||||
"204":
|
||||
description: No response body
|
||||
/api/v2/show-days/:
|
||||
get:
|
||||
operationId: show_days_list
|
||||
|
@ -7078,25 +6933,6 @@ components:
|
|||
ip:
|
||||
type: string
|
||||
maxLength: 45
|
||||
PatchedSession:
|
||||
type: object
|
||||
properties:
|
||||
item_url:
|
||||
type: string
|
||||
format: uri
|
||||
readOnly: true
|
||||
login:
|
||||
type: string
|
||||
nullable: true
|
||||
maxLength: 255
|
||||
ts:
|
||||
type: string
|
||||
format: date-time
|
||||
nullable: true
|
||||
userid:
|
||||
type: string
|
||||
format: uri
|
||||
nullable: true
|
||||
PatchedShow:
|
||||
type: object
|
||||
properties:
|
||||
|
@ -7992,27 +7828,6 @@ components:
|
|||
required:
|
||||
- ip
|
||||
- item_url
|
||||
Session:
|
||||
type: object
|
||||
properties:
|
||||
item_url:
|
||||
type: string
|
||||
format: uri
|
||||
readOnly: true
|
||||
login:
|
||||
type: string
|
||||
nullable: true
|
||||
maxLength: 255
|
||||
ts:
|
||||
type: string
|
||||
format: date-time
|
||||
nullable: true
|
||||
userid:
|
||||
type: string
|
||||
format: uri
|
||||
nullable: true
|
||||
required:
|
||||
- item_url
|
||||
Show:
|
||||
type: object
|
||||
properties:
|
||||
|
|
|
@ -59,9 +59,6 @@ return [
|
|||
'BaseCcServiceRegister' => 'airtime/om/BaseCcServiceRegister.php',
|
||||
'BaseCcServiceRegisterPeer' => 'airtime/om/BaseCcServiceRegisterPeer.php',
|
||||
'BaseCcServiceRegisterQuery' => 'airtime/om/BaseCcServiceRegisterQuery.php',
|
||||
'BaseCcSess' => 'airtime/om/BaseCcSess.php',
|
||||
'BaseCcSessPeer' => 'airtime/om/BaseCcSessPeer.php',
|
||||
'BaseCcSessQuery' => 'airtime/om/BaseCcSessQuery.php',
|
||||
'BaseCcShow' => 'airtime/om/BaseCcShow.php',
|
||||
'BaseCcShowDays' => 'airtime/om/BaseCcShowDays.php',
|
||||
'BaseCcShowDaysPeer' => 'airtime/om/BaseCcShowDaysPeer.php',
|
||||
|
@ -195,10 +192,6 @@ return [
|
|||
'CcServiceRegisterPeer' => 'airtime/CcServiceRegisterPeer.php',
|
||||
'CcServiceRegisterQuery' => 'airtime/CcServiceRegisterQuery.php',
|
||||
'CcServiceRegisterTableMap' => 'airtime/map/CcServiceRegisterTableMap.php',
|
||||
'CcSess' => 'airtime/CcSess.php',
|
||||
'CcSessPeer' => 'airtime/CcSessPeer.php',
|
||||
'CcSessQuery' => 'airtime/CcSessQuery.php',
|
||||
'CcSessTableMap' => 'airtime/map/CcSessTableMap.php',
|
||||
'CcShow' => 'airtime/CcShow.php',
|
||||
'CcShowDays' => 'airtime/CcShowDays.php',
|
||||
'CcShowDaysPeer' => 'airtime/CcShowDaysPeer.php',
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'cc_sess' table.
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*/
|
||||
class CcSess extends BaseCcSess
|
||||
{
|
||||
} // CcSess
|
|
@ -1,12 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'cc_sess' table.
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*/
|
||||
class CcSessPeer extends BaseCcSessPeer
|
||||
{
|
||||
} // CcSessPeer
|
|
@ -1,12 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'cc_sess' table.
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*/
|
||||
class CcSessQuery extends BaseCcSessQuery
|
||||
{
|
||||
} // CcSessQuery
|
|
@ -1,56 +0,0 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'cc_sess' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
* @package propel.generator.airtime.map
|
||||
*/
|
||||
class CcSessTableMap extends TableMap
|
||||
{
|
||||
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'airtime.map.CcSessTableMap';
|
||||
|
||||
/**
|
||||
* Initialize the table attributes, columns and validators
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('cc_sess');
|
||||
$this->setPhpName('CcSess');
|
||||
$this->setClassname('CcSess');
|
||||
$this->setPackage('airtime');
|
||||
$this->setUseIdGenerator(false);
|
||||
// columns
|
||||
$this->addPrimaryKey('sessid', 'Sessid', 'CHAR', true, 32, null);
|
||||
$this->addForeignKey('userid', 'Userid', 'INTEGER', 'cc_subjs', 'id', false, null, null);
|
||||
$this->addColumn('login', 'Login', 'VARCHAR', false, 255, null);
|
||||
$this->addColumn('ts', 'Ts', 'TIMESTAMP', false, null, null);
|
||||
// validators
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('userid' => 'id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
} // CcSessTableMap
|
|
@ -67,7 +67,6 @@ class CcSubjsTableMap extends TableMap
|
|||
$this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::ONE_TO_MANY, array('id' => 'creator_id', ), 'CASCADE', null, 'CcPlaylists');
|
||||
$this->addRelation('CcBlock', 'CcBlock', RelationMap::ONE_TO_MANY, array('id' => 'creator_id', ), 'CASCADE', null, 'CcBlocks');
|
||||
$this->addRelation('CcPref', 'CcPref', RelationMap::ONE_TO_MANY, array('id' => 'subjid', ), 'CASCADE', null, 'CcPrefs');
|
||||
$this->addRelation('CcSess', 'CcSess', RelationMap::ONE_TO_MANY, array('id' => 'userid', ), 'CASCADE', null, 'CcSesss');
|
||||
$this->addRelation('CcSubjsToken', 'CcSubjsToken', RelationMap::ONE_TO_MANY, array('id' => 'user_id', ), 'CASCADE', null, 'CcSubjsTokens');
|
||||
$this->addRelation('Podcast', 'Podcast', RelationMap::ONE_TO_MANY, array('id' => 'owner', ), 'CASCADE', null, 'Podcasts');
|
||||
} // buildRelations()
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,471 +0,0 @@
|
|||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'cc_sess' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method CcSessQuery orderBySessid($order = Criteria::ASC) Order by the sessid column
|
||||
* @method CcSessQuery orderByUserid($order = Criteria::ASC) Order by the userid column
|
||||
* @method CcSessQuery orderByLogin($order = Criteria::ASC) Order by the login column
|
||||
* @method CcSessQuery orderByTs($order = Criteria::ASC) Order by the ts column
|
||||
*
|
||||
* @method CcSessQuery groupBySessid() Group by the sessid column
|
||||
* @method CcSessQuery groupByUserid() Group by the userid column
|
||||
* @method CcSessQuery groupByLogin() Group by the login column
|
||||
* @method CcSessQuery groupByTs() Group by the ts column
|
||||
*
|
||||
* @method CcSessQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method CcSessQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method CcSessQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method CcSessQuery leftJoinCcSubjs($relationAlias = null) Adds a LEFT JOIN clause to the query using the CcSubjs relation
|
||||
* @method CcSessQuery rightJoinCcSubjs($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcSubjs relation
|
||||
* @method CcSessQuery innerJoinCcSubjs($relationAlias = null) Adds a INNER JOIN clause to the query using the CcSubjs relation
|
||||
*
|
||||
* @method CcSess findOne(PropelPDO $con = null) Return the first CcSess matching the query
|
||||
* @method CcSess findOneOrCreate(PropelPDO $con = null) Return the first CcSess matching the query, or a new CcSess object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method CcSess findOneByUserid(int $userid) Return the first CcSess filtered by the userid column
|
||||
* @method CcSess findOneByLogin(string $login) Return the first CcSess filtered by the login column
|
||||
* @method CcSess findOneByTs(string $ts) Return the first CcSess filtered by the ts column
|
||||
*
|
||||
* @method array findBySessid(string $sessid) Return CcSess objects filtered by the sessid column
|
||||
* @method array findByUserid(int $userid) Return CcSess objects filtered by the userid column
|
||||
* @method array findByLogin(string $login) Return CcSess objects filtered by the login column
|
||||
* @method array findByTs(string $ts) Return CcSess objects filtered by the ts column
|
||||
*
|
||||
* @package propel.generator.airtime.om
|
||||
*/
|
||||
abstract class BaseCcSessQuery extends ModelCriteria
|
||||
{
|
||||
/**
|
||||
* Initializes internal state of BaseCcSessQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = null, $modelName = null, $modelAlias = null)
|
||||
{
|
||||
if (null === $dbName) {
|
||||
$dbName = 'airtime';
|
||||
}
|
||||
if (null === $modelName) {
|
||||
$modelName = 'CcSess';
|
||||
}
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new CcSessQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param CcSessQuery|Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return CcSessQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof CcSessQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new CcSessQuery(null, null, $modelAlias);
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$query->mergeWith($criteria);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
* Propel uses the instance pool to skip the database if the object exists.
|
||||
* Go fast if the query is untouched.
|
||||
*
|
||||
* <code>
|
||||
* $obj = $c->findPk(12, $con);
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
*
|
||||
* @return CcSess|CcSess[]|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = CcSessPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|
||||
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|
||||
|| $this->map || $this->having || $this->joins) {
|
||||
return $this->findPkComplex($key, $con);
|
||||
} else {
|
||||
return $this->findPkSimple($key, $con);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias of findPk to use instance pooling
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
*
|
||||
* @return CcSess A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function findOneBySessid($key, $con = null)
|
||||
{
|
||||
return $this->findPk($key, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key using raw SQL to go fast.
|
||||
* Bypass doSelect() and the object formatter by using generated code.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
*
|
||||
* @return CcSess A model object, or null if the key is not found
|
||||
* @throws PropelException
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT "sessid", "userid", "login", "ts" FROM "cc_sess" WHERE "sessid" = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_STR);
|
||||
$stmt->execute();
|
||||
} catch (Exception $e) {
|
||||
Propel::log($e->getMessage(), Propel::LOG_ERR);
|
||||
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
|
||||
}
|
||||
$obj = null;
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$obj = new CcSess();
|
||||
$obj->hydrate($row);
|
||||
CcSessPeer::addInstanceToPool($obj, (string) $key);
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key.
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con A connection object
|
||||
*
|
||||
* @return CcSess|CcSess[]|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
protected function findPkComplex($key, $con)
|
||||
{
|
||||
// As the query uses a PK condition, no limit(1) is necessary.
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$stmt = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find objects by primary key
|
||||
* <code>
|
||||
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
*
|
||||
* @return PropelObjectCollection|CcSess[]|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
|
||||
}
|
||||
$this->basePreSelect($con);
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$stmt = $criteria
|
||||
->filterByPrimaryKeys($keys)
|
||||
->doSelect($con);
|
||||
|
||||
return $criteria->getFormatter()->init($criteria)->format($stmt);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by primary key
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return CcSessQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(CcSessPeer::SESSID, $key, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a list of primary keys
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return CcSessQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(CcSessPeer::SESSID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the sessid column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterBySessid('fooValue'); // WHERE sessid = 'fooValue'
|
||||
* $query->filterBySessid('%fooValue%'); // WHERE sessid LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $sessid The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcSessQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterBySessid($sessid = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($sessid)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $sessid)) {
|
||||
$sessid = str_replace('*', '%', $sessid);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CcSessPeer::SESSID, $sessid, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the userid column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByUserid(1234); // WHERE userid = 1234
|
||||
* $query->filterByUserid(array(12, 34)); // WHERE userid IN (12, 34)
|
||||
* $query->filterByUserid(array('min' => 12)); // WHERE userid >= 12
|
||||
* $query->filterByUserid(array('max' => 12)); // WHERE userid <= 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByCcSubjs()
|
||||
*
|
||||
* @param mixed $userid The value to use as filter.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcSessQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByUserid($userid = null, $comparison = null)
|
||||
{
|
||||
if (is_array($userid)) {
|
||||
$useMinMax = false;
|
||||
if (isset($userid['min'])) {
|
||||
$this->addUsingAlias(CcSessPeer::USERID, $userid['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($userid['max'])) {
|
||||
$this->addUsingAlias(CcSessPeer::USERID, $userid['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CcSessPeer::USERID, $userid, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the login column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByLogin('fooValue'); // WHERE login = 'fooValue'
|
||||
* $query->filterByLogin('%fooValue%'); // WHERE login LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $login The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcSessQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByLogin($login = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($login)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $login)) {
|
||||
$login = str_replace('*', '%', $login);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CcSessPeer::LOGIN, $login, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the ts column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByTs('2011-03-14'); // WHERE ts = '2011-03-14'
|
||||
* $query->filterByTs('now'); // WHERE ts = '2011-03-14'
|
||||
* $query->filterByTs(array('max' => 'yesterday')); // WHERE ts < '2011-03-13'
|
||||
* </code>
|
||||
*
|
||||
* @param mixed $ts The value to use as filter.
|
||||
* Values can be integers (unix timestamps), DateTime objects, or strings.
|
||||
* Empty strings are treated as NULL.
|
||||
* Use scalar values for equality.
|
||||
* Use array values for in_array() equivalent.
|
||||
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcSessQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByTs($ts = null, $comparison = null)
|
||||
{
|
||||
if (is_array($ts)) {
|
||||
$useMinMax = false;
|
||||
if (isset($ts['min'])) {
|
||||
$this->addUsingAlias(CcSessPeer::TS, $ts['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($ts['max'])) {
|
||||
$this->addUsingAlias(CcSessPeer::TS, $ts['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(CcSessPeer::TS, $ts, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related CcSubjs object
|
||||
*
|
||||
* @param CcSubjs|PropelObjectCollection $ccSubjs The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcSessQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
*/
|
||||
public function filterByCcSubjs($ccSubjs, $comparison = null)
|
||||
{
|
||||
if ($ccSubjs instanceof CcSubjs) {
|
||||
return $this
|
||||
->addUsingAlias(CcSessPeer::USERID, $ccSubjs->getDbId(), $comparison);
|
||||
} elseif ($ccSubjs instanceof PropelObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(CcSessPeer::USERID, $ccSubjs->toKeyValue('PrimaryKey', 'DbId'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByCcSubjs() only accepts arguments of type CcSubjs or PropelCollection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CcSubjs relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return CcSessQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCcSubjs($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CcSubjs');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'CcSubjs');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CcSubjs relation CcSubjs object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return CcSubjsQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCcSubjsQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCcSubjs($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param CcSess $ccSess Object to remove from the list of results
|
||||
*
|
||||
* @return CcSessQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($ccSess = null)
|
||||
{
|
||||
if ($ccSess) {
|
||||
$this->addUsingAlias(CcSessPeer::SESSID, $ccSess->getSessid(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
|
@ -155,12 +155,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
protected $collCcPrefs;
|
||||
protected $collCcPrefsPartial;
|
||||
|
||||
/**
|
||||
* @var PropelObjectCollection|CcSess[] Collection to store aggregation of CcSess objects.
|
||||
*/
|
||||
protected $collCcSesss;
|
||||
protected $collCcSesssPartial;
|
||||
|
||||
/**
|
||||
* @var PropelObjectCollection|CcSubjsToken[] Collection to store aggregation of CcSubjsToken objects.
|
||||
*/
|
||||
|
@ -235,12 +229,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
*/
|
||||
protected $ccPrefsScheduledForDeletion = null;
|
||||
|
||||
/**
|
||||
* An array of objects scheduled for deletion.
|
||||
* @var PropelObjectCollection
|
||||
*/
|
||||
protected $ccSesssScheduledForDeletion = null;
|
||||
|
||||
/**
|
||||
* An array of objects scheduled for deletion.
|
||||
* @var PropelObjectCollection
|
||||
|
@ -901,8 +889,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
|
||||
$this->collCcPrefs = null;
|
||||
|
||||
$this->collCcSesss = null;
|
||||
|
||||
$this->collCcSubjsTokens = null;
|
||||
|
||||
$this->collPodcasts = null;
|
||||
|
@ -1152,23 +1138,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
}
|
||||
}
|
||||
|
||||
if ($this->ccSesssScheduledForDeletion !== null) {
|
||||
if (!$this->ccSesssScheduledForDeletion->isEmpty()) {
|
||||
CcSessQuery::create()
|
||||
->filterByPrimaryKeys($this->ccSesssScheduledForDeletion->getPrimaryKeys(false))
|
||||
->delete($con);
|
||||
$this->ccSesssScheduledForDeletion = null;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->collCcSesss !== null) {
|
||||
foreach ($this->collCcSesss as $referrerFK) {
|
||||
if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
|
||||
$affectedRows += $referrerFK->save($con);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->ccSubjsTokensScheduledForDeletion !== null) {
|
||||
if (!$this->ccSubjsTokensScheduledForDeletion->isEmpty()) {
|
||||
CcSubjsTokenQuery::create()
|
||||
|
@ -1476,14 +1445,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
}
|
||||
}
|
||||
|
||||
if ($this->collCcSesss !== null) {
|
||||
foreach ($this->collCcSesss as $referrerFK) {
|
||||
if (!$referrerFK->validate($columns)) {
|
||||
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->collCcSubjsTokens !== null) {
|
||||
foreach ($this->collCcSubjsTokens as $referrerFK) {
|
||||
if (!$referrerFK->validate($columns)) {
|
||||
|
@ -1644,9 +1605,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
if (null !== $this->collCcPrefs) {
|
||||
$result['CcPrefs'] = $this->collCcPrefs->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
|
||||
}
|
||||
if (null !== $this->collCcSesss) {
|
||||
$result['CcSesss'] = $this->collCcSesss->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
|
||||
}
|
||||
if (null !== $this->collCcSubjsTokens) {
|
||||
$result['CcSubjsTokens'] = $this->collCcSubjsTokens->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
|
||||
}
|
||||
|
@ -1912,12 +1870,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
}
|
||||
}
|
||||
|
||||
foreach ($this->getCcSesss() as $relObj) {
|
||||
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
|
||||
$copyObj->addCcSess($relObj->copy($deepCopy));
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->getCcSubjsTokens() as $relObj) {
|
||||
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
|
||||
$copyObj->addCcSubjsToken($relObj->copy($deepCopy));
|
||||
|
@ -2012,9 +1964,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
if ('CcPref' == $relationName) {
|
||||
$this->initCcPrefs();
|
||||
}
|
||||
if ('CcSess' == $relationName) {
|
||||
$this->initCcSesss();
|
||||
}
|
||||
if ('CcSubjsToken' == $relationName) {
|
||||
$this->initCcSubjsTokens();
|
||||
}
|
||||
|
@ -3623,231 +3572,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears out the collCcSesss collection
|
||||
*
|
||||
* This does not modify the database; however, it will remove any associated objects, causing
|
||||
* them to be refetched by subsequent calls to accessor method.
|
||||
*
|
||||
* @return CcSubjs The current object (for fluent API support)
|
||||
* @see addCcSesss()
|
||||
*/
|
||||
public function clearCcSesss()
|
||||
{
|
||||
$this->collCcSesss = null; // important to set this to null since that means it is uninitialized
|
||||
$this->collCcSesssPartial = null;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* reset is the collCcSesss collection loaded partially
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function resetPartialCcSesss($v = true)
|
||||
{
|
||||
$this->collCcSesssPartial = $v;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the collCcSesss collection.
|
||||
*
|
||||
* By default this just sets the collCcSesss collection to an empty array (like clearcollCcSesss());
|
||||
* however, you may wish to override this method in your stub class to provide setting appropriate
|
||||
* to your application -- for example, setting the initial array to the values stored in database.
|
||||
*
|
||||
* @param boolean $overrideExisting If set to true, the method call initializes
|
||||
* the collection even if it is not empty
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initCcSesss($overrideExisting = true)
|
||||
{
|
||||
if (null !== $this->collCcSesss && !$overrideExisting) {
|
||||
return;
|
||||
}
|
||||
$this->collCcSesss = new PropelObjectCollection();
|
||||
$this->collCcSesss->setModel('CcSess');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an array of CcSess objects which contain a foreign key that references this object.
|
||||
*
|
||||
* If the $criteria is not null, it is used to always fetch the results from the database.
|
||||
* Otherwise the results are fetched from the database the first time, then cached.
|
||||
* Next time the same method is called without $criteria, the cached collection is returned.
|
||||
* If this CcSubjs is new, it will return
|
||||
* an empty collection or the current collection; the criteria is ignored on a new object.
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param PropelPDO $con optional connection object
|
||||
* @return PropelObjectCollection|CcSess[] List of CcSess objects
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getCcSesss($criteria = null, PropelPDO $con = null)
|
||||
{
|
||||
$partial = $this->collCcSesssPartial && !$this->isNew();
|
||||
if (null === $this->collCcSesss || null !== $criteria || $partial) {
|
||||
if ($this->isNew() && null === $this->collCcSesss) {
|
||||
// return empty collection
|
||||
$this->initCcSesss();
|
||||
} else {
|
||||
$collCcSesss = CcSessQuery::create(null, $criteria)
|
||||
->filterByCcSubjs($this)
|
||||
->find($con);
|
||||
if (null !== $criteria) {
|
||||
if (false !== $this->collCcSesssPartial && count($collCcSesss)) {
|
||||
$this->initCcSesss(false);
|
||||
|
||||
foreach ($collCcSesss as $obj) {
|
||||
if (false == $this->collCcSesss->contains($obj)) {
|
||||
$this->collCcSesss->append($obj);
|
||||
}
|
||||
}
|
||||
|
||||
$this->collCcSesssPartial = true;
|
||||
}
|
||||
|
||||
$collCcSesss->getInternalIterator()->rewind();
|
||||
|
||||
return $collCcSesss;
|
||||
}
|
||||
|
||||
if ($partial && $this->collCcSesss) {
|
||||
foreach ($this->collCcSesss as $obj) {
|
||||
if ($obj->isNew()) {
|
||||
$collCcSesss[] = $obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->collCcSesss = $collCcSesss;
|
||||
$this->collCcSesssPartial = false;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->collCcSesss;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a collection of CcSess objects related by a one-to-many relationship
|
||||
* to the current object.
|
||||
* It will also schedule objects for deletion based on a diff between old objects (aka persisted)
|
||||
* and new objects from the given Propel collection.
|
||||
*
|
||||
* @param PropelCollection $ccSesss A Propel collection.
|
||||
* @param PropelPDO $con Optional connection object
|
||||
* @return CcSubjs The current object (for fluent API support)
|
||||
*/
|
||||
public function setCcSesss(PropelCollection $ccSesss, PropelPDO $con = null)
|
||||
{
|
||||
$ccSesssToDelete = $this->getCcSesss(new Criteria(), $con)->diff($ccSesss);
|
||||
|
||||
|
||||
$this->ccSesssScheduledForDeletion = $ccSesssToDelete;
|
||||
|
||||
foreach ($ccSesssToDelete as $ccSessRemoved) {
|
||||
$ccSessRemoved->setCcSubjs(null);
|
||||
}
|
||||
|
||||
$this->collCcSesss = null;
|
||||
foreach ($ccSesss as $ccSess) {
|
||||
$this->addCcSess($ccSess);
|
||||
}
|
||||
|
||||
$this->collCcSesss = $ccSesss;
|
||||
$this->collCcSesssPartial = false;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of related CcSess objects.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct
|
||||
* @param PropelPDO $con
|
||||
* @return int Count of related CcSess objects.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function countCcSesss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
|
||||
{
|
||||
$partial = $this->collCcSesssPartial && !$this->isNew();
|
||||
if (null === $this->collCcSesss || null !== $criteria || $partial) {
|
||||
if ($this->isNew() && null === $this->collCcSesss) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ($partial && !$criteria) {
|
||||
return count($this->getCcSesss());
|
||||
}
|
||||
$query = CcSessQuery::create(null, $criteria);
|
||||
if ($distinct) {
|
||||
$query->distinct();
|
||||
}
|
||||
|
||||
return $query
|
||||
->filterByCcSubjs($this)
|
||||
->count($con);
|
||||
}
|
||||
|
||||
return count($this->collCcSesss);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called to associate a CcSess object to this object
|
||||
* through the CcSess foreign key attribute.
|
||||
*
|
||||
* @param CcSess $l CcSess
|
||||
* @return CcSubjs The current object (for fluent API support)
|
||||
*/
|
||||
public function addCcSess(CcSess $l)
|
||||
{
|
||||
if ($this->collCcSesss === null) {
|
||||
$this->initCcSesss();
|
||||
$this->collCcSesssPartial = true;
|
||||
}
|
||||
|
||||
if (!in_array($l, $this->collCcSesss->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
|
||||
$this->doAddCcSess($l);
|
||||
|
||||
if ($this->ccSesssScheduledForDeletion and $this->ccSesssScheduledForDeletion->contains($l)) {
|
||||
$this->ccSesssScheduledForDeletion->remove($this->ccSesssScheduledForDeletion->search($l));
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param CcSess $ccSess The ccSess object to add.
|
||||
*/
|
||||
protected function doAddCcSess($ccSess)
|
||||
{
|
||||
$this->collCcSesss[]= $ccSess;
|
||||
$ccSess->setCcSubjs($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param CcSess $ccSess The ccSess object to remove.
|
||||
* @return CcSubjs The current object (for fluent API support)
|
||||
*/
|
||||
public function removeCcSess($ccSess)
|
||||
{
|
||||
if ($this->getCcSesss()->contains($ccSess)) {
|
||||
$this->collCcSesss->remove($this->collCcSesss->search($ccSess));
|
||||
if (null === $this->ccSesssScheduledForDeletion) {
|
||||
$this->ccSesssScheduledForDeletion = clone $this->collCcSesss;
|
||||
$this->ccSesssScheduledForDeletion->clear();
|
||||
}
|
||||
$this->ccSesssScheduledForDeletion[]= $ccSess;
|
||||
$ccSess->setCcSubjs(null);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears out the collCcSubjsTokens collection
|
||||
*
|
||||
|
@ -4374,11 +4098,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
$o->clearAllReferences($deep);
|
||||
}
|
||||
}
|
||||
if ($this->collCcSesss) {
|
||||
foreach ($this->collCcSesss as $o) {
|
||||
$o->clearAllReferences($deep);
|
||||
}
|
||||
}
|
||||
if ($this->collCcSubjsTokens) {
|
||||
foreach ($this->collCcSubjsTokens as $o) {
|
||||
$o->clearAllReferences($deep);
|
||||
|
@ -4421,10 +4140,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
$this->collCcPrefs->clearIterator();
|
||||
}
|
||||
$this->collCcPrefs = null;
|
||||
if ($this->collCcSesss instanceof PropelCollection) {
|
||||
$this->collCcSesss->clearIterator();
|
||||
}
|
||||
$this->collCcSesss = null;
|
||||
if ($this->collCcSubjsTokens instanceof PropelCollection) {
|
||||
$this->collCcSubjsTokens->clearIterator();
|
||||
}
|
||||
|
|
|
@ -430,9 +430,6 @@ abstract class BaseCcSubjsPeer
|
|||
// Invalidate objects in CcPrefPeer instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
CcPrefPeer::clearInstancePool();
|
||||
// Invalidate objects in CcSessPeer instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
CcSessPeer::clearInstancePool();
|
||||
// Invalidate objects in CcSubjsTokenPeer instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
CcSubjsTokenPeer::clearInstancePool();
|
||||
|
|
|
@ -66,10 +66,6 @@
|
|||
* @method CcSubjsQuery rightJoinCcPref($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcPref relation
|
||||
* @method CcSubjsQuery innerJoinCcPref($relationAlias = null) Adds a INNER JOIN clause to the query using the CcPref relation
|
||||
*
|
||||
* @method CcSubjsQuery leftJoinCcSess($relationAlias = null) Adds a LEFT JOIN clause to the query using the CcSess relation
|
||||
* @method CcSubjsQuery rightJoinCcSess($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcSess relation
|
||||
* @method CcSubjsQuery innerJoinCcSess($relationAlias = null) Adds a INNER JOIN clause to the query using the CcSess relation
|
||||
*
|
||||
* @method CcSubjsQuery leftJoinCcSubjsToken($relationAlias = null) Adds a LEFT JOIN clause to the query using the CcSubjsToken relation
|
||||
* @method CcSubjsQuery rightJoinCcSubjsToken($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcSubjsToken relation
|
||||
* @method CcSubjsQuery innerJoinCcSubjsToken($relationAlias = null) Adds a INNER JOIN clause to the query using the CcSubjsToken relation
|
||||
|
@ -1252,80 +1248,6 @@ abstract class BaseCcSubjsQuery extends ModelCriteria
|
|||
->useQuery($relationAlias ? $relationAlias : 'CcPref', 'CcPrefQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related CcSess object
|
||||
*
|
||||
* @param CcSess|PropelObjectCollection $ccSess the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcSubjsQuery The current query, for fluid interface
|
||||
* @throws PropelException - if the provided filter is invalid.
|
||||
*/
|
||||
public function filterByCcSess($ccSess, $comparison = null)
|
||||
{
|
||||
if ($ccSess instanceof CcSess) {
|
||||
return $this
|
||||
->addUsingAlias(CcSubjsPeer::ID, $ccSess->getUserid(), $comparison);
|
||||
} elseif ($ccSess instanceof PropelObjectCollection) {
|
||||
return $this
|
||||
->useCcSessQuery()
|
||||
->filterByPrimaryKeys($ccSess->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByCcSess() only accepts arguments of type CcSess or PropelCollection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CcSess relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return CcSubjsQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCcSess($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CcSess');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if ($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'CcSess');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CcSess relation CcSess object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return CcSessQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCcSessQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCcSess($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CcSess', 'CcSessQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related CcSubjsToken object
|
||||
*
|
||||
|
|
|
@ -373,21 +373,6 @@
|
|||
<index-column name="instance_id" />
|
||||
</index>
|
||||
</table>
|
||||
<table name="cc_sess" phpName="CcSess">
|
||||
<column name="sessid" phpName="Sessid" type="CHAR" size="32" primaryKey="true" required="true" />
|
||||
<column name="userid" phpName="Userid" type="INTEGER" required="false" />
|
||||
<column name="login" phpName="Login" type="VARCHAR" size="255" required="false" />
|
||||
<column name="ts" phpName="Ts" type="TIMESTAMP" required="false" />
|
||||
<foreign-key foreignTable="cc_subjs" name="cc_sess_userid_fkey" onDelete="CASCADE">
|
||||
<reference local="userid" foreign="id" />
|
||||
</foreign-key>
|
||||
<index name="cc_sess_login_idx">
|
||||
<index-column name="login" />
|
||||
</index>
|
||||
<index name="cc_sess_userid_idx">
|
||||
<index-column name="userid" />
|
||||
</index>
|
||||
</table>
|
||||
<table name="cc_subjs" phpName="CcSubjs">
|
||||
<column name="id" phpName="DbId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true" />
|
||||
<column name="login" phpName="DbLogin" type="VARCHAR" size="255" required="true" defaultValue="" />
|
||||
|
|
Loading…
Reference in New Issue