BaseCcSubjs.php 82 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785
  1. <?php
  2. /**
  3. * Base class that represents a row from the 'cc_subjs' table.
  4. *
  5. *
  6. *
  7. * @package propel.generator.airtime.om
  8. */
  9. abstract class BaseCcSubjs extends BaseObject implements Persistent
  10. {
  11. /**
  12. * Peer class name
  13. */
  14. const PEER = 'CcSubjsPeer';
  15. /**
  16. * The Peer class.
  17. * Instance provides a convenient way of calling static methods on a class
  18. * that calling code may not be able to identify.
  19. * @var CcSubjsPeer
  20. */
  21. protected static $peer;
  22. /**
  23. * The value for the id field.
  24. * @var int
  25. */
  26. protected $id;
  27. /**
  28. * The value for the login field.
  29. * Note: this column has a database default value of: ''
  30. * @var string
  31. */
  32. protected $login;
  33. /**
  34. * The value for the pass field.
  35. * Note: this column has a database default value of: ''
  36. * @var string
  37. */
  38. protected $pass;
  39. /**
  40. * The value for the type field.
  41. * Note: this column has a database default value of: 'U'
  42. * @var string
  43. */
  44. protected $type;
  45. /**
  46. * The value for the first_name field.
  47. * Note: this column has a database default value of: ''
  48. * @var string
  49. */
  50. protected $first_name;
  51. /**
  52. * The value for the last_name field.
  53. * Note: this column has a database default value of: ''
  54. * @var string
  55. */
  56. protected $last_name;
  57. /**
  58. * The value for the lastlogin field.
  59. * @var string
  60. */
  61. protected $lastlogin;
  62. /**
  63. * The value for the lastfail field.
  64. * @var string
  65. */
  66. protected $lastfail;
  67. /**
  68. * The value for the skype_contact field.
  69. * @var string
  70. */
  71. protected $skype_contact;
  72. /**
  73. * The value for the jabber_contact field.
  74. * @var string
  75. */
  76. protected $jabber_contact;
  77. /**
  78. * The value for the email field.
  79. * @var string
  80. */
  81. protected $email;
  82. /**
  83. * The value for the cell_phone field.
  84. * @var string
  85. */
  86. protected $cell_phone;
  87. /**
  88. * The value for the login_attempts field.
  89. * Note: this column has a database default value of: 0
  90. * @var int
  91. */
  92. protected $login_attempts;
  93. /**
  94. * @var array CcFiles[] Collection to store aggregation of CcFiles objects.
  95. */
  96. protected $collCcFilessRelatedByDbOwnerId;
  97. /**
  98. * @var array CcFiles[] Collection to store aggregation of CcFiles objects.
  99. */
  100. protected $collCcFilessRelatedByDbEditedby;
  101. /**
  102. * @var array CcPerms[] Collection to store aggregation of CcPerms objects.
  103. */
  104. protected $collCcPermss;
  105. /**
  106. * @var array CcShowHosts[] Collection to store aggregation of CcShowHosts objects.
  107. */
  108. protected $collCcShowHostss;
  109. /**
  110. * @var array CcPlaylist[] Collection to store aggregation of CcPlaylist objects.
  111. */
  112. protected $collCcPlaylists;
  113. /**
  114. * @var array CcBlock[] Collection to store aggregation of CcBlock objects.
  115. */
  116. protected $collCcBlocks;
  117. /**
  118. * @var array CcPref[] Collection to store aggregation of CcPref objects.
  119. */
  120. protected $collCcPrefs;
  121. /**
  122. * @var array CcSess[] Collection to store aggregation of CcSess objects.
  123. */
  124. protected $collCcSesss;
  125. /**
  126. * @var array CcSubjsToken[] Collection to store aggregation of CcSubjsToken objects.
  127. */
  128. protected $collCcSubjsTokens;
  129. /**
  130. * Flag to prevent endless save loop, if this object is referenced
  131. * by another object which falls in this transaction.
  132. * @var boolean
  133. */
  134. protected $alreadyInSave = false;
  135. /**
  136. * Flag to prevent endless validation loop, if this object is referenced
  137. * by another object which falls in this transaction.
  138. * @var boolean
  139. */
  140. protected $alreadyInValidation = false;
  141. /**
  142. * Applies default values to this object.
  143. * This method should be called from the object's constructor (or
  144. * equivalent initialization method).
  145. * @see __construct()
  146. */
  147. public function applyDefaultValues()
  148. {
  149. $this->login = '';
  150. $this->pass = '';
  151. $this->type = 'U';
  152. $this->first_name = '';
  153. $this->last_name = '';
  154. $this->login_attempts = 0;
  155. }
  156. /**
  157. * Initializes internal state of BaseCcSubjs object.
  158. * @see applyDefaults()
  159. */
  160. public function __construct()
  161. {
  162. parent::__construct();
  163. $this->applyDefaultValues();
  164. }
  165. /**
  166. * Get the [id] column value.
  167. *
  168. * @return int
  169. */
  170. public function getDbId()
  171. {
  172. return $this->id;
  173. }
  174. /**
  175. * Get the [login] column value.
  176. *
  177. * @return string
  178. */
  179. public function getDbLogin()
  180. {
  181. return $this->login;
  182. }
  183. /**
  184. * Get the [pass] column value.
  185. *
  186. * @return string
  187. */
  188. public function getDbPass()
  189. {
  190. return $this->pass;
  191. }
  192. /**
  193. * Get the [type] column value.
  194. *
  195. * @return string
  196. */
  197. public function getDbType()
  198. {
  199. return $this->type;
  200. }
  201. /**
  202. * Get the [first_name] column value.
  203. *
  204. * @return string
  205. */
  206. public function getDbFirstName()
  207. {
  208. return $this->first_name;
  209. }
  210. /**
  211. * Get the [last_name] column value.
  212. *
  213. * @return string
  214. */
  215. public function getDbLastName()
  216. {
  217. return $this->last_name;
  218. }
  219. /**
  220. * Get the [optionally formatted] temporal [lastlogin] column value.
  221. *
  222. *
  223. * @param string $format The date/time format string (either date()-style or strftime()-style).
  224. * If format is NULL, then the raw DateTime object will be returned.
  225. * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
  226. * @throws PropelException - if unable to parse/validate the date/time value.
  227. */
  228. public function getDbLastlogin($format = 'Y-m-d H:i:s')
  229. {
  230. if ($this->lastlogin === null) {
  231. return null;
  232. }
  233. try {
  234. $dt = new DateTime($this->lastlogin);
  235. } catch (Exception $x) {
  236. throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->lastlogin, true), $x);
  237. }
  238. if ($format === null) {
  239. // Because propel.useDateTimeClass is TRUE, we return a DateTime object.
  240. return $dt;
  241. } elseif (strpos($format, '%') !== false) {
  242. return strftime($format, $dt->format('U'));
  243. } else {
  244. return $dt->format($format);
  245. }
  246. }
  247. /**
  248. * Get the [optionally formatted] temporal [lastfail] column value.
  249. *
  250. *
  251. * @param string $format The date/time format string (either date()-style or strftime()-style).
  252. * If format is NULL, then the raw DateTime object will be returned.
  253. * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
  254. * @throws PropelException - if unable to parse/validate the date/time value.
  255. */
  256. public function getDbLastfail($format = 'Y-m-d H:i:s')
  257. {
  258. if ($this->lastfail === null) {
  259. return null;
  260. }
  261. try {
  262. $dt = new DateTime($this->lastfail);
  263. } catch (Exception $x) {
  264. throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->lastfail, true), $x);
  265. }
  266. if ($format === null) {
  267. // Because propel.useDateTimeClass is TRUE, we return a DateTime object.
  268. return $dt;
  269. } elseif (strpos($format, '%') !== false) {
  270. return strftime($format, $dt->format('U'));
  271. } else {
  272. return $dt->format($format);
  273. }
  274. }
  275. /**
  276. * Get the [skype_contact] column value.
  277. *
  278. * @return string
  279. */
  280. public function getDbSkypeContact()
  281. {
  282. return $this->skype_contact;
  283. }
  284. /**
  285. * Get the [jabber_contact] column value.
  286. *
  287. * @return string
  288. */
  289. public function getDbJabberContact()
  290. {
  291. return $this->jabber_contact;
  292. }
  293. /**
  294. * Get the [email] column value.
  295. *
  296. * @return string
  297. */
  298. public function getDbEmail()
  299. {
  300. return $this->email;
  301. }
  302. /**
  303. * Get the [cell_phone] column value.
  304. *
  305. * @return string
  306. */
  307. public function getDbCellPhone()
  308. {
  309. return $this->cell_phone;
  310. }
  311. /**
  312. * Get the [login_attempts] column value.
  313. *
  314. * @return int
  315. */
  316. public function getDbLoginAttempts()
  317. {
  318. return $this->login_attempts;
  319. }
  320. /**
  321. * Set the value of [id] column.
  322. *
  323. * @param int $v new value
  324. * @return CcSubjs The current object (for fluent API support)
  325. */
  326. public function setDbId($v)
  327. {
  328. if ($v !== null) {
  329. $v = (int) $v;
  330. }
  331. if ($this->id !== $v) {
  332. $this->id = $v;
  333. $this->modifiedColumns[] = CcSubjsPeer::ID;
  334. }
  335. return $this;
  336. } // setDbId()
  337. /**
  338. * Set the value of [login] column.
  339. *
  340. * @param string $v new value
  341. * @return CcSubjs The current object (for fluent API support)
  342. */
  343. public function setDbLogin($v)
  344. {
  345. if ($v !== null) {
  346. $v = (string) $v;
  347. }
  348. if ($this->login !== $v || $this->isNew()) {
  349. $this->login = $v;
  350. $this->modifiedColumns[] = CcSubjsPeer::LOGIN;
  351. }
  352. return $this;
  353. } // setDbLogin()
  354. /**
  355. * Set the value of [pass] column.
  356. *
  357. * @param string $v new value
  358. * @return CcSubjs The current object (for fluent API support)
  359. */
  360. public function setDbPass($v)
  361. {
  362. if ($v !== null) {
  363. $v = (string) $v;
  364. }
  365. if ($this->pass !== $v || $this->isNew()) {
  366. $this->pass = $v;
  367. $this->modifiedColumns[] = CcSubjsPeer::PASS;
  368. }
  369. return $this;
  370. } // setDbPass()
  371. /**
  372. * Set the value of [type] column.
  373. *
  374. * @param string $v new value
  375. * @return CcSubjs The current object (for fluent API support)
  376. */
  377. public function setDbType($v)
  378. {
  379. if ($v !== null) {
  380. $v = (string) $v;
  381. }
  382. if ($this->type !== $v || $this->isNew()) {
  383. $this->type = $v;
  384. $this->modifiedColumns[] = CcSubjsPeer::TYPE;
  385. }
  386. return $this;
  387. } // setDbType()
  388. /**
  389. * Set the value of [first_name] column.
  390. *
  391. * @param string $v new value
  392. * @return CcSubjs The current object (for fluent API support)
  393. */
  394. public function setDbFirstName($v)
  395. {
  396. if ($v !== null) {
  397. $v = (string) $v;
  398. }
  399. if ($this->first_name !== $v || $this->isNew()) {
  400. $this->first_name = $v;
  401. $this->modifiedColumns[] = CcSubjsPeer::FIRST_NAME;
  402. }
  403. return $this;
  404. } // setDbFirstName()
  405. /**
  406. * Set the value of [last_name] column.
  407. *
  408. * @param string $v new value
  409. * @return CcSubjs The current object (for fluent API support)
  410. */
  411. public function setDbLastName($v)
  412. {
  413. if ($v !== null) {
  414. $v = (string) $v;
  415. }
  416. if ($this->last_name !== $v || $this->isNew()) {
  417. $this->last_name = $v;
  418. $this->modifiedColumns[] = CcSubjsPeer::LAST_NAME;
  419. }
  420. return $this;
  421. } // setDbLastName()
  422. /**
  423. * Sets the value of [lastlogin] column to a normalized version of the date/time value specified.
  424. *
  425. * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
  426. * be treated as NULL for temporal objects.
  427. * @return CcSubjs The current object (for fluent API support)
  428. */
  429. public function setDbLastlogin($v)
  430. {
  431. // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  432. // -- which is unexpected, to say the least.
  433. if ($v === null || $v === '') {
  434. $dt = null;
  435. } elseif ($v instanceof DateTime) {
  436. $dt = $v;
  437. } else {
  438. // some string/numeric value passed; we normalize that so that we can
  439. // validate it.
  440. try {
  441. if (is_numeric($v)) { // if it's a unix timestamp
  442. $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
  443. // We have to explicitly specify and then change the time zone because of a
  444. // DateTime bug: http://bugs.php.net/bug.php?id=43003
  445. $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  446. } else {
  447. $dt = new DateTime($v);
  448. }
  449. } catch (Exception $x) {
  450. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  451. }
  452. }
  453. if ( $this->lastlogin !== null || $dt !== null ) {
  454. // (nested ifs are a little easier to read in this case)
  455. $currNorm = ($this->lastlogin !== null && $tmpDt = new DateTime($this->lastlogin)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null;
  456. $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null;
  457. if ( ($currNorm !== $newNorm) // normalized values don't match
  458. )
  459. {
  460. $this->lastlogin = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null);
  461. $this->modifiedColumns[] = CcSubjsPeer::LASTLOGIN;
  462. }
  463. } // if either are not null
  464. return $this;
  465. } // setDbLastlogin()
  466. /**
  467. * Sets the value of [lastfail] column to a normalized version of the date/time value specified.
  468. *
  469. * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
  470. * be treated as NULL for temporal objects.
  471. * @return CcSubjs The current object (for fluent API support)
  472. */
  473. public function setDbLastfail($v)
  474. {
  475. // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  476. // -- which is unexpected, to say the least.
  477. if ($v === null || $v === '') {
  478. $dt = null;
  479. } elseif ($v instanceof DateTime) {
  480. $dt = $v;
  481. } else {
  482. // some string/numeric value passed; we normalize that so that we can
  483. // validate it.
  484. try {
  485. if (is_numeric($v)) { // if it's a unix timestamp
  486. $dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
  487. // We have to explicitly specify and then change the time zone because of a
  488. // DateTime bug: http://bugs.php.net/bug.php?id=43003
  489. $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  490. } else {
  491. $dt = new DateTime($v);
  492. }
  493. } catch (Exception $x) {
  494. throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
  495. }
  496. }
  497. if ( $this->lastfail !== null || $dt !== null ) {
  498. // (nested ifs are a little easier to read in this case)
  499. $currNorm = ($this->lastfail !== null && $tmpDt = new DateTime($this->lastfail)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null;
  500. $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null;
  501. if ( ($currNorm !== $newNorm) // normalized values don't match
  502. )
  503. {
  504. $this->lastfail = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null);
  505. $this->modifiedColumns[] = CcSubjsPeer::LASTFAIL;
  506. }
  507. } // if either are not null
  508. return $this;
  509. } // setDbLastfail()
  510. /**
  511. * Set the value of [skype_contact] column.
  512. *
  513. * @param string $v new value
  514. * @return CcSubjs The current object (for fluent API support)
  515. */
  516. public function setDbSkypeContact($v)
  517. {
  518. if ($v !== null) {
  519. $v = (string) $v;
  520. }
  521. if ($this->skype_contact !== $v) {
  522. $this->skype_contact = $v;
  523. $this->modifiedColumns[] = CcSubjsPeer::SKYPE_CONTACT;
  524. }
  525. return $this;
  526. } // setDbSkypeContact()
  527. /**
  528. * Set the value of [jabber_contact] column.
  529. *
  530. * @param string $v new value
  531. * @return CcSubjs The current object (for fluent API support)
  532. */
  533. public function setDbJabberContact($v)
  534. {
  535. if ($v !== null) {
  536. $v = (string) $v;
  537. }
  538. if ($this->jabber_contact !== $v) {
  539. $this->jabber_contact = $v;
  540. $this->modifiedColumns[] = CcSubjsPeer::JABBER_CONTACT;
  541. }
  542. return $this;
  543. } // setDbJabberContact()
  544. /**
  545. * Set the value of [email] column.
  546. *
  547. * @param string $v new value
  548. * @return CcSubjs The current object (for fluent API support)
  549. */
  550. public function setDbEmail($v)
  551. {
  552. if ($v !== null) {
  553. $v = (string) $v;
  554. }
  555. if ($this->email !== $v) {
  556. $this->email = $v;
  557. $this->modifiedColumns[] = CcSubjsPeer::EMAIL;
  558. }
  559. return $this;
  560. } // setDbEmail()
  561. /**
  562. * Set the value of [cell_phone] column.
  563. *
  564. * @param string $v new value
  565. * @return CcSubjs The current object (for fluent API support)
  566. */
  567. public function setDbCellPhone($v)
  568. {
  569. if ($v !== null) {
  570. $v = (string) $v;
  571. }
  572. if ($this->cell_phone !== $v) {
  573. $this->cell_phone = $v;
  574. $this->modifiedColumns[] = CcSubjsPeer::CELL_PHONE;
  575. }
  576. return $this;
  577. } // setDbCellPhone()
  578. /**
  579. * Set the value of [login_attempts] column.
  580. *
  581. * @param int $v new value
  582. * @return CcSubjs The current object (for fluent API support)
  583. */
  584. public function setDbLoginAttempts($v)
  585. {
  586. if ($v !== null) {
  587. $v = (int) $v;
  588. }
  589. if ($this->login_attempts !== $v || $this->isNew()) {
  590. $this->login_attempts = $v;
  591. $this->modifiedColumns[] = CcSubjsPeer::LOGIN_ATTEMPTS;
  592. }
  593. return $this;
  594. } // setDbLoginAttempts()
  595. /**
  596. * Indicates whether the columns in this object are only set to default values.
  597. *
  598. * This method can be used in conjunction with isModified() to indicate whether an object is both
  599. * modified _and_ has some values set which are non-default.
  600. *
  601. * @return boolean Whether the columns in this object are only been set with default values.
  602. */
  603. public function hasOnlyDefaultValues()
  604. {
  605. if ($this->login !== '') {
  606. return false;
  607. }
  608. if ($this->pass !== '') {
  609. return false;
  610. }
  611. if ($this->type !== 'U') {
  612. return false;
  613. }
  614. if ($this->first_name !== '') {
  615. return false;
  616. }
  617. if ($this->last_name !== '') {
  618. return false;
  619. }
  620. if ($this->login_attempts !== 0) {
  621. return false;
  622. }
  623. // otherwise, everything was equal, so return TRUE
  624. return true;
  625. } // hasOnlyDefaultValues()
  626. /**
  627. * Hydrates (populates) the object variables with values from the database resultset.
  628. *
  629. * An offset (0-based "start column") is specified so that objects can be hydrated
  630. * with a subset of the columns in the resultset rows. This is needed, for example,
  631. * for results of JOIN queries where the resultset row includes columns from two or
  632. * more tables.
  633. *
  634. * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
  635. * @param int $startcol 0-based offset column which indicates which restultset column to start with.
  636. * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
  637. * @return int next starting column
  638. * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
  639. */
  640. public function hydrate($row, $startcol = 0, $rehydrate = false)
  641. {
  642. try {
  643. $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
  644. $this->login = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
  645. $this->pass = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
  646. $this->type = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
  647. $this->first_name = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
  648. $this->last_name = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
  649. $this->lastlogin = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
  650. $this->lastfail = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
  651. $this->skype_contact = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null;
  652. $this->jabber_contact = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null;
  653. $this->email = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null;
  654. $this->cell_phone = ($row[$startcol + 11] !== null) ? (string) $row[$startcol + 11] : null;
  655. $this->login_attempts = ($row[$startcol + 12] !== null) ? (int) $row[$startcol + 12] : null;
  656. $this->resetModified();
  657. $this->setNew(false);
  658. if ($rehydrate) {
  659. $this->ensureConsistency();
  660. }
  661. return $startcol + 13; // 13 = CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS).
  662. } catch (Exception $e) {
  663. throw new PropelException("Error populating CcSubjs object", $e);
  664. }
  665. }
  666. /**
  667. * Checks and repairs the internal consistency of the object.
  668. *
  669. * This method is executed after an already-instantiated object is re-hydrated
  670. * from the database. It exists to check any foreign keys to make sure that
  671. * the objects related to the current object are correct based on foreign key.
  672. *
  673. * You can override this method in the stub class, but you should always invoke
  674. * the base method from the overridden method (i.e. parent::ensureConsistency()),
  675. * in case your model changes.
  676. *
  677. * @throws PropelException
  678. */
  679. public function ensureConsistency()
  680. {
  681. } // ensureConsistency
  682. /**
  683. * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
  684. *
  685. * This will only work if the object has been saved and has a valid primary key set.
  686. *
  687. * @param boolean $deep (optional) Whether to also de-associated any related objects.
  688. * @param PropelPDO $con (optional) The PropelPDO connection to use.
  689. * @return void
  690. * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
  691. */
  692. public function reload($deep = false, PropelPDO $con = null)
  693. {
  694. if ($this->isDeleted()) {
  695. throw new PropelException("Cannot reload a deleted object.");
  696. }
  697. if ($this->isNew()) {
  698. throw new PropelException("Cannot reload an unsaved object.");
  699. }
  700. if ($con === null) {
  701. $con = Propel::getConnection(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
  702. }
  703. // We don't need to alter the object instance pool; we're just modifying this instance
  704. // already in the pool.
  705. $stmt = CcSubjsPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
  706. $row = $stmt->fetch(PDO::FETCH_NUM);
  707. $stmt->closeCursor();
  708. if (!$row) {
  709. throw new PropelException('Cannot find matching row in the database to reload object values.');
  710. }
  711. $this->hydrate($row, 0, true); // rehydrate
  712. if ($deep) { // also de-associate any related objects?
  713. $this->collCcFilessRelatedByDbOwnerId = null;
  714. $this->collCcFilessRelatedByDbEditedby = null;
  715. $this->collCcPermss = null;
  716. $this->collCcShowHostss = null;
  717. $this->collCcPlaylists = null;
  718. $this->collCcBlocks = null;
  719. $this->collCcPrefs = null;
  720. $this->collCcSesss = null;
  721. $this->collCcSubjsTokens = null;
  722. } // if (deep)
  723. }
  724. /**
  725. * Removes this object from datastore and sets delete attribute.
  726. *
  727. * @param PropelPDO $con
  728. * @return void
  729. * @throws PropelException
  730. * @see BaseObject::setDeleted()
  731. * @see BaseObject::isDeleted()
  732. */
  733. public function delete(PropelPDO $con = null)
  734. {
  735. if ($this->isDeleted()) {
  736. throw new PropelException("This object has already been deleted.");
  737. }
  738. if ($con === null) {
  739. $con = Propel::getConnection(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
  740. }
  741. $con->beginTransaction();
  742. try {
  743. $ret = $this->preDelete($con);
  744. if ($ret) {
  745. CcSubjsQuery::create()
  746. ->filterByPrimaryKey($this->getPrimaryKey())
  747. ->delete($con);
  748. $this->postDelete($con);
  749. $con->commit();
  750. $this->setDeleted(true);
  751. } else {
  752. $con->commit();
  753. }
  754. } catch (PropelException $e) {
  755. $con->rollBack();
  756. throw $e;
  757. }
  758. }
  759. /**
  760. * Persists this object to the database.
  761. *
  762. * If the object is new, it inserts it; otherwise an update is performed.
  763. * All modified related objects will also be persisted in the doSave()
  764. * method. This method wraps all precipitate database operations in a
  765. * single transaction.
  766. *
  767. * @param PropelPDO $con
  768. * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  769. * @throws PropelException
  770. * @see doSave()
  771. */
  772. public function save(PropelPDO $con = null)
  773. {
  774. if ($this->isDeleted()) {
  775. throw new PropelException("You cannot save an object that has been deleted.");
  776. }
  777. if ($con === null) {
  778. $con = Propel::getConnection(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
  779. }
  780. $con->beginTransaction();
  781. $isInsert = $this->isNew();
  782. try {
  783. $ret = $this->preSave($con);
  784. if ($isInsert) {
  785. $ret = $ret && $this->preInsert($con);
  786. } else {
  787. $ret = $ret && $this->preUpdate($con);
  788. }
  789. if ($ret) {
  790. $affectedRows = $this->doSave($con);
  791. if ($isInsert) {
  792. $this->postInsert($con);
  793. } else {
  794. $this->postUpdate($con);
  795. }
  796. $this->postSave($con);
  797. CcSubjsPeer::addInstanceToPool($this);
  798. } else {
  799. $affectedRows = 0;
  800. }
  801. $con->commit();
  802. return $affectedRows;
  803. } catch (PropelException $e) {
  804. $con->rollBack();
  805. throw $e;
  806. }
  807. }
  808. /**
  809. * Performs the work of inserting or updating the row in the database.
  810. *
  811. * If the object is new, it inserts it; otherwise an update is performed.
  812. * All related objects are also updated in this method.
  813. *
  814. * @param PropelPDO $con
  815. * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  816. * @throws PropelException
  817. * @see save()
  818. */
  819. protected function doSave(PropelPDO $con)
  820. {
  821. $affectedRows = 0; // initialize var to track total num of affected rows
  822. if (!$this->alreadyInSave) {
  823. $this->alreadyInSave = true;
  824. if ($this->isNew() ) {
  825. $this->modifiedColumns[] = CcSubjsPeer::ID;
  826. }
  827. // If this object has been modified, then save it to the database.
  828. if ($this->isModified()) {
  829. if ($this->isNew()) {
  830. $criteria = $this->buildCriteria();
  831. if ($criteria->keyContainsValue(CcSubjsPeer::ID) ) {
  832. throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcSubjsPeer::ID.')');
  833. }
  834. $pk = BasePeer::doInsert($criteria, $con);
  835. $affectedRows = 1;
  836. $this->setDbId($pk); //[IMV] update autoincrement primary key
  837. $this->setNew(false);
  838. } else {
  839. $affectedRows = CcSubjsPeer::doUpdate($this, $con);
  840. }
  841. $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
  842. }
  843. if ($this->collCcFilessRelatedByDbOwnerId !== null) {
  844. foreach ($this->collCcFilessRelatedByDbOwnerId as $referrerFK) {
  845. if (!$referrerFK->isDeleted()) {
  846. $affectedRows += $referrerFK->save($con);
  847. }
  848. }
  849. }
  850. if ($this->collCcFilessRelatedByDbEditedby !== null) {
  851. foreach ($this->collCcFilessRelatedByDbEditedby as $referrerFK) {
  852. if (!$referrerFK->isDeleted()) {
  853. $affectedRows += $referrerFK->save($con);
  854. }
  855. }
  856. }
  857. if ($this->collCcPermss !== null) {
  858. foreach ($this->collCcPermss as $referrerFK) {
  859. if (!$referrerFK->isDeleted()) {
  860. $affectedRows += $referrerFK->save($con);
  861. }
  862. }
  863. }
  864. if ($this->collCcShowHostss !== null) {
  865. foreach ($this->collCcShowHostss as $referrerFK) {
  866. if (!$referrerFK->isDeleted()) {
  867. $affectedRows += $referrerFK->save($con);
  868. }
  869. }
  870. }
  871. if ($this->collCcPlaylists !== null) {
  872. foreach ($this->collCcPlaylists as $referrerFK) {
  873. if (!$referrerFK->isDeleted()) {
  874. $affectedRows += $referrerFK->save($con);
  875. }
  876. }
  877. }
  878. if ($this->collCcBlocks !== null) {
  879. foreach ($this->collCcBlocks as $referrerFK) {
  880. if (!$referrerFK->isDeleted()) {
  881. $affectedRows += $referrerFK->save($con);
  882. }
  883. }
  884. }
  885. if ($this->collCcPrefs !== null) {
  886. foreach ($this->collCcPrefs as $referrerFK) {
  887. if (!$referrerFK->isDeleted()) {
  888. $affectedRows += $referrerFK->save($con);
  889. }
  890. }
  891. }
  892. if ($this->collCcSesss !== null) {
  893. foreach ($this->collCcSesss as $referrerFK) {
  894. if (!$referrerFK->isDeleted()) {
  895. $affectedRows += $referrerFK->save($con);
  896. }
  897. }
  898. }
  899. if ($this->collCcSubjsTokens !== null) {
  900. foreach ($this->collCcSubjsTokens as $referrerFK) {
  901. if (!$referrerFK->isDeleted()) {
  902. $affectedRows += $referrerFK->save($con);
  903. }
  904. }
  905. }
  906. $this->alreadyInSave = false;
  907. }
  908. return $affectedRows;
  909. } // doSave()
  910. /**
  911. * Array of ValidationFailed objects.
  912. * @var array ValidationFailed[]
  913. */
  914. protected $validationFailures = array();
  915. /**
  916. * Gets any ValidationFailed objects that resulted from last call to validate().
  917. *
  918. *
  919. * @return array ValidationFailed[]
  920. * @see validate()
  921. */
  922. public function getValidationFailures()
  923. {
  924. return $this->validationFailures;
  925. }
  926. /**
  927. * Validates the objects modified field values and all objects related to this table.
  928. *
  929. * If $columns is either a column name or an array of column names
  930. * only those columns are validated.
  931. *
  932. * @param mixed $columns Column name or an array of column names.
  933. * @return boolean Whether all columns pass validation.
  934. * @see doValidate()
  935. * @see getValidationFailures()
  936. */
  937. public function validate($columns = null)
  938. {
  939. $res = $this->doValidate($columns);
  940. if ($res === true) {
  941. $this->validationFailures = array();
  942. return true;
  943. } else {
  944. $this->validationFailures = $res;
  945. return false;
  946. }
  947. }
  948. /**
  949. * This function performs the validation work for complex object models.
  950. *
  951. * In addition to checking the current object, all related objects will
  952. * also be validated. If all pass then <code>true</code> is returned; otherwise
  953. * an aggreagated array of ValidationFailed objects will be returned.
  954. *
  955. * @param array $columns Array of column names to validate.
  956. * @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
  957. */
  958. protected function doValidate($columns = null)
  959. {
  960. if (!$this->alreadyInValidation) {
  961. $this->alreadyInValidation = true;
  962. $retval = null;
  963. $failureMap = array();
  964. if (($retval = CcSubjsPeer::doValidate($this, $columns)) !== true) {
  965. $failureMap = array_merge($failureMap, $retval);
  966. }
  967. if ($this->collCcFilessRelatedByDbOwnerId !== null) {
  968. foreach ($this->collCcFilessRelatedByDbOwnerId as $referrerFK) {
  969. if (!$referrerFK->validate($columns)) {
  970. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  971. }
  972. }
  973. }
  974. if ($this->collCcFilessRelatedByDbEditedby !== null) {
  975. foreach ($this->collCcFilessRelatedByDbEditedby as $referrerFK) {
  976. if (!$referrerFK->validate($columns)) {
  977. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  978. }
  979. }
  980. }
  981. if ($this->collCcPermss !== null) {
  982. foreach ($this->collCcPermss as $referrerFK) {
  983. if (!$referrerFK->validate($columns)) {
  984. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  985. }
  986. }
  987. }
  988. if ($this->collCcShowHostss !== null) {
  989. foreach ($this->collCcShowHostss as $referrerFK) {
  990. if (!$referrerFK->validate($columns)) {
  991. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  992. }
  993. }
  994. }
  995. if ($this->collCcPlaylists !== null) {
  996. foreach ($this->collCcPlaylists as $referrerFK) {
  997. if (!$referrerFK->validate($columns)) {
  998. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  999. }
  1000. }
  1001. }
  1002. if ($this->collCcBlocks !== null) {
  1003. foreach ($this->collCcBlocks as $referrerFK) {
  1004. if (!$referrerFK->validate($columns)) {
  1005. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  1006. }
  1007. }
  1008. }
  1009. if ($this->collCcPrefs !== null) {
  1010. foreach ($this->collCcPrefs as $referrerFK) {
  1011. if (!$referrerFK->validate($columns)) {
  1012. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  1013. }
  1014. }
  1015. }
  1016. if ($this->collCcSesss !== null) {
  1017. foreach ($this->collCcSesss as $referrerFK) {
  1018. if (!$referrerFK->validate($columns)) {
  1019. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  1020. }
  1021. }
  1022. }
  1023. if ($this->collCcSubjsTokens !== null) {
  1024. foreach ($this->collCcSubjsTokens as $referrerFK) {
  1025. if (!$referrerFK->validate($columns)) {
  1026. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  1027. }
  1028. }
  1029. }
  1030. $this->alreadyInValidation = false;
  1031. }
  1032. return (!empty($failureMap) ? $failureMap : true);
  1033. }
  1034. /**
  1035. * Retrieves a field from the object by name passed in as a string.
  1036. *
  1037. * @param string $name name
  1038. * @param string $type The type of fieldname the $name is of:
  1039. * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  1040. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  1041. * @return mixed Value of field.
  1042. */
  1043. public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
  1044. {
  1045. $pos = CcSubjsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
  1046. $field = $this->getByPosition($pos);
  1047. return $field;
  1048. }
  1049. /**
  1050. * Retrieves a field from the object by Position as specified in the xml schema.
  1051. * Zero-based.
  1052. *
  1053. * @param int $pos position in xml schema
  1054. * @return mixed Value of field at $pos
  1055. */
  1056. public function getByPosition($pos)
  1057. {
  1058. switch($pos) {
  1059. case 0:
  1060. return $this->getDbId();
  1061. break;
  1062. case 1:
  1063. return $this->getDbLogin();
  1064. break;
  1065. case 2:
  1066. return $this->getDbPass();
  1067. break;
  1068. case 3:
  1069. return $this->getDbType();
  1070. break;
  1071. case 4:
  1072. return $this->getDbFirstName();
  1073. break;
  1074. case 5:
  1075. return $this->getDbLastName();
  1076. break;
  1077. case 6:
  1078. return $this->getDbLastlogin();
  1079. break;
  1080. case 7:
  1081. return $this->getDbLastfail();
  1082. break;
  1083. case 8:
  1084. return $this->getDbSkypeContact();
  1085. break;
  1086. case 9:
  1087. return $this->getDbJabberContact();
  1088. break;
  1089. case 10:
  1090. return $this->getDbEmail();
  1091. break;
  1092. case 11:
  1093. return $this->getDbCellPhone();
  1094. break;
  1095. case 12:
  1096. return $this->getDbLoginAttempts();
  1097. break;
  1098. default:
  1099. return null;
  1100. break;
  1101. } // switch()
  1102. }
  1103. /**
  1104. * Exports the object as an array.
  1105. *
  1106. * You can specify the key type of the array by passing one of the class
  1107. * type constants.
  1108. *
  1109. * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
  1110. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
  1111. * Defaults to BasePeer::TYPE_PHPNAME.
  1112. * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
  1113. *
  1114. * @return array an associative array containing the field names (as keys) and field values
  1115. */
  1116. public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true)
  1117. {
  1118. $keys = CcSubjsPeer::getFieldNames($keyType);
  1119. $result = array(
  1120. $keys[0] => $this->getDbId(),
  1121. $keys[1] => $this->getDbLogin(),
  1122. $keys[2] => $this->getDbPass(),
  1123. $keys[3] => $this->getDbType(),
  1124. $keys[4] => $this->getDbFirstName(),
  1125. $keys[5] => $this->getDbLastName(),
  1126. $keys[6] => $this->getDbLastlogin(),
  1127. $keys[7] => $this->getDbLastfail(),
  1128. $keys[8] => $this->getDbSkypeContact(),
  1129. $keys[9] => $this->getDbJabberContact(),
  1130. $keys[10] => $this->getDbEmail(),
  1131. $keys[11] => $this->getDbCellPhone(),
  1132. $keys[12] => $this->getDbLoginAttempts(),
  1133. );
  1134. return $result;
  1135. }
  1136. /**
  1137. * Sets a field from the object by name passed in as a string.
  1138. *
  1139. * @param string $name peer name
  1140. * @param mixed $value field value
  1141. * @param string $type The type of fieldname the $name is of:
  1142. * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  1143. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  1144. * @return void
  1145. */
  1146. public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
  1147. {
  1148. $pos = CcSubjsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
  1149. return $this->setByPosition($pos, $value);
  1150. }
  1151. /**
  1152. * Sets a field from the object by Position as specified in the xml schema.
  1153. * Zero-based.
  1154. *
  1155. * @param int $pos position in xml schema
  1156. * @param mixed $value field value
  1157. * @return void
  1158. */
  1159. public function setByPosition($pos, $value)
  1160. {
  1161. switch($pos) {
  1162. case 0:
  1163. $this->setDbId($value);
  1164. break;
  1165. case 1:
  1166. $this->setDbLogin($value);
  1167. break;
  1168. case 2:
  1169. $this->setDbPass($value);
  1170. break;
  1171. case 3:
  1172. $this->setDbType($value);
  1173. break;
  1174. case 4:
  1175. $this->setDbFirstName($value);
  1176. break;
  1177. case 5:
  1178. $this->setDbLastName($value);
  1179. break;
  1180. case 6:
  1181. $this->setDbLastlogin($value);
  1182. break;
  1183. case 7:
  1184. $this->setDbLastfail($value);
  1185. break;
  1186. case 8:
  1187. $this->setDbSkypeContact($value);
  1188. break;
  1189. case 9:
  1190. $this->setDbJabberContact($value);
  1191. break;
  1192. case 10:
  1193. $this->setDbEmail($value);
  1194. break;
  1195. case 11:
  1196. $this->setDbCellPhone($value);
  1197. break;
  1198. case 12:
  1199. $this->setDbLoginAttempts($value);
  1200. break;
  1201. } // switch()
  1202. }
  1203. /**
  1204. * Populates the object using an array.
  1205. *
  1206. * This is particularly useful when populating an object from one of the
  1207. * request arrays (e.g. $_POST). This method goes through the column
  1208. * names, checking to see whether a matching key exists in populated
  1209. * array. If so the setByName() method is called for that column.
  1210. *
  1211. * You can specify the key type of the array by additionally passing one
  1212. * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
  1213. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
  1214. * The default key type is the column's phpname (e.g. 'AuthorId')
  1215. *
  1216. * @param array $arr An array to populate the object from.
  1217. * @param string $keyType The type of keys the array uses.
  1218. * @return void
  1219. */
  1220. public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
  1221. {
  1222. $keys = CcSubjsPeer::getFieldNames($keyType);
  1223. if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]);
  1224. if (array_key_exists($keys[1], $arr)) $this->setDbLogin($arr[$keys[1]]);
  1225. if (array_key_exists($keys[2], $arr)) $this->setDbPass($arr[$keys[2]]);
  1226. if (array_key_exists($keys[3], $arr)) $this->setDbType($arr[$keys[3]]);
  1227. if (array_key_exists($keys[4], $arr)) $this->setDbFirstName($arr[$keys[4]]);
  1228. if (array_key_exists($keys[5], $arr)) $this->setDbLastName($arr[$keys[5]]);
  1229. if (array_key_exists($keys[6], $arr)) $this->setDbLastlogin($arr[$keys[6]]);
  1230. if (array_key_exists($keys[7], $arr)) $this->setDbLastfail($arr[$keys[7]]);
  1231. if (array_key_exists($keys[8], $arr)) $this->setDbSkypeContact($arr[$keys[8]]);
  1232. if (array_key_exists($keys[9], $arr)) $this->setDbJabberContact($arr[$keys[9]]);
  1233. if (array_key_exists($keys[10], $arr)) $this->setDbEmail($arr[$keys[10]]);
  1234. if (array_key_exists($keys[11], $arr)) $this->setDbCellPhone($arr[$keys[11]]);
  1235. if (array_key_exists($keys[12], $arr)) $this->setDbLoginAttempts($arr[$keys[12]]);
  1236. }
  1237. /**
  1238. * Build a Criteria object containing the values of all modified columns in this object.
  1239. *
  1240. * @return Criteria The Criteria object containing all modified values.
  1241. */
  1242. public function buildCriteria()
  1243. {
  1244. $criteria = new Criteria(CcSubjsPeer::DATABASE_NAME);
  1245. if ($this->isColumnModified(CcSubjsPeer::ID)) $criteria->add(CcSubjsPeer::ID, $this->id);
  1246. if ($this->isColumnModified(CcSubjsPeer::LOGIN)) $criteria->add(CcSubjsPeer::LOGIN, $this->login);
  1247. if ($this->isColumnModified(CcSubjsPeer::PASS)) $criteria->add(CcSubjsPeer::PASS, $this->pass);
  1248. if ($this->isColumnModified(CcSubjsPeer::TYPE)) $criteria->add(CcSubjsPeer::TYPE, $this->type);
  1249. if ($this->isColumnModified(CcSubjsPeer::FIRST_NAME)) $criteria->add(CcSubjsPeer::FIRST_NAME, $this->first_name);
  1250. if ($this->isColumnModified(CcSubjsPeer::LAST_NAME)) $criteria->add(CcSubjsPeer::LAST_NAME, $this->last_name);
  1251. if ($this->isColumnModified(CcSubjsPeer::LASTLOGIN)) $criteria->add(CcSubjsPeer::LASTLOGIN, $this->lastlogin);
  1252. if ($this->isColumnModified(CcSubjsPeer::LASTFAIL)) $criteria->add(CcSubjsPeer::LASTFAIL, $this->lastfail);
  1253. if ($this->isColumnModified(CcSubjsPeer::SKYPE_CONTACT)) $criteria->add(CcSubjsPeer::SKYPE_CONTACT, $this->skype_contact);
  1254. if ($this->isColumnModified(CcSubjsPeer::JABBER_CONTACT)) $criteria->add(CcSubjsPeer::JABBER_CONTACT, $this->jabber_contact);
  1255. if ($this->isColumnModified(CcSubjsPeer::EMAIL)) $criteria->add(CcSubjsPeer::EMAIL, $this->email);
  1256. if ($this->isColumnModified(CcSubjsPeer::CELL_PHONE)) $criteria->add(CcSubjsPeer::CELL_PHONE, $this->cell_phone);
  1257. if ($this->isColumnModified(CcSubjsPeer::LOGIN_ATTEMPTS)) $criteria->add(CcSubjsPeer::LOGIN_ATTEMPTS, $this->login_attempts);
  1258. return $criteria;
  1259. }
  1260. /**
  1261. * Builds a Criteria object containing the primary key for this object.
  1262. *
  1263. * Unlike buildCriteria() this method includes the primary key values regardless
  1264. * of whether or not they have been modified.
  1265. *
  1266. * @return Criteria The Criteria object containing value(s) for primary key(s).
  1267. */
  1268. public function buildPkeyCriteria()
  1269. {
  1270. $criteria = new Criteria(CcSubjsPeer::DATABASE_NAME);
  1271. $criteria->add(CcSubjsPeer::ID, $this->id);
  1272. return $criteria;
  1273. }
  1274. /**
  1275. * Returns the primary key for this object (row).
  1276. * @return int
  1277. */
  1278. public function getPrimaryKey()
  1279. {
  1280. return $this->getDbId();
  1281. }
  1282. /**
  1283. * Generic method to set the primary key (id column).
  1284. *
  1285. * @param int $key Primary key.
  1286. * @return void
  1287. */
  1288. public function setPrimaryKey($key)
  1289. {
  1290. $this->setDbId($key);
  1291. }
  1292. /**
  1293. * Returns true if the primary key for this object is null.
  1294. * @return boolean
  1295. */
  1296. public function isPrimaryKeyNull()
  1297. {
  1298. return null === $this->getDbId();
  1299. }
  1300. /**
  1301. * Sets contents of passed object to values from current object.
  1302. *
  1303. * If desired, this method can also make copies of all associated (fkey referrers)
  1304. * objects.
  1305. *
  1306. * @param object $copyObj An object of CcSubjs (or compatible) type.
  1307. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  1308. * @throws PropelException
  1309. */
  1310. public function copyInto($copyObj, $deepCopy = false)
  1311. {
  1312. $copyObj->setDbLogin($this->login);
  1313. $copyObj->setDbPass($this->pass);
  1314. $copyObj->setDbType($this->type);
  1315. $copyObj->setDbFirstName($this->first_name);
  1316. $copyObj->setDbLastName($this->last_name);
  1317. $copyObj->setDbLastlogin($this->lastlogin);
  1318. $copyObj->setDbLastfail($this->lastfail);
  1319. $copyObj->setDbSkypeContact($this->skype_contact);
  1320. $copyObj->setDbJabberContact($this->jabber_contact);
  1321. $copyObj->setDbEmail($this->email);
  1322. $copyObj->setDbCellPhone($this->cell_phone);
  1323. $copyObj->setDbLoginAttempts($this->login_attempts);
  1324. if ($deepCopy) {
  1325. // important: temporarily setNew(false) because this affects the behavior of
  1326. // the getter/setter methods for fkey referrer objects.
  1327. $copyObj->setNew(false);
  1328. foreach ($this->getCcFilessRelatedByDbOwnerId() as $relObj) {
  1329. if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
  1330. $copyObj->addCcFilesRelatedByDbOwnerId($relObj->copy($deepCopy));
  1331. }
  1332. }
  1333. foreach ($this->getCcFilessRelatedByDbEditedby() as $relObj) {
  1334. if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
  1335. $copyObj->addCcFilesRelatedByDbEditedby($relObj->copy($deepCopy));
  1336. }
  1337. }
  1338. foreach ($this->getCcPermss() as $relObj) {
  1339. if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
  1340. $copyObj->addCcPerms($relObj->copy($deepCopy));
  1341. }
  1342. }
  1343. foreach ($this->getCcShowHostss() as $relObj) {
  1344. if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
  1345. $copyObj->addCcShowHosts($relObj->copy($deepCopy));
  1346. }
  1347. }
  1348. foreach ($this->getCcPlaylists() as $relObj) {
  1349. if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
  1350. $copyObj->addCcPlaylist($relObj->copy($deepCopy));
  1351. }
  1352. }
  1353. foreach ($this->getCcBlocks() as $relObj) {
  1354. if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
  1355. $copyObj->addCcBlock($relObj->copy($deepCopy));
  1356. }
  1357. }
  1358. foreach ($this->getCcPrefs() as $relObj) {
  1359. if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
  1360. $copyObj->addCcPref($relObj->copy($deepCopy));
  1361. }
  1362. }
  1363. foreach ($this->getCcSesss() as $relObj) {
  1364. if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
  1365. $copyObj->addCcSess($relObj->copy($deepCopy));
  1366. }
  1367. }
  1368. foreach ($this->getCcSubjsTokens() as $relObj) {
  1369. if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
  1370. $copyObj->addCcSubjsToken($relObj->copy($deepCopy));
  1371. }
  1372. }
  1373. } // if ($deepCopy)
  1374. $copyObj->setNew(true);
  1375. $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value
  1376. }
  1377. /**
  1378. * Makes a copy of this object that will be inserted as a new row in table when saved.
  1379. * It creates a new object filling in the simple attributes, but skipping any primary
  1380. * keys that are defined for the table.
  1381. *
  1382. * If desired, this method can also make copies of all associated (fkey referrers)
  1383. * objects.
  1384. *
  1385. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  1386. * @return CcSubjs Clone of current object.
  1387. * @throws PropelException
  1388. */
  1389. public function copy($deepCopy = false)
  1390. {
  1391. // we use get_class(), because this might be a subclass
  1392. $clazz = get_class($this);
  1393. $copyObj = new $clazz();
  1394. $this->copyInto($copyObj, $deepCopy);
  1395. return $copyObj;
  1396. }
  1397. /**
  1398. * Returns a peer instance associated with this om.
  1399. *
  1400. * Since Peer classes are not to have any instance attributes, this method returns the
  1401. * same instance for all member of this class. The method could therefore
  1402. * be static, but this would prevent one from overriding the behavior.
  1403. *
  1404. * @return CcSubjsPeer
  1405. */
  1406. public function getPeer()
  1407. {
  1408. if (self::$peer === null) {
  1409. self::$peer = new CcSubjsPeer();
  1410. }
  1411. return self::$peer;
  1412. }
  1413. /**
  1414. * Clears out the collCcFilessRelatedByDbOwnerId collection
  1415. *
  1416. * This does not modify the database; however, it will remove any associated objects, causing
  1417. * them to be refetched by subsequent calls to accessor method.
  1418. *
  1419. * @return void
  1420. * @see addCcFilessRelatedByDbOwnerId()
  1421. */
  1422. public function clearCcFilessRelatedByDbOwnerId()
  1423. {
  1424. $this->collCcFilessRelatedByDbOwnerId = null; // important to set this to NULL since that means it is uninitialized
  1425. }
  1426. /**
  1427. * Initializes the collCcFilessRelatedByDbOwnerId collection.
  1428. *
  1429. * By default this just sets the collCcFilessRelatedByDbOwnerId collection to an empty array (like clearcollCcFilessRelatedByDbOwnerId());
  1430. * however, you may wish to override this method in your stub class to provide setting appropriate
  1431. * to your application -- for example, setting the initial array to the values stored in database.
  1432. *
  1433. * @return void
  1434. */
  1435. public function initCcFilessRelatedByDbOwnerId()
  1436. {
  1437. $this->collCcFilessRelatedByDbOwnerId = new PropelObjectCollection();
  1438. $this->collCcFilessRelatedByDbOwnerId->setModel('CcFiles');
  1439. }
  1440. /**
  1441. * Gets an array of CcFiles objects which contain a foreign key that references this object.
  1442. *
  1443. * If the $criteria is not null, it is used to always fetch the results from the database.
  1444. * Otherwise the results are fetched from the database the first time, then cached.
  1445. * Next time the same method is called without $criteria, the cached collection is returned.
  1446. * If this CcSubjs is new, it will return
  1447. * an empty collection or the current collection; the criteria is ignored on a new object.
  1448. *
  1449. * @param Criteria $criteria optional Criteria object to narrow the query
  1450. * @param PropelPDO $con optional connection object
  1451. * @return PropelCollection|array CcFiles[] List of CcFiles objects
  1452. * @throws PropelException
  1453. */
  1454. public function getCcFilessRelatedByDbOwnerId($criteria = null, PropelPDO $con = null)
  1455. {
  1456. if(null === $this->collCcFilessRelatedByDbOwnerId || null !== $criteria) {
  1457. if ($this->isNew() && null === $this->collCcFilessRelatedByDbOwnerId) {
  1458. // return empty collection
  1459. $this->initCcFilessRelatedByDbOwnerId();
  1460. } else {
  1461. $collCcFilessRelatedByDbOwnerId = CcFilesQuery::create(null, $criteria)
  1462. ->filterByFkOwner($this)
  1463. ->find($con);
  1464. if (null !== $criteria) {
  1465. return $collCcFilessRelatedByDbOwnerId;
  1466. }
  1467. $this->collCcFilessRelatedByDbOwnerId = $collCcFilessRelatedByDbOwnerId;
  1468. }
  1469. }
  1470. return $this->collCcFilessRelatedByDbOwnerId;
  1471. }
  1472. /**
  1473. * Returns the number of related CcFiles objects.
  1474. *
  1475. * @param Criteria $criteria
  1476. * @param boolean $distinct
  1477. * @param PropelPDO $con
  1478. * @return int Count of related CcFiles objects.
  1479. * @throws PropelException
  1480. */
  1481. public function countCcFilessRelatedByDbOwnerId(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
  1482. {
  1483. if(null === $this->collCcFilessRelatedByDbOwnerId || null !== $criteria) {
  1484. if ($this->isNew() && null === $this->collCcFilessRelatedByDbOwnerId) {
  1485. return 0;
  1486. } else {
  1487. $query = CcFilesQuery::create(null, $criteria);
  1488. if($distinct) {
  1489. $query->distinct();
  1490. }
  1491. return $query
  1492. ->filterByFkOwner($this)
  1493. ->count($con);
  1494. }
  1495. } else {
  1496. return count($this->collCcFilessRelatedByDbOwnerId);
  1497. }
  1498. }
  1499. /**
  1500. * Method called to associate a CcFiles object to this object
  1501. * through the CcFiles foreign key attribute.
  1502. *
  1503. * @param CcFiles $l CcFiles
  1504. * @return void
  1505. * @throws PropelException
  1506. */
  1507. public function addCcFilesRelatedByDbOwnerId(CcFiles $l)
  1508. {
  1509. if ($this->collCcFilessRelatedByDbOwnerId === null) {
  1510. $this->initCcFilessRelatedByDbOwnerId();
  1511. }
  1512. if (!$this->collCcFilessRelatedByDbOwnerId->contains($l)) { // only add it if the **same** object is not already associated
  1513. $this->collCcFilessRelatedByDbOwnerId[]= $l;
  1514. $l->setFkOwner($this);
  1515. }
  1516. }
  1517. /**
  1518. * If this collection has already been initialized with
  1519. * an identical criteria, it returns the collection.
  1520. * Otherwise if this CcSubjs is new, it will return
  1521. * an empty collection; or if this CcSubjs has previously
  1522. * been saved, it will retrieve related CcFilessRelatedByDbOwnerId from storage.
  1523. *
  1524. * This method is protected by default in order to keep the public
  1525. * api reasonable. You can provide public methods for those you
  1526. * actually need in CcSubjs.
  1527. *
  1528. * @param Criteria $criteria optional Criteria object to narrow the query
  1529. * @param PropelPDO $con optional connection object
  1530. * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
  1531. * @return PropelCollection|array CcFiles[] List of CcFiles objects
  1532. */
  1533. public function getCcFilessRelatedByDbOwnerIdJoinCcMusicDirs($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
  1534. {
  1535. $query = CcFilesQuery::create(null, $criteria);
  1536. $query->joinWith('CcMusicDirs', $join_behavior);
  1537. return $this->getCcFilessRelatedByDbOwnerId($query, $con);
  1538. }
  1539. /**
  1540. * Clears out the collCcFilessRelatedByDbEditedby collection
  1541. *
  1542. * This does not modify the database; however, it will remove any associated objects, causing
  1543. * them to be refetched by subsequent calls to accessor method.
  1544. *
  1545. * @return void
  1546. * @see addCcFilessRelatedByDbEditedby()
  1547. */
  1548. public function clearCcFilessRelatedByDbEditedby()
  1549. {
  1550. $this->collCcFilessRelatedByDbEditedby = null; // important to set this to NULL since that means it is uninitialized
  1551. }
  1552. /**
  1553. * Initializes the collCcFilessRelatedByDbEditedby collection.
  1554. *
  1555. * By default this just sets the collCcFilessRelatedByDbEditedby collection to an empty array (like clearcollCcFilessRelatedByDbEditedby());
  1556. * however, you may wish to override this method in your stub class to provide setting appropriate
  1557. * to your application -- for example, setting the initial array to the values stored in database.
  1558. *
  1559. * @return void
  1560. */
  1561. public function initCcFilessRelatedByDbEditedby()
  1562. {
  1563. $this->collCcFilessRelatedByDbEditedby = new PropelObjectCollection();
  1564. $this->collCcFilessRelatedByDbEditedby->setModel('CcFiles');
  1565. }
  1566. /**
  1567. * Gets an array of CcFiles objects which contain a foreign key that references this object.
  1568. *
  1569. * If the $criteria is not null, it is used to always fetch the results from the database.
  1570. * Otherwise the results are fetched from the database the first time, then cached.
  1571. * Next time the same method is called without $criteria, the cached collection is returned.
  1572. * If this CcSubjs is new, it will return
  1573. * an empty collection or the current collection; the criteria is ignored on a new object.
  1574. *
  1575. * @param Criteria $criteria optional Criteria object to narrow the query
  1576. * @param PropelPDO $con optional connection object
  1577. * @return PropelCollection|array CcFiles[] List of CcFiles objects
  1578. * @throws PropelException
  1579. */
  1580. public function getCcFilessRelatedByDbEditedby($criteria = null, PropelPDO $con = null)
  1581. {
  1582. if(null === $this->collCcFilessRelatedByDbEditedby || null !== $criteria) {
  1583. if ($this->isNew() && null === $this->collCcFilessRelatedByDbEditedby) {
  1584. // return empty collection
  1585. $this->initCcFilessRelatedByDbEditedby();
  1586. } else {
  1587. $collCcFilessRelatedByDbEditedby = CcFilesQuery::create(null, $criteria)
  1588. ->filterByCcSubjsRelatedByDbEditedby($this)
  1589. ->find($con);
  1590. if (null !== $criteria) {
  1591. return $collCcFilessRelatedByDbEditedby;
  1592. }
  1593. $this->collCcFilessRelatedByDbEditedby = $collCcFilessRelatedByDbEditedby;
  1594. }
  1595. }
  1596. return $this->collCcFilessRelatedByDbEditedby;
  1597. }
  1598. /**
  1599. * Returns the number of related CcFiles objects.
  1600. *
  1601. * @param Criteria $criteria
  1602. * @param boolean $distinct
  1603. * @param PropelPDO $con
  1604. * @return int Count of related CcFiles objects.
  1605. * @throws PropelException
  1606. */
  1607. public function countCcFilessRelatedByDbEditedby(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
  1608. {
  1609. if(null === $this->collCcFilessRelatedByDbEditedby || null !== $criteria) {
  1610. if ($this->isNew() && null === $this->collCcFilessRelatedByDbEditedby) {
  1611. return 0;
  1612. } else {
  1613. $query = CcFilesQuery::create(null, $criteria);
  1614. if($distinct) {
  1615. $query->distinct();
  1616. }
  1617. return $query
  1618. ->filterByCcSubjsRelatedByDbEditedby($this)
  1619. ->count($con);
  1620. }
  1621. } else {
  1622. return count($this->collCcFilessRelatedByDbEditedby);
  1623. }
  1624. }
  1625. /**
  1626. * Method called to associate a CcFiles object to this object
  1627. * through the CcFiles foreign key attribute.
  1628. *
  1629. * @param CcFiles $l CcFiles
  1630. * @return void
  1631. * @throws PropelException
  1632. */
  1633. public function addCcFilesRelatedByDbEditedby(CcFiles $l)
  1634. {
  1635. if ($this->collCcFilessRelatedByDbEditedby === null) {
  1636. $this->initCcFilessRelatedByDbEditedby();
  1637. }
  1638. if (!$this->collCcFilessRelatedByDbEditedby->contains($l)) { // only add it if the **same** object is not already associated
  1639. $this->collCcFilessRelatedByDbEditedby[]= $l;
  1640. $l->setCcSubjsRelatedByDbEditedby($this);
  1641. }
  1642. }
  1643. /**
  1644. * If this collection has already been initialized with
  1645. * an identical criteria, it returns the collection.
  1646. * Otherwise if this CcSubjs is new, it will return
  1647. * an empty collection; or if this CcSubjs has previously
  1648. * been saved, it will retrieve related CcFilessRelatedByDbEditedby from storage.
  1649. *
  1650. * This method is protected by default in order to keep the public
  1651. * api reasonable. You can provide public methods for those you
  1652. * actually need in CcSubjs.
  1653. *
  1654. * @param Criteria $criteria optional Criteria object to narrow the query
  1655. * @param PropelPDO $con optional connection object
  1656. * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
  1657. * @return PropelCollection|array CcFiles[] List of CcFiles objects
  1658. */
  1659. public function getCcFilessRelatedByDbEditedbyJoinCcMusicDirs($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
  1660. {
  1661. $query = CcFilesQuery::create(null, $criteria);
  1662. $query->joinWith('CcMusicDirs', $join_behavior);
  1663. return $this->getCcFilessRelatedByDbEditedby($query, $con);
  1664. }
  1665. /**
  1666. * Clears out the collCcPermss collection
  1667. *
  1668. * This does not modify the database; however, it will remove any associated objects, causing
  1669. * them to be refetched by subsequent calls to accessor method.
  1670. *
  1671. * @return void
  1672. * @see addCcPermss()
  1673. */
  1674. public function clearCcPermss()
  1675. {
  1676. $this->collCcPermss = null; // important to set this to NULL since that means it is uninitialized
  1677. }
  1678. /**
  1679. * Initializes the collCcPermss collection.
  1680. *
  1681. * By default this just sets the collCcPermss collection to an empty array (like clearcollCcPermss());
  1682. * however, you may wish to override this method in your stub class to provide setting appropriate
  1683. * to your application -- for example, setting the initial array to the values stored in database.
  1684. *
  1685. * @return void
  1686. */
  1687. public function initCcPermss()
  1688. {
  1689. $this->collCcPermss = new PropelObjectCollection();
  1690. $this->collCcPermss->setModel('CcPerms');
  1691. }
  1692. /**
  1693. * Gets an array of CcPerms objects which contain a foreign key that references this object.
  1694. *
  1695. * If the $criteria is not null, it is used to always fetch the results from the database.
  1696. * Otherwise the results are fetched from the database the first time, then cached.
  1697. * Next time the same method is called without $criteria, the cached collection is returned.
  1698. * If this CcSubjs is new, it will return
  1699. * an empty collection or the current collection; the criteria is ignored on a new object.
  1700. *
  1701. * @param Criteria $criteria optional Criteria object to narrow the query
  1702. * @param PropelPDO $con optional connection object
  1703. * @return PropelCollection|array CcPerms[] List of CcPerms objects
  1704. * @throws PropelException
  1705. */
  1706. public function getCcPermss($criteria = null, PropelPDO $con = null)
  1707. {
  1708. if(null === $this->collCcPermss || null !== $criteria) {
  1709. if ($this->isNew() && null === $this->collCcPermss) {
  1710. // return empty collection
  1711. $this->initCcPermss();
  1712. } else {
  1713. $collCcPermss = CcPermsQuery::create(null, $criteria)
  1714. ->filterByCcSubjs($this)
  1715. ->find($con);
  1716. if (null !== $criteria) {
  1717. return $collCcPermss;
  1718. }
  1719. $this->collCcPermss = $collCcPermss;
  1720. }
  1721. }
  1722. return $this->collCcPermss;
  1723. }
  1724. /**
  1725. * Returns the number of related CcPerms objects.
  1726. *
  1727. * @param Criteria $criteria
  1728. * @param boolean $distinct
  1729. * @param PropelPDO $con
  1730. * @return int Count of related CcPerms objects.
  1731. * @throws PropelException
  1732. */
  1733. public function countCcPermss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
  1734. {
  1735. if(null === $this->collCcPermss || null !== $criteria) {
  1736. if ($this->isNew() && null === $this->collCcPermss) {
  1737. return 0;
  1738. } else {
  1739. $query = CcPermsQuery::create(null, $criteria);
  1740. if($distinct) {
  1741. $query->distinct();
  1742. }
  1743. return $query
  1744. ->filterByCcSubjs($this)
  1745. ->count($con);
  1746. }
  1747. } else {
  1748. return count($this->collCcPermss);
  1749. }
  1750. }
  1751. /**
  1752. * Method called to associate a CcPerms object to this object
  1753. * through the CcPerms foreign key attribute.
  1754. *
  1755. * @param CcPerms $l CcPerms
  1756. * @return void
  1757. * @throws PropelException
  1758. */
  1759. public function addCcPerms(CcPerms $l)
  1760. {
  1761. if ($this->collCcPermss === null) {
  1762. $this->initCcPermss();
  1763. }
  1764. if (!$this->collCcPermss->contains($l)) { // only add it if the **same** object is not already associated
  1765. $this->collCcPermss[]= $l;
  1766. $l->setCcSubjs($this);
  1767. }
  1768. }
  1769. /**
  1770. * Clears out the collCcShowHostss collection
  1771. *
  1772. * This does not modify the database; however, it will remove any associated objects, causing
  1773. * them to be refetched by subsequent calls to accessor method.
  1774. *
  1775. * @return void
  1776. * @see addCcShowHostss()
  1777. */
  1778. public function clearCcShowHostss()
  1779. {
  1780. $this->collCcShowHostss = null; // important to set this to NULL since that means it is uninitialized
  1781. }
  1782. /**
  1783. * Initializes the collCcShowHostss collection.
  1784. *
  1785. * By default this just sets the collCcShowHostss collection to an empty array (like clearcollCcShowHostss());
  1786. * however, you may wish to override this method in your stub class to provide setting appropriate
  1787. * to your application -- for example, setting the initial array to the values stored in database.
  1788. *
  1789. * @return void
  1790. */
  1791. public function initCcShowHostss()
  1792. {
  1793. $this->collCcShowHostss = new PropelObjectCollection();
  1794. $this->collCcShowHostss->setModel('CcShowHosts');
  1795. }
  1796. /**
  1797. * Gets an array of CcShowHosts objects which contain a foreign key that references this object.
  1798. *
  1799. * If the $criteria is not null, it is used to always fetch the results from the database.
  1800. * Otherwise the results are fetched from the database the first time, then cached.
  1801. * Next time the same method is called without $criteria, the cached collection is returned.
  1802. * If this CcSubjs is new, it will return
  1803. * an empty collection or the current collection; the criteria is ignored on a new object.
  1804. *
  1805. * @param Criteria $criteria optional Criteria object to narrow the query
  1806. * @param PropelPDO $con optional connection object
  1807. * @return PropelCollection|array CcShowHosts[] List of CcShowHosts objects
  1808. * @throws PropelException
  1809. */
  1810. public function getCcShowHostss($criteria = null, PropelPDO $con = null)
  1811. {
  1812. if(null === $this->collCcShowHostss || null !== $criteria) {
  1813. if ($this->isNew() && null === $this->collCcShowHostss) {
  1814. // return empty collection
  1815. $this->initCcShowHostss();
  1816. } else {
  1817. $collCcShowHostss = CcShowHostsQuery::create(null, $criteria)
  1818. ->filterByCcSubjs($this)
  1819. ->find($con);
  1820. if (null !== $criteria) {
  1821. return $collCcShowHostss;
  1822. }
  1823. $this->collCcShowHostss = $collCcShowHostss;
  1824. }
  1825. }
  1826. return $this->collCcShowHostss;
  1827. }
  1828. /**
  1829. * Returns the number of related CcShowHosts objects.
  1830. *
  1831. * @param Criteria $criteria
  1832. * @param boolean $distinct
  1833. * @param PropelPDO $con
  1834. * @return int Count of related CcShowHosts objects.
  1835. * @throws PropelException
  1836. */
  1837. public function countCcShowHostss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
  1838. {
  1839. if(null === $this->collCcShowHostss || null !== $criteria) {
  1840. if ($this->isNew() && null === $this->collCcShowHostss) {
  1841. return 0;
  1842. } else {
  1843. $query = CcShowHostsQuery::create(null, $criteria);
  1844. if($distinct) {
  1845. $query->distinct();
  1846. }
  1847. return $query
  1848. ->filterByCcSubjs($this)
  1849. ->count($con);
  1850. }
  1851. } else {
  1852. return count($this->collCcShowHostss);
  1853. }
  1854. }
  1855. /**
  1856. * Method called to associate a CcShowHosts object to this object
  1857. * through the CcShowHosts foreign key attribute.
  1858. *
  1859. * @param CcShowHosts $l CcShowHosts
  1860. * @return void
  1861. * @throws PropelException
  1862. */
  1863. public function addCcShowHosts(CcShowHosts $l)
  1864. {
  1865. if ($this->collCcShowHostss === null) {
  1866. $this->initCcShowHostss();
  1867. }
  1868. if (!$this->collCcShowHostss->contains($l)) { // only add it if the **same** object is not already associated
  1869. $this->collCcShowHostss[]= $l;
  1870. $l->setCcSubjs($this);
  1871. }
  1872. }
  1873. /**
  1874. * If this collection has already been initialized with
  1875. * an identical criteria, it returns the collection.
  1876. * Otherwise if this CcSubjs is new, it will return
  1877. * an empty collection; or if this CcSubjs has previously
  1878. * been saved, it will retrieve related CcShowHostss from storage.
  1879. *
  1880. * This method is protected by default in order to keep the public
  1881. * api reasonable. You can provide public methods for those you
  1882. * actually need in CcSubjs.
  1883. *
  1884. * @param Criteria $criteria optional Criteria object to narrow the query
  1885. * @param PropelPDO $con optional connection object
  1886. * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
  1887. * @return PropelCollection|array CcShowHosts[] List of CcShowHosts objects
  1888. */
  1889. public function getCcShowHostssJoinCcShow($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
  1890. {
  1891. $query = CcShowHostsQuery::create(null, $criteria);
  1892. $query->joinWith('CcShow', $join_behavior);
  1893. return $this->getCcShowHostss($query, $con);
  1894. }
  1895. /**
  1896. * Clears out the collCcPlaylists collection
  1897. *
  1898. * This does not modify the database; however, it will remove any associated objects, causing
  1899. * them to be refetched by subsequent calls to accessor method.
  1900. *
  1901. * @return void
  1902. * @see addCcPlaylists()
  1903. */
  1904. public function clearCcPlaylists()
  1905. {
  1906. $this->collCcPlaylists = null; // important to set this to NULL since that means it is uninitialized
  1907. }
  1908. /**
  1909. * Initializes the collCcPlaylists collection.
  1910. *
  1911. * By default this just sets the collCcPlaylists collection to an empty array (like clearcollCcPlaylists());
  1912. * however, you may wish to override this method in your stub class to provide setting appropriate
  1913. * to your application -- for example, setting the initial array to the values stored in database.
  1914. *
  1915. * @return void
  1916. */
  1917. public function initCcPlaylists()
  1918. {
  1919. $this->collCcPlaylists = new PropelObjectCollection();
  1920. $this->collCcPlaylists->setModel('CcPlaylist');
  1921. }
  1922. /**
  1923. * Gets an array of CcPlaylist objects which contain a foreign key that references this object.
  1924. *
  1925. * If the $criteria is not null, it is used to always fetch the results from the database.
  1926. * Otherwise the results are fetched from the database the first time, then cached.
  1927. * Next time the same method is called without $criteria, the cached collection is returned.
  1928. * If this CcSubjs is new, it will return
  1929. * an empty collection or the current collection; the criteria is ignored on a new object.
  1930. *
  1931. * @param Criteria $criteria optional Criteria object to narrow the query
  1932. * @param PropelPDO $con optional connection object
  1933. * @return PropelCollection|array CcPlaylist[] List of CcPlaylist objects
  1934. * @throws PropelException
  1935. */
  1936. public function getCcPlaylists($criteria = null, PropelPDO $con = null)
  1937. {
  1938. if(null === $this->collCcPlaylists || null !== $criteria) {
  1939. if ($this->isNew() && null === $this->collCcPlaylists) {
  1940. // return empty collection
  1941. $this->initCcPlaylists();
  1942. } else {
  1943. $collCcPlaylists = CcPlaylistQuery::create(null, $criteria)
  1944. ->filterByCcSubjs($this)
  1945. ->find($con);
  1946. if (null !== $criteria) {
  1947. return $collCcPlaylists;
  1948. }
  1949. $this->collCcPlaylists = $collCcPlaylists;
  1950. }
  1951. }
  1952. return $this->collCcPlaylists;
  1953. }
  1954. /**
  1955. * Returns the number of related CcPlaylist objects.
  1956. *
  1957. * @param Criteria $criteria
  1958. * @param boolean $distinct
  1959. * @param PropelPDO $con
  1960. * @return int Count of related CcPlaylist objects.
  1961. * @throws PropelException
  1962. */
  1963. public function countCcPlaylists(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
  1964. {
  1965. if(null === $this->collCcPlaylists || null !== $criteria) {
  1966. if ($this->isNew() && null === $this->collCcPlaylists) {
  1967. return 0;
  1968. } else {
  1969. $query = CcPlaylistQuery::create(null, $criteria);
  1970. if($distinct) {
  1971. $query->distinct();
  1972. }
  1973. return $query
  1974. ->filterByCcSubjs($this)
  1975. ->count($con);
  1976. }
  1977. } else {
  1978. return count($this->collCcPlaylists);
  1979. }
  1980. }
  1981. /**
  1982. * Method called to associate a CcPlaylist object to this object
  1983. * through the CcPlaylist foreign key attribute.
  1984. *
  1985. * @param CcPlaylist $l CcPlaylist
  1986. * @return void
  1987. * @throws PropelException
  1988. */
  1989. public function addCcPlaylist(CcPlaylist $l)
  1990. {
  1991. if ($this->collCcPlaylists === null) {
  1992. $this->initCcPlaylists();
  1993. }
  1994. if (!$this->collCcPlaylists->contains($l)) { // only add it if the **same** object is not already associated
  1995. $this->collCcPlaylists[]= $l;
  1996. $l->setCcSubjs($this);
  1997. }
  1998. }
  1999. /**
  2000. * Clears out the collCcBlocks collection
  2001. *
  2002. * This does not modify the database; however, it will remove any associated objects, causing
  2003. * them to be refetched by subsequent calls to accessor method.
  2004. *
  2005. * @return void
  2006. * @see addCcBlocks()
  2007. */
  2008. public function clearCcBlocks()
  2009. {
  2010. $this->collCcBlocks = null; // important to set this to NULL since that means it is uninitialized
  2011. }
  2012. /**
  2013. * Initializes the collCcBlocks collection.
  2014. *
  2015. * By default this just sets the collCcBlocks collection to an empty array (like clearcollCcBlocks());
  2016. * however, you may wish to override this method in your stub class to provide setting appropriate
  2017. * to your application -- for example, setting the initial array to the values stored in database.
  2018. *
  2019. * @return void
  2020. */
  2021. public function initCcBlocks()
  2022. {
  2023. $this->collCcBlocks = new PropelObjectCollection();
  2024. $this->collCcBlocks->setModel('CcBlock');
  2025. }
  2026. /**
  2027. * Gets an array of CcBlock objects which contain a foreign key that references this object.
  2028. *
  2029. * If the $criteria is not null, it is used to always fetch the results from the database.
  2030. * Otherwise the results are fetched from the database the first time, then cached.
  2031. * Next time the same method is called without $criteria, the cached collection is returned.
  2032. * If this CcSubjs is new, it will return
  2033. * an empty collection or the current collection; the criteria is ignored on a new object.
  2034. *
  2035. * @param Criteria $criteria optional Criteria object to narrow the query
  2036. * @param PropelPDO $con optional connection object
  2037. * @return PropelCollection|array CcBlock[] List of CcBlock objects
  2038. * @throws PropelException
  2039. */
  2040. public function getCcBlocks($criteria = null, PropelPDO $con = null)
  2041. {
  2042. if(null === $this->collCcBlocks || null !== $criteria) {
  2043. if ($this->isNew() && null === $this->collCcBlocks) {
  2044. // return empty collection
  2045. $this->initCcBlocks();
  2046. } else {
  2047. $collCcBlocks = CcBlockQuery::create(null, $criteria)
  2048. ->filterByCcSubjs($this)
  2049. ->find($con);
  2050. if (null !== $criteria) {
  2051. return $collCcBlocks;
  2052. }
  2053. $this->collCcBlocks = $collCcBlocks;
  2054. }
  2055. }
  2056. return $this->collCcBlocks;
  2057. }
  2058. /**
  2059. * Returns the number of related CcBlock objects.
  2060. *
  2061. * @param Criteria $criteria
  2062. * @param boolean $distinct
  2063. * @param PropelPDO $con
  2064. * @return int Count of related CcBlock objects.
  2065. * @throws PropelException
  2066. */
  2067. public function countCcBlocks(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
  2068. {
  2069. if(null === $this->collCcBlocks || null !== $criteria) {
  2070. if ($this->isNew() && null === $this->collCcBlocks) {
  2071. return 0;
  2072. } else {
  2073. $query = CcBlockQuery::create(null, $criteria);
  2074. if($distinct) {
  2075. $query->distinct();
  2076. }
  2077. return $query
  2078. ->filterByCcSubjs($this)
  2079. ->count($con);
  2080. }
  2081. } else {
  2082. return count($this->collCcBlocks);
  2083. }
  2084. }
  2085. /**
  2086. * Method called to associate a CcBlock object to this object
  2087. * through the CcBlock foreign key attribute.
  2088. *
  2089. * @param CcBlock $l CcBlock
  2090. * @return void
  2091. * @throws PropelException
  2092. */
  2093. public function addCcBlock(CcBlock $l)
  2094. {
  2095. if ($this->collCcBlocks === null) {
  2096. $this->initCcBlocks();
  2097. }
  2098. if (!$this->collCcBlocks->contains($l)) { // only add it if the **same** object is not already associated
  2099. $this->collCcBlocks[]= $l;
  2100. $l->setCcSubjs($this);
  2101. }
  2102. }
  2103. /**
  2104. * Clears out the collCcPrefs collection
  2105. *
  2106. * This does not modify the database; however, it will remove any associated objects, causing
  2107. * them to be refetched by subsequent calls to accessor method.
  2108. *
  2109. * @return void
  2110. * @see addCcPrefs()
  2111. */
  2112. public function clearCcPrefs()
  2113. {
  2114. $this->collCcPrefs = null; // important to set this to NULL since that means it is uninitialized
  2115. }
  2116. /**
  2117. * Initializes the collCcPrefs collection.
  2118. *
  2119. * By default this just sets the collCcPrefs collection to an empty array (like clearcollCcPrefs());
  2120. * however, you may wish to override this method in your stub class to provide setting appropriate
  2121. * to your application -- for example, setting the initial array to the values stored in database.
  2122. *
  2123. * @return void
  2124. */
  2125. public function initCcPrefs()
  2126. {
  2127. $this->collCcPrefs = new PropelObjectCollection();
  2128. $this->collCcPrefs->setModel('CcPref');
  2129. }
  2130. /**
  2131. * Gets an array of CcPref objects which contain a foreign key that references this object.
  2132. *
  2133. * If the $criteria is not null, it is used to always fetch the results from the database.
  2134. * Otherwise the results are fetched from the database the first time, then cached.
  2135. * Next time the same method is called without $criteria, the cached collection is returned.
  2136. * If this CcSubjs is new, it will return
  2137. * an empty collection or the current collection; the criteria is ignored on a new object.
  2138. *
  2139. * @param Criteria $criteria optional Criteria object to narrow the query
  2140. * @param PropelPDO $con optional connection object
  2141. * @return PropelCollection|array CcPref[] List of CcPref objects
  2142. * @throws PropelException
  2143. */
  2144. public function getCcPrefs($criteria = null, PropelPDO $con = null)
  2145. {
  2146. if(null === $this->collCcPrefs || null !== $criteria) {
  2147. if ($this->isNew() && null === $this->collCcPrefs) {
  2148. // return empty collection
  2149. $this->initCcPrefs();
  2150. } else {
  2151. $collCcPrefs = CcPrefQuery::create(null, $criteria)
  2152. ->filterByCcSubjs($this)
  2153. ->find($con);
  2154. if (null !== $criteria) {
  2155. return $collCcPrefs;
  2156. }
  2157. $this->collCcPrefs = $collCcPrefs;
  2158. }
  2159. }
  2160. return $this->collCcPrefs;
  2161. }
  2162. /**
  2163. * Returns the number of related CcPref objects.
  2164. *
  2165. * @param Criteria $criteria
  2166. * @param boolean $distinct
  2167. * @param PropelPDO $con
  2168. * @return int Count of related CcPref objects.
  2169. * @throws PropelException
  2170. */
  2171. public function countCcPrefs(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
  2172. {
  2173. if(null === $this->collCcPrefs || null !== $criteria) {
  2174. if ($this->isNew() && null === $this->collCcPrefs) {
  2175. return 0;
  2176. } else {
  2177. $query = CcPrefQuery::create(null, $criteria);
  2178. if($distinct) {
  2179. $query->distinct();
  2180. }
  2181. return $query
  2182. ->filterByCcSubjs($this)
  2183. ->count($con);
  2184. }
  2185. } else {
  2186. return count($this->collCcPrefs);
  2187. }
  2188. }
  2189. /**
  2190. * Method called to associate a CcPref object to this object
  2191. * through the CcPref foreign key attribute.
  2192. *
  2193. * @param CcPref $l CcPref
  2194. * @return void
  2195. * @throws PropelException
  2196. */
  2197. public function addCcPref(CcPref $l)
  2198. {
  2199. if ($this->collCcPrefs === null) {
  2200. $this->initCcPrefs();
  2201. }
  2202. if (!$this->collCcPrefs->contains($l)) { // only add it if the **same** object is not already associated
  2203. $this->collCcPrefs[]= $l;
  2204. $l->setCcSubjs($this);
  2205. }
  2206. }
  2207. /**
  2208. * Clears out the collCcSesss collection
  2209. *
  2210. * This does not modify the database; however, it will remove any associated objects, causing
  2211. * them to be refetched by subsequent calls to accessor method.
  2212. *
  2213. * @return void
  2214. * @see addCcSesss()
  2215. */
  2216. public function clearCcSesss()
  2217. {
  2218. $this->collCcSesss = null; // important to set this to NULL since that means it is uninitialized
  2219. }
  2220. /**
  2221. * Initializes the collCcSesss collection.
  2222. *
  2223. * By default this just sets the collCcSesss collection to an empty array (like clearcollCcSesss());
  2224. * however, you may wish to override this method in your stub class to provide setting appropriate
  2225. * to your application -- for example, setting the initial array to the values stored in database.
  2226. *
  2227. * @return void
  2228. */
  2229. public function initCcSesss()
  2230. {
  2231. $this->collCcSesss = new PropelObjectCollection();
  2232. $this->collCcSesss->setModel('CcSess');
  2233. }
  2234. /**
  2235. * Gets an array of CcSess objects which contain a foreign key that references this object.
  2236. *
  2237. * If the $criteria is not null, it is used to always fetch the results from the database.
  2238. * Otherwise the results are fetched from the database the first time, then cached.
  2239. * Next time the same method is called without $criteria, the cached collection is returned.
  2240. * If this CcSubjs is new, it will return
  2241. * an empty collection or the current collection; the criteria is ignored on a new object.
  2242. *
  2243. * @param Criteria $criteria optional Criteria object to narrow the query
  2244. * @param PropelPDO $con optional connection object
  2245. * @return PropelCollection|array CcSess[] List of CcSess objects
  2246. * @throws PropelException
  2247. */
  2248. public function getCcSesss($criteria = null, PropelPDO $con = null)
  2249. {
  2250. if(null === $this->collCcSesss || null !== $criteria) {
  2251. if ($this->isNew() && null === $this->collCcSesss) {
  2252. // return empty collection
  2253. $this->initCcSesss();
  2254. } else {
  2255. $collCcSesss = CcSessQuery::create(null, $criteria)
  2256. ->filterByCcSubjs($this)
  2257. ->find($con);
  2258. if (null !== $criteria) {
  2259. return $collCcSesss;
  2260. }
  2261. $this->collCcSesss = $collCcSesss;
  2262. }
  2263. }
  2264. return $this->collCcSesss;
  2265. }
  2266. /**
  2267. * Returns the number of related CcSess objects.
  2268. *
  2269. * @param Criteria $criteria
  2270. * @param boolean $distinct
  2271. * @param PropelPDO $con
  2272. * @return int Count of related CcSess objects.
  2273. * @throws PropelException
  2274. */
  2275. public function countCcSesss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
  2276. {
  2277. if(null === $this->collCcSesss || null !== $criteria) {
  2278. if ($this->isNew() && null === $this->collCcSesss) {
  2279. return 0;
  2280. } else {
  2281. $query = CcSessQuery::create(null, $criteria);
  2282. if($distinct) {
  2283. $query->distinct();
  2284. }
  2285. return $query
  2286. ->filterByCcSubjs($this)
  2287. ->count($con);
  2288. }
  2289. } else {
  2290. return count($this->collCcSesss);
  2291. }
  2292. }
  2293. /**
  2294. * Method called to associate a CcSess object to this object
  2295. * through the CcSess foreign key attribute.
  2296. *
  2297. * @param CcSess $l CcSess
  2298. * @return void
  2299. * @throws PropelException
  2300. */
  2301. public function addCcSess(CcSess $l)
  2302. {
  2303. if ($this->collCcSesss === null) {
  2304. $this->initCcSesss();
  2305. }
  2306. if (!$this->collCcSesss->contains($l)) { // only add it if the **same** object is not already associated
  2307. $this->collCcSesss[]= $l;
  2308. $l->setCcSubjs($this);
  2309. }
  2310. }
  2311. /**
  2312. * Clears out the collCcSubjsTokens collection
  2313. *
  2314. * This does not modify the database; however, it will remove any associated objects, causing
  2315. * them to be refetched by subsequent calls to accessor method.
  2316. *
  2317. * @return void
  2318. * @see addCcSubjsTokens()
  2319. */
  2320. public function clearCcSubjsTokens()
  2321. {
  2322. $this->collCcSubjsTokens = null; // important to set this to NULL since that means it is uninitialized
  2323. }
  2324. /**
  2325. * Initializes the collCcSubjsTokens collection.
  2326. *
  2327. * By default this just sets the collCcSubjsTokens collection to an empty array (like clearcollCcSubjsTokens());
  2328. * however, you may wish to override this method in your stub class to provide setting appropriate
  2329. * to your application -- for example, setting the initial array to the values stored in database.
  2330. *
  2331. * @return void
  2332. */
  2333. public function initCcSubjsTokens()
  2334. {
  2335. $this->collCcSubjsTokens = new PropelObjectCollection();
  2336. $this->collCcSubjsTokens->setModel('CcSubjsToken');
  2337. }
  2338. /**
  2339. * Gets an array of CcSubjsToken objects which contain a foreign key that references this object.
  2340. *
  2341. * If the $criteria is not null, it is used to always fetch the results from the database.
  2342. * Otherwise the results are fetched from the database the first time, then cached.
  2343. * Next time the same method is called without $criteria, the cached collection is returned.
  2344. * If this CcSubjs is new, it will return
  2345. * an empty collection or the current collection; the criteria is ignored on a new object.
  2346. *
  2347. * @param Criteria $criteria optional Criteria object to narrow the query
  2348. * @param PropelPDO $con optional connection object
  2349. * @return PropelCollection|array CcSubjsToken[] List of CcSubjsToken objects
  2350. * @throws PropelException
  2351. */
  2352. public function getCcSubjsTokens($criteria = null, PropelPDO $con = null)
  2353. {
  2354. if(null === $this->collCcSubjsTokens || null !== $criteria) {
  2355. if ($this->isNew() && null === $this->collCcSubjsTokens) {
  2356. // return empty collection
  2357. $this->initCcSubjsTokens();
  2358. } else {
  2359. $collCcSubjsTokens = CcSubjsTokenQuery::create(null, $criteria)
  2360. ->filterByCcSubjs($this)
  2361. ->find($con);
  2362. if (null !== $criteria) {
  2363. return $collCcSubjsTokens;
  2364. }
  2365. $this->collCcSubjsTokens = $collCcSubjsTokens;
  2366. }
  2367. }
  2368. return $this->collCcSubjsTokens;
  2369. }
  2370. /**
  2371. * Returns the number of related CcSubjsToken objects.
  2372. *
  2373. * @param Criteria $criteria
  2374. * @param boolean $distinct
  2375. * @param PropelPDO $con
  2376. * @return int Count of related CcSubjsToken objects.
  2377. * @throws PropelException
  2378. */
  2379. public function countCcSubjsTokens(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
  2380. {
  2381. if(null === $this->collCcSubjsTokens || null !== $criteria) {
  2382. if ($this->isNew() && null === $this->collCcSubjsTokens) {
  2383. return 0;
  2384. } else {
  2385. $query = CcSubjsTokenQuery::create(null, $criteria);
  2386. if($distinct) {
  2387. $query->distinct();
  2388. }
  2389. return $query
  2390. ->filterByCcSubjs($this)
  2391. ->count($con);
  2392. }
  2393. } else {
  2394. return count($this->collCcSubjsTokens);
  2395. }
  2396. }
  2397. /**
  2398. * Method called to associate a CcSubjsToken object to this object
  2399. * through the CcSubjsToken foreign key attribute.
  2400. *
  2401. * @param CcSubjsToken $l CcSubjsToken
  2402. * @return void
  2403. * @throws PropelException
  2404. */
  2405. public function addCcSubjsToken(CcSubjsToken $l)
  2406. {
  2407. if ($this->collCcSubjsTokens === null) {
  2408. $this->initCcSubjsTokens();
  2409. }
  2410. if (!$this->collCcSubjsTokens->contains($l)) { // only add it if the **same** object is not already associated
  2411. $this->collCcSubjsTokens[]= $l;
  2412. $l->setCcSubjs($this);
  2413. }
  2414. }
  2415. /**
  2416. * Clears the current object and sets all attributes to their default values
  2417. */
  2418. public function clear()
  2419. {
  2420. $this->id = null;
  2421. $this->login = null;
  2422. $this->pass = null;
  2423. $this->type = null;
  2424. $this->first_name = null;
  2425. $this->last_name = null;
  2426. $this->lastlogin = null;
  2427. $this->lastfail = null;
  2428. $this->skype_contact = null;
  2429. $this->jabber_contact = null;
  2430. $this->email = null;
  2431. $this->cell_phone = null;
  2432. $this->login_attempts = null;
  2433. $this->alreadyInSave = false;
  2434. $this->alreadyInValidation = false;
  2435. $this->clearAllReferences();
  2436. $this->applyDefaultValues();
  2437. $this->resetModified();
  2438. $this->setNew(true);
  2439. $this->setDeleted(false);
  2440. }
  2441. /**
  2442. * Resets all collections of referencing foreign keys.
  2443. *
  2444. * This method is a user-space workaround for PHP's inability to garbage collect objects
  2445. * with circular references. This is currently necessary when using Propel in certain
  2446. * daemon or large-volumne/high-memory operations.
  2447. *
  2448. * @param boolean $deep Whether to also clear the references on all associated objects.
  2449. */
  2450. public function clearAllReferences($deep = false)
  2451. {
  2452. if ($deep) {
  2453. if ($this->collCcFilessRelatedByDbOwnerId) {
  2454. foreach ((array) $this->collCcFilessRelatedByDbOwnerId as $o) {
  2455. $o->clearAllReferences($deep);
  2456. }
  2457. }
  2458. if ($this->collCcFilessRelatedByDbEditedby) {
  2459. foreach ((array) $this->collCcFilessRelatedByDbEditedby as $o) {
  2460. $o->clearAllReferences($deep);
  2461. }
  2462. }
  2463. if ($this->collCcPermss) {
  2464. foreach ((array) $this->collCcPermss as $o) {
  2465. $o->clearAllReferences($deep);
  2466. }
  2467. }
  2468. if ($this->collCcShowHostss) {
  2469. foreach ((array) $this->collCcShowHostss as $o) {
  2470. $o->clearAllReferences($deep);
  2471. }
  2472. }
  2473. if ($this->collCcPlaylists) {
  2474. foreach ((array) $this->collCcPlaylists as $o) {
  2475. $o->clearAllReferences($deep);
  2476. }
  2477. }
  2478. if ($this->collCcBlocks) {
  2479. foreach ((array) $this->collCcBlocks as $o) {
  2480. $o->clearAllReferences($deep);
  2481. }
  2482. }
  2483. if ($this->collCcPrefs) {
  2484. foreach ((array) $this->collCcPrefs as $o) {
  2485. $o->clearAllReferences($deep);
  2486. }
  2487. }
  2488. if ($this->collCcSesss) {
  2489. foreach ((array) $this->collCcSesss as $o) {
  2490. $o->clearAllReferences($deep);
  2491. }
  2492. }
  2493. if ($this->collCcSubjsTokens) {
  2494. foreach ((array) $this->collCcSubjsTokens as $o) {
  2495. $o->clearAllReferences($deep);
  2496. }
  2497. }
  2498. } // if ($deep)
  2499. $this->collCcFilessRelatedByDbOwnerId = null;
  2500. $this->collCcFilessRelatedByDbEditedby = null;
  2501. $this->collCcPermss = null;
  2502. $this->collCcShowHostss = null;
  2503. $this->collCcPlaylists = null;
  2504. $this->collCcBlocks = null;
  2505. $this->collCcPrefs = null;
  2506. $this->collCcSesss = null;
  2507. $this->collCcSubjsTokens = null;
  2508. }
  2509. /**
  2510. * Catches calls to virtual methods
  2511. */
  2512. public function __call($name, $params)
  2513. {
  2514. if (preg_match('/get(\w+)/', $name, $matches)) {
  2515. $virtualColumn = $matches[1];
  2516. if ($this->hasVirtualColumn($virtualColumn)) {
  2517. return $this->getVirtualColumn($virtualColumn);
  2518. }
  2519. // no lcfirst in php<5.3...
  2520. $virtualColumn[0] = strtolower($virtualColumn[0]);
  2521. if ($this->hasVirtualColumn($virtualColumn)) {
  2522. return $this->getVirtualColumn($virtualColumn);
  2523. }
  2524. }
  2525. throw new PropelException('Call to undefined method: ' . $name);
  2526. }
  2527. } // BaseCcSubjs