Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
 
3
/**
4
 * Base class that represents a row from the 'movie_i18n' table.
5
 *
6
 *
7
 *
8
 * This class was autogenerated by Propel 1.4.2 on:
9
 *
10
 * Fri Aug  5 09:39:38 2011
11
 *
12
 * @package    lib.model.om
13
 */
14
abstract class BaseMovieI18n extends BaseObject  implements Persistent {
15
 
16
 
17
	/**
18
	 * The Peer class.
19
	 * Instance provides a convenient way of calling static methods on a class
20
	 * that calling code may not be able to identify.
21
	 * @var        MovieI18nPeer
22
	 */
23
	protected static $peer;
24
 
25
	/**
26
	 * The value for the id field.
27
	 * @var        int
28
	 */
29
	protected $id;
30
 
31
	/**
32
	 * The value for the culture field.
33
	 * @var        string
34
	 */
35
	protected $culture;
36
 
37
	/**
38
	 * The value for the title field.
39
	 * @var        string
40
	 */
41
	protected $title;
42
 
43
	/**
44
	 * @var        Movie
45
	 */
46
	protected $aMovie;
47
 
48
	/**
49
	 * Flag to prevent endless save loop, if this object is referenced
50
	 * by another object which falls in this transaction.
51
	 * @var        boolean
52
	 */
53
	protected $alreadyInSave = false;
54
 
55
	/**
56
	 * Flag to prevent endless validation loop, if this object is referenced
57
	 * by another object which falls in this transaction.
58
	 * @var        boolean
59
	 */
60
	protected $alreadyInValidation = false;
61
 
62
	// symfony behavior
63
 
64
	const PEER = 'MovieI18nPeer';
65
 
66
	/**
67
	 * Get the [id] column value.
68
	 *
69
	 * @return     int
70
	 */
71
	public function getId()
72
	{
73
		return $this->id;
74
	}
75
 
76
	/**
77
	 * Get the [culture] column value.
78
	 *
79
	 * @return     string
80
	 */
81
	public function getCulture()
82
	{
83
		return $this->culture;
84
	}
85
 
86
	/**
87
	 * Get the [title] column value.
88
	 *
89
	 * @return     string
90
	 */
91
	public function getTitle()
92
	{
93
		return $this->title;
94
	}
95
 
96
	/**
97
	 * Set the value of [id] column.
98
	 *
99
	 * @param      int $v new value
100
	 * @return     MovieI18n The current object (for fluent API support)
101
	 */
102
	public function setId($v)
103
	{
104
		if ($v !== null) {
105
			$v = (int) $v;
106
		}
107
 
108
		if ($this->id !== $v) {
109
			$this->id = $v;
110
			$this->modifiedColumns[] = MovieI18nPeer::ID;
111
		}
112
 
113
		if ($this->aMovie !== null && $this->aMovie->getId() !== $v) {
114
			$this->aMovie = null;
115
		}
116
 
117
		return $this;
118
	} // setId()
119
 
120
	/**
121
	 * Set the value of [culture] column.
122
	 *
123
	 * @param      string $v new value
124
	 * @return     MovieI18n The current object (for fluent API support)
125
	 */
126
	public function setCulture($v)
127
	{
128
		if ($v !== null) {
129
			$v = (string) $v;
130
		}
131
 
132
		if ($this->culture !== $v) {
133
			$this->culture = $v;
134
			$this->modifiedColumns[] = MovieI18nPeer::CULTURE;
135
		}
136
 
137
		return $this;
138
	} // setCulture()
139
 
140
	/**
141
	 * Set the value of [title] column.
142
	 *
143
	 * @param      string $v new value
144
	 * @return     MovieI18n The current object (for fluent API support)
145
	 */
146
	public function setTitle($v)
147
	{
148
		if ($v !== null) {
149
			$v = (string) $v;
150
		}
151
 
152
		if ($this->title !== $v) {
153
			$this->title = $v;
154
			$this->modifiedColumns[] = MovieI18nPeer::TITLE;
155
		}
156
 
157
		return $this;
158
	} // setTitle()
159
 
160
	/**
161
	 * Indicates whether the columns in this object are only set to default values.
162
	 *
163
	 * This method can be used in conjunction with isModified() to indicate whether an object is both
164
	 * modified _and_ has some values set which are non-default.
165
	 *
166
	 * @return     boolean Whether the columns in this object are only been set with default values.
167
	 */
168
	public function hasOnlyDefaultValues()
169
	{
170
		// otherwise, everything was equal, so return TRUE
171
		return true;
172
	} // hasOnlyDefaultValues()
173
 
174
	/**
175
	 * Hydrates (populates) the object variables with values from the database resultset.
176
	 *
177
	 * An offset (0-based "start column") is specified so that objects can be hydrated
178
	 * with a subset of the columns in the resultset rows.  This is needed, for example,
179
	 * for results of JOIN queries where the resultset row includes columns from two or
180
	 * more tables.
181
	 *
182
	 * @param      array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
183
	 * @param      int $startcol 0-based offset column which indicates which restultset column to start with.
184
	 * @param      boolean $rehydrate Whether this object is being re-hydrated from the database.
185
	 * @return     int next starting column
186
	 * @throws     PropelException  - Any caught Exception will be rewrapped as a PropelException.
187
	 */
188
	public function hydrate($row, $startcol = 0, $rehydrate = false)
189
	{
190
		try {
191
 
192
			$this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
193
			$this->culture = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
194
			$this->title = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
195
			$this->resetModified();
196
 
197
			$this->setNew(false);
198
 
199
			if ($rehydrate) {
200
				$this->ensureConsistency();
201
			}
202
 
203
			// FIXME - using NUM_COLUMNS may be clearer.
204
			return $startcol + 3; // 3 = MovieI18nPeer::NUM_COLUMNS - MovieI18nPeer::NUM_LAZY_LOAD_COLUMNS).
205
 
206
		} catch (Exception $e) {
207
			throw new PropelException("Error populating MovieI18n object", $e);
208
		}
209
	}
210
 
211
	/**
212
	 * Checks and repairs the internal consistency of the object.
213
	 *
214
	 * This method is executed after an already-instantiated object is re-hydrated
215
	 * from the database.  It exists to check any foreign keys to make sure that
216
	 * the objects related to the current object are correct based on foreign key.
217
	 *
218
	 * You can override this method in the stub class, but you should always invoke
219
	 * the base method from the overridden method (i.e. parent::ensureConsistency()),
220
	 * in case your model changes.
221
	 *
222
	 * @throws     PropelException
223
	 */
224
	public function ensureConsistency()
225
	{
226
 
227
		if ($this->aMovie !== null && $this->id !== $this->aMovie->getId()) {
228
			$this->aMovie = null;
229
		}
230
	} // ensureConsistency
231
 
232
	/**
233
	 * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
234
	 *
235
	 * This will only work if the object has been saved and has a valid primary key set.
236
	 *
237
	 * @param      boolean $deep (optional) Whether to also de-associated any related objects.
238
	 * @param      PropelPDO $con (optional) The PropelPDO connection to use.
239
	 * @return     void
240
	 * @throws     PropelException - if this object is deleted, unsaved or doesn't have pk match in db
241
	 */
242
	public function reload($deep = false, PropelPDO $con = null)
243
	{
244
		if ($this->isDeleted()) {
245
			throw new PropelException("Cannot reload a deleted object.");
246
		}
247
 
248
		if ($this->isNew()) {
249
			throw new PropelException("Cannot reload an unsaved object.");
250
		}
251
 
252
		if ($con === null) {
253
			$con = Propel::getConnection(MovieI18nPeer::DATABASE_NAME, Propel::CONNECTION_READ);
254
		}
255
 
256
		// We don't need to alter the object instance pool; we're just modifying this instance
257
		// already in the pool.
258
 
259
		$stmt = MovieI18nPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
260
		$row = $stmt->fetch(PDO::FETCH_NUM);
261
		$stmt->closeCursor();
262
		if (!$row) {
263
			throw new PropelException('Cannot find matching row in the database to reload object values.');
264
		}
265
		$this->hydrate($row, 0, true); // rehydrate
266
 
267
		if ($deep) {  // also de-associate any related objects?
268
 
269
			$this->aMovie = null;
270
		} // if (deep)
271
	}
272
 
273
	/**
274
	 * Removes this object from datastore and sets delete attribute.
275
	 *
276
	 * @param      PropelPDO $con
277
	 * @return     void
278
	 * @throws     PropelException
279
	 * @see        BaseObject::setDeleted()
280
	 * @see        BaseObject::isDeleted()
281
	 */
282
	public function delete(PropelPDO $con = null)
283
	{
284
		if ($this->isDeleted()) {
285
			throw new PropelException("This object has already been deleted.");
286
		}
287
 
288
		if ($con === null) {
289
			$con = Propel::getConnection(MovieI18nPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
290
		}
291
 
292
		$con->beginTransaction();
293
		try {
294
			$ret = $this->preDelete($con);
295
			// symfony_behaviors behavior
296
			foreach (sfMixer::getCallables('BaseMovieI18n:delete:pre') as $callable)
297
			{
298
			  if (call_user_func($callable, $this, $con))
299
			  {
300
			    $con->commit();
301
 
302
			    return;
303
			  }
304
			}
305
 
306
			if ($ret) {
307
				MovieI18nPeer::doDelete($this, $con);
308
				$this->postDelete($con);
309
				// symfony_behaviors behavior
310
				foreach (sfMixer::getCallables('BaseMovieI18n:delete:post') as $callable)
311
				{
312
				  call_user_func($callable, $this, $con);
313
				}
314
 
315
				$this->setDeleted(true);
316
				$con->commit();
317
			} else {
318
				$con->commit();
319
			}
320
		} catch (PropelException $e) {
321
			$con->rollBack();
322
			throw $e;
323
		}
324
	}
325
 
326
	/**
327
	 * Persists this object to the database.
328
	 *
329
	 * If the object is new, it inserts it; otherwise an update is performed.
330
	 * All modified related objects will also be persisted in the doSave()
331
	 * method.  This method wraps all precipitate database operations in a
332
	 * single transaction.
333
	 *
334
	 * @param      PropelPDO $con
335
	 * @return     int The number of rows affected by this insert/update and any referring fk objects' save() operations.
336
	 * @throws     PropelException
337
	 * @see        doSave()
338
	 */
339
	public function save(PropelPDO $con = null)
340
	{
341
		if ($this->isDeleted()) {
342
			throw new PropelException("You cannot save an object that has been deleted.");
343
		}
344
 
345
		if ($con === null) {
346
			$con = Propel::getConnection(MovieI18nPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
347
		}
348
 
349
		$con->beginTransaction();
350
		$isInsert = $this->isNew();
351
		try {
352
			$ret = $this->preSave($con);
353
			// symfony_behaviors behavior
354
			foreach (sfMixer::getCallables('BaseMovieI18n:save:pre') as $callable)
355
			{
356
			  if (is_integer($affectedRows = call_user_func($callable, $this, $con)))
357
			  {
358
			    $con->commit();
359
 
360
			    return $affectedRows;
361
			  }
362
			}
363
 
364
			if ($isInsert) {
365
				$ret = $ret && $this->preInsert($con);
366
			} else {
367
				$ret = $ret && $this->preUpdate($con);
368
			}
369
			if ($ret) {
370
				$affectedRows = $this->doSave($con);
371
				if ($isInsert) {
372
					$this->postInsert($con);
373
				} else {
374
					$this->postUpdate($con);
375
				}
376
				$this->postSave($con);
377
				// symfony_behaviors behavior
378
				foreach (sfMixer::getCallables('BaseMovieI18n:save:post') as $callable)
379
				{
380
				  call_user_func($callable, $this, $con, $affectedRows);
381
				}
382
 
383
				MovieI18nPeer::addInstanceToPool($this);
384
			} else {
385
				$affectedRows = 0;
386
			}
387
			$con->commit();
388
			return $affectedRows;
389
		} catch (PropelException $e) {
390
			$con->rollBack();
391
			throw $e;
392
		}
393
	}
394
 
395
	/**
396
	 * Performs the work of inserting or updating the row in the database.
397
	 *
398
	 * If the object is new, it inserts it; otherwise an update is performed.
399
	 * All related objects are also updated in this method.
400
	 *
401
	 * @param      PropelPDO $con
402
	 * @return     int The number of rows affected by this insert/update and any referring fk objects' save() operations.
403
	 * @throws     PropelException
404
	 * @see        save()
405
	 */
406
	protected function doSave(PropelPDO $con)
407
	{
408
		$affectedRows = 0; // initialize var to track total num of affected rows
409
		if (!$this->alreadyInSave) {
410
			$this->alreadyInSave = true;
411
 
412
			// We call the save method on the following object(s) if they
413
			// were passed to this object by their coresponding set
414
			// method.  This object relates to these object(s) by a
415
			// foreign key reference.
416
 
417
			if ($this->aMovie !== null) {
418
				if ($this->aMovie->isModified() || ($this->aMovie->getCulture() && $this->aMovie->getCurrentMovieI18n()->isModified()) || $this->aMovie->isNew()) {
419
					$affectedRows += $this->aMovie->save($con);
420
				}
421
				$this->setMovie($this->aMovie);
422
			}
423
 
424
 
425
			// If this object has been modified, then save it to the database.
426
			if ($this->isModified()) {
427
				if ($this->isNew()) {
428
					$pk = MovieI18nPeer::doInsert($this, $con);
429
					$affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
430
										 // should always be true here (even though technically
431
										 // BasePeer::doInsert() can insert multiple rows).
432
 
433
					$this->setNew(false);
434
				} else {
435
					$affectedRows += MovieI18nPeer::doUpdate($this, $con);
436
				}
437
 
438
				$this->resetModified(); // [HL] After being saved an object is no longer 'modified'
439
			}
440
 
441
			$this->alreadyInSave = false;
442
 
443
		}
444
		return $affectedRows;
445
	} // doSave()
446
 
447
	/**
448
	 * Array of ValidationFailed objects.
449
	 * @var        array ValidationFailed[]
450
	 */
451
	protected $validationFailures = array();
452
 
453
	/**
454
	 * Gets any ValidationFailed objects that resulted from last call to validate().
455
	 *
456
	 *
457
	 * @return     array ValidationFailed[]
458
	 * @see        validate()
459
	 */
460
	public function getValidationFailures()
461
	{
462
		return $this->validationFailures;
463
	}
464
 
465
	/**
466
	 * Validates the objects modified field values and all objects related to this table.
467
	 *
468
	 * If $columns is either a column name or an array of column names
469
	 * only those columns are validated.
470
	 *
471
	 * @param      mixed $columns Column name or an array of column names.
472
	 * @return     boolean Whether all columns pass validation.
473
	 * @see        doValidate()
474
	 * @see        getValidationFailures()
475
	 */
476
	public function validate($columns = null)
477
	{
478
		$res = $this->doValidate($columns);
479
		if ($res === true) {
480
			$this->validationFailures = array();
481
			return true;
482
		} else {
483
			$this->validationFailures = $res;
484
			return false;
485
		}
486
	}
487
 
488
	/**
489
	 * This function performs the validation work for complex object models.
490
	 *
491
	 * In addition to checking the current object, all related objects will
492
	 * also be validated.  If all pass then <code>true</code> is returned; otherwise
493
	 * an aggreagated array of ValidationFailed objects will be returned.
494
	 *
495
	 * @param      array $columns Array of column names to validate.
496
	 * @return     mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
497
	 */
498
	protected function doValidate($columns = null)
499
	{
500
		if (!$this->alreadyInValidation) {
501
			$this->alreadyInValidation = true;
502
			$retval = null;
503
 
504
			$failureMap = array();
505
 
506
 
507
			// We call the validate method on the following object(s) if they
508
			// were passed to this object by their coresponding set
509
			// method.  This object relates to these object(s) by a
510
			// foreign key reference.
511
 
512
			if ($this->aMovie !== null) {
513
				if (!$this->aMovie->validate($columns)) {
514
					$failureMap = array_merge($failureMap, $this->aMovie->getValidationFailures());
515
				}
516
			}
517
 
518
 
519
			if (($retval = MovieI18nPeer::doValidate($this, $columns)) !== true) {
520
				$failureMap = array_merge($failureMap, $retval);
521
			}
522
 
523
 
524
 
525
			$this->alreadyInValidation = false;
526
		}
527
 
528
		return (!empty($failureMap) ? $failureMap : true);
529
	}
530
 
531
	/**
532
	 * Retrieves a field from the object by name passed in as a string.
533
	 *
534
	 * @param      string $name name
535
	 * @param      string $type The type of fieldname the $name is of:
536
	 *                     one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
537
	 *                     BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
538
	 * @return     mixed Value of field.
539
	 */
540
	public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
541
	{
542
		$pos = MovieI18nPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
543
		$field = $this->getByPosition($pos);
544
		return $field;
545
	}
546
 
547
	/**
548
	 * Retrieves a field from the object by Position as specified in the xml schema.
549
	 * Zero-based.
550
	 *
551
	 * @param      int $pos position in xml schema
552
	 * @return     mixed Value of field at $pos
553
	 */
554
	public function getByPosition($pos)
555
	{
556
		switch($pos) {
557
			case 0:
558
				return $this->getId();
559
				break;
560
			case 1:
561
				return $this->getCulture();
562
				break;
563
			case 2:
564
				return $this->getTitle();
565
				break;
566
			default:
567
				return null;
568
				break;
569
		} // switch()
570
	}
571
 
572
	/**
573
	 * Exports the object as an array.
574
	 *
575
	 * You can specify the key type of the array by passing one of the class
576
	 * type constants.
577
	 *
578
	 * @param      string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
579
	 *                        BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. Defaults to BasePeer::TYPE_PHPNAME.
580
	 * @param      boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns.  Defaults to TRUE.
581
	 * @return     an associative array containing the field names (as keys) and field values
582
	 */
583
	public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true)
584
	{
585
		$keys = MovieI18nPeer::getFieldNames($keyType);
586
		$result = array(
587
			$keys[0] => $this->getId(),
588
			$keys[1] => $this->getCulture(),
589
			$keys[2] => $this->getTitle(),
590
		);
591
		return $result;
592
	}
593
 
594
	/**
595
	 * Sets a field from the object by name passed in as a string.
596
	 *
597
	 * @param      string $name peer name
598
	 * @param      mixed $value field value
599
	 * @param      string $type The type of fieldname the $name is of:
600
	 *                     one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
601
	 *                     BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
602
	 * @return     void
603
	 */
604
	public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
605
	{
606
		$pos = MovieI18nPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
607
		return $this->setByPosition($pos, $value);
608
	}
609
 
610
	/**
611
	 * Sets a field from the object by Position as specified in the xml schema.
612
	 * Zero-based.
613
	 *
614
	 * @param      int $pos position in xml schema
615
	 * @param      mixed $value field value
616
	 * @return     void
617
	 */
618
	public function setByPosition($pos, $value)
619
	{
620
		switch($pos) {
621
			case 0:
622
				$this->setId($value);
623
				break;
624
			case 1:
625
				$this->setCulture($value);
626
				break;
627
			case 2:
628
				$this->setTitle($value);
629
				break;
630
		} // switch()
631
	}
632
 
633
	/**
634
	 * Populates the object using an array.
635
	 *
636
	 * This is particularly useful when populating an object from one of the
637
	 * request arrays (e.g. $_POST).  This method goes through the column
638
	 * names, checking to see whether a matching key exists in populated
639
	 * array. If so the setByName() method is called for that column.
640
	 *
641
	 * You can specify the key type of the array by additionally passing one
642
	 * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
643
	 * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
644
	 * The default key type is the column's phpname (e.g. 'AuthorId')
645
	 *
646
	 * @param      array  $arr     An array to populate the object from.
647
	 * @param      string $keyType The type of keys the array uses.
648
	 * @return     void
649
	 */
650
	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
651
	{
652
		$keys = MovieI18nPeer::getFieldNames($keyType);
653
 
654
		if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
655
		if (array_key_exists($keys[1], $arr)) $this->setCulture($arr[$keys[1]]);
656
		if (array_key_exists($keys[2], $arr)) $this->setTitle($arr[$keys[2]]);
657
	}
658
 
659
	/**
660
	 * Build a Criteria object containing the values of all modified columns in this object.
661
	 *
662
	 * @return     Criteria The Criteria object containing all modified values.
663
	 */
664
	public function buildCriteria()
665
	{
666
		$criteria = new Criteria(MovieI18nPeer::DATABASE_NAME);
667
 
668
		if ($this->isColumnModified(MovieI18nPeer::ID)) $criteria->add(MovieI18nPeer::ID, $this->id);
669
		if ($this->isColumnModified(MovieI18nPeer::CULTURE)) $criteria->add(MovieI18nPeer::CULTURE, $this->culture);
670
		if ($this->isColumnModified(MovieI18nPeer::TITLE)) $criteria->add(MovieI18nPeer::TITLE, $this->title);
671
 
672
		return $criteria;
673
	}
674
 
675
	/**
676
	 * Builds a Criteria object containing the primary key for this object.
677
	 *
678
	 * Unlike buildCriteria() this method includes the primary key values regardless
679
	 * of whether or not they have been modified.
680
	 *
681
	 * @return     Criteria The Criteria object containing value(s) for primary key(s).
682
	 */
683
	public function buildPkeyCriteria()
684
	{
685
		$criteria = new Criteria(MovieI18nPeer::DATABASE_NAME);
686
 
687
		$criteria->add(MovieI18nPeer::ID, $this->id);
688
		$criteria->add(MovieI18nPeer::CULTURE, $this->culture);
689
 
690
		return $criteria;
691
	}
692
 
693
	/**
694
	 * Returns the composite primary key for this object.
695
	 * The array elements will be in same order as specified in XML.
696
	 * @return     array
697
	 */
698
	public function getPrimaryKey()
699
	{
700
		$pks = array();
701
 
702
		$pks[0] = $this->getId();
703
 
704
		$pks[1] = $this->getCulture();
705
 
706
		return $pks;
707
	}
708
 
709
	/**
710
	 * Set the [composite] primary key.
711
	 *
712
	 * @param      array $keys The elements of the composite key (order must match the order in XML file).
713
	 * @return     void
714
	 */
715
	public function setPrimaryKey($keys)
716
	{
717
 
718
		$this->setId($keys[0]);
719
 
720
		$this->setCulture($keys[1]);
721
 
722
	}
723
 
724
	/**
725
	 * Sets contents of passed object to values from current object.
726
	 *
727
	 * If desired, this method can also make copies of all associated (fkey referrers)
728
	 * objects.
729
	 *
730
	 * @param      object $copyObj An object of MovieI18n (or compatible) type.
731
	 * @param      boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
732
	 * @throws     PropelException
733
	 */
734
	public function copyInto($copyObj, $deepCopy = false)
735
	{
736
 
737
		$copyObj->setId($this->id);
738
 
739
		$copyObj->setCulture($this->culture);
740
 
741
		$copyObj->setTitle($this->title);
742
 
743
 
744
		$copyObj->setNew(true);
745
 
746
	}
747
 
748
	/**
749
	 * Makes a copy of this object that will be inserted as a new row in table when saved.
750
	 * It creates a new object filling in the simple attributes, but skipping any primary
751
	 * keys that are defined for the table.
752
	 *
753
	 * If desired, this method can also make copies of all associated (fkey referrers)
754
	 * objects.
755
	 *
756
	 * @param      boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
757
	 * @return     MovieI18n Clone of current object.
758
	 * @throws     PropelException
759
	 */
760
	public function copy($deepCopy = false)
761
	{
762
		// we use get_class(), because this might be a subclass
763
		$clazz = get_class($this);
764
		$copyObj = new $clazz();
765
		$this->copyInto($copyObj, $deepCopy);
766
		return $copyObj;
767
	}
768
 
769
	/**
770
	 * Returns a peer instance associated with this om.
771
	 *
772
	 * Since Peer classes are not to have any instance attributes, this method returns the
773
	 * same instance for all member of this class. The method could therefore
774
	 * be static, but this would prevent one from overriding the behavior.
775
	 *
776
	 * @return     MovieI18nPeer
777
	 */
778
	public function getPeer()
779
	{
780
		if (self::$peer === null) {
781
			self::$peer = new MovieI18nPeer();
782
		}
783
		return self::$peer;
784
	}
785
 
786
	/**
787
	 * Declares an association between this object and a Movie object.
788
	 *
789
	 * @param      Movie $v
790
	 * @return     MovieI18n The current object (for fluent API support)
791
	 * @throws     PropelException
792
	 */
793
	public function setMovie(Movie $v = null)
794
	{
795
		if ($v === null) {
796
			$this->setId(NULL);
797
		} else {
798
			$this->setId($v->getId());
799
		}
800
 
801
		$this->aMovie = $v;
802
 
803
		// Add binding for other direction of this n:n relationship.
804
		// If this object has already been added to the Movie object, it will not be re-added.
805
		if ($v !== null) {
806
			$v->addMovieI18n($this);
807
		}
808
 
809
		return $this;
810
	}
811
 
812
 
813
	/**
814
	 * Get the associated Movie object
815
	 *
816
	 * @param      PropelPDO Optional Connection object.
817
	 * @return     Movie The associated Movie object.
818
	 * @throws     PropelException
819
	 */
820
	public function getMovie(PropelPDO $con = null)
821
	{
822
		if ($this->aMovie === null && ($this->id !== null)) {
823
			$this->aMovie = MoviePeer::retrieveByPk($this->id);
824
			/* The following can be used additionally to
825
			   guarantee the related object contains a reference
826
			   to this object.  This level of coupling may, however, be
827
			   undesirable since it could result in an only partially populated collection
828
			   in the referenced object.
829
			   $this->aMovie->addMovieI18ns($this);
830
			 */
831
		}
832
		return $this->aMovie;
833
	}
834
 
835
	/**
836
	 * Resets all collections of referencing foreign keys.
837
	 *
838
	 * This method is a user-space workaround for PHP's inability to garbage collect objects
839
	 * with circular references.  This is currently necessary when using Propel in certain
840
	 * daemon or large-volumne/high-memory operations.
841
	 *
842
	 * @param      boolean $deep Whether to also clear the references on all associated objects.
843
	 */
844
	public function clearAllReferences($deep = false)
845
	{
846
		if ($deep) {
847
		} // if ($deep)
848
 
849
			$this->aMovie = null;
850
	}
851
 
852
	// symfony_behaviors behavior
853
 
854
	/**
855
	 * Calls methods defined via {@link sfMixer}.
856
	 */
857
	public function __call($method, $arguments)
858
	{
859
	  if (!$callable = sfMixer::getCallable('BaseMovieI18n:'.$method))
860
	  {
861
	    throw new sfException(sprintf('Call to undefined method BaseMovieI18n::%s', $method));
862
	  }
863
 
864
	  array_unshift($arguments, $this);
865
 
866
	  return call_user_func_array($callable, $arguments);
867
	}
868
 
869
	/**
870
	 * Return the string representation of this object
871
	 *
872
	 * @return string The value of the 'title' column
873
	 */
874
  public function __toString()
875
  {
876
    return (string) $this->getTitle();
877
  }
878
 
879
} // BaseMovieI18n