initial commit

This commit is contained in:
Ben Ramey
2017-03-02 21:57:21 -06:00
commit fd8ad64063
22097 changed files with 1960930 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
K 25
svn:wc:ra_dav:version-url
V 53
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib
END

View File

@@ -0,0 +1,37 @@
10
dir
55
http://barnabas/svn/pae.co.at/trunk/proactiveenglish/lib
http://barnabas/svn
2009-05-28T02:14:48.119086Z
25
ben
5f44b648-3ce2-dc11-a6be-00b0d029fcea
model
dir
symfony
dir
filters
dir

View File

@@ -0,0 +1,17 @@
K 25
svn:wc:ra_dav:version-url
V 61
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/filters
END
googleAnalyticsFilter.php
K 25
svn:wc:ra_dav:version-url
V 87
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/filters/googleAnalyticsFilter.php
END
lastPageFilter.class.php
K 25
svn:wc:ra_dav:version-url
V 86
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/filters/lastPageFilter.class.php
END

View File

@@ -0,0 +1,96 @@
10
dir
55
http://barnabas/svn/pae.co.at/trunk/proactiveenglish/lib/filters
http://barnabas/svn
2009-05-28T02:14:48.119086Z
25
ben
5f44b648-3ce2-dc11-a6be-00b0d029fcea
googleAnalyticsFilter.php
file
2010-07-31T05:42:27.000000Z
70a66fca0065005bb44e04a21a6af61a
2009-05-28T02:14:48.119086Z
25
ben
853
lastPageFilter.class.php
file
2010-07-31T05:42:27.000000Z
f1b62cfa99c6d1885f881ba10f394f5b
2009-05-28T02:14:48.119086Z
25
ben
823

View File

@@ -0,0 +1,33 @@
<?php
/**
* Adds the Google analytics code right at the
* end of body.
*
* @package default
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
class googleAnalyticsFilter extends sfFilter
{
/**
* Execute the filter
*
* @return void
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
public function execute($filterChain)
{
// Nothing to do before the action
$filterChain->execute();
// Decorate the response with the tracker code
$googleCode = '
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct="UA-'.$this->getParameter('google_id').'";urchinTracker();
</script>';
$response = $this->getContext()->getResponse();
$response->setContent(str_ireplace('</body>', $googleCode.'</body>',$response->getContent()));
}
}

View File

@@ -0,0 +1,31 @@
<?php
/**
* Records the current page request after
* the action has been executed. In this way
* the action has access to the last page request
* made by the user.
*
* @package default
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
class lastPageFilter extends sfFilter
{
/**
* Execute method of lastPageFilter
*
* @return void
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
public function execute($filterChain)
{
$filterChain->execute();
$context = $this->getContext();
$user = $context->getUser();
$user->setAttribute('lastModule', $context->getModuleName());
$user->setAttribute('lastAction', $context->getActionName());
$user->setAttribute('lastReferrer', $context->getRequest()->getReferer());
}
} // END class lastPageFilter extends sfFilter

View File

@@ -0,0 +1,33 @@
<?php
/**
* Adds the Google analytics code right at the
* end of body.
*
* @package default
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
class googleAnalyticsFilter extends sfFilter
{
/**
* Execute the filter
*
* @return void
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
public function execute($filterChain)
{
// Nothing to do before the action
$filterChain->execute();
// Decorate the response with the tracker code
$googleCode = '
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct="UA-'.$this->getParameter('google_id').'";urchinTracker();
</script>';
$response = $this->getContext()->getResponse();
$response->setContent(str_ireplace('</body>', $googleCode.'</body>',$response->getContent()));
}
}

View File

@@ -0,0 +1,31 @@
<?php
/**
* Records the current page request after
* the action has been executed. In this way
* the action has access to the last page request
* made by the user.
*
* @package default
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
class lastPageFilter extends sfFilter
{
/**
* Execute method of lastPageFilter
*
* @return void
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
public function execute($filterChain)
{
$filterChain->execute();
$context = $this->getContext();
$user = $context->getUser();
$user->setAttribute('lastModule', $context->getModuleName());
$user->setAttribute('lastAction', $context->getActionName());
$user->setAttribute('lastReferrer', $context->getRequest()->getReferer());
}
} // END class lastPageFilter extends sfFilter

View File

@@ -0,0 +1,101 @@
K 25
svn:wc:ra_dav:version-url
V 59
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model
END
EmployeeI18nPeer.php
K 25
svn:wc:ra_dav:version-url
V 80
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/EmployeeI18nPeer.php
END
EmployeePeer.php
K 25
svn:wc:ra_dav:version-url
V 76
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/EmployeePeer.php
END
EventI18nPeer.php
K 25
svn:wc:ra_dav:version-url
V 77
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/EventI18nPeer.php
END
EventPeer.php
K 25
svn:wc:ra_dav:version-url
V 73
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/EventPeer.php
END
Reference.php
K 25
svn:wc:ra_dav:version-url
V 73
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/Reference.php
END
Course.php
K 25
svn:wc:ra_dav:version-url
V 70
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/Course.php
END
CourseI18n.php
K 25
svn:wc:ra_dav:version-url
V 74
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/CourseI18n.php
END
LuEmployeePosition.php
K 25
svn:wc:ra_dav:version-url
V 82
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/LuEmployeePosition.php
END
ReferencePeer.php
K 25
svn:wc:ra_dav:version-url
V 77
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/ReferencePeer.php
END
CourseI18nPeer.php
K 25
svn:wc:ra_dav:version-url
V 78
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/CourseI18nPeer.php
END
CoursePeer.php
K 25
svn:wc:ra_dav:version-url
V 74
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/CoursePeer.php
END
Employee.php
K 25
svn:wc:ra_dav:version-url
V 72
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/Employee.php
END
EmployeeI18n.php
K 25
svn:wc:ra_dav:version-url
V 76
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/EmployeeI18n.php
END
Event.php
K 25
svn:wc:ra_dav:version-url
V 69
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/Event.php
END
EventI18n.php
K 25
svn:wc:ra_dav:version-url
V 73
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/EventI18n.php
END
LuEmployeePositionPeer.php
K 25
svn:wc:ra_dav:version-url
V 86
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/LuEmployeePositionPeer.php
END

View File

@@ -0,0 +1,578 @@
10
dir
55
http://barnabas/svn/pae.co.at/trunk/proactiveenglish/lib/model
http://barnabas/svn
2009-05-28T02:14:48.119086Z
25
ben
5f44b648-3ce2-dc11-a6be-00b0d029fcea
EmployeeI18nPeer.php
file
2010-07-31T05:41:53.000000Z
8f71491b0f6fd59694b931c8cae572cb
2009-05-28T02:14:48.119086Z
25
ben
189
EmployeePeer.php
file
2010-07-31T05:41:53.000000Z
4cd83d234d091f7bf84b35b68cddde0a
2009-05-28T02:14:48.119086Z
25
ben
1472
EventI18nPeer.php
file
2010-07-31T05:41:53.000000Z
2a21922e7df29f3e909a437a256c829d
2009-05-28T02:14:48.119086Z
25
ben
180
EventPeer.php
file
2010-07-31T05:41:53.000000Z
a50452dd6a1a97b9851e72c373dc0f31
2009-05-28T02:14:48.119086Z
25
ben
546
Reference.php
file
2010-07-31T05:41:53.000000Z
3e933b050e377ee490133bd540f00558
2009-05-28T02:14:48.119086Z
25
ben
153
Course.php
file
2010-07-31T05:41:53.000000Z
e3e7d28eefe281717ba85fe5682cc6b6
2009-05-28T02:14:48.119086Z
25
ben
144
CourseI18n.php
file
2010-07-31T05:41:53.000000Z
d125aceab41718884a677dce161c4e5c
2009-05-28T02:14:48.119086Z
25
ben
157
LuEmployeePosition.php
file
2010-07-31T05:41:53.000000Z
d76eb634ec6b9c0dc4bd12e47e2f96e0
2009-05-28T02:14:48.119086Z
25
ben
182
ReferencePeer.php
file
2010-07-31T05:41:53.000000Z
540e5756488489f63a17248571dab5a8
2009-05-28T02:14:48.119086Z
25
ben
179
CourseI18nPeer.php
file
2010-07-31T05:41:53.000000Z
d30eee42e1ae0949698007fb8e74bc3e
2009-05-28T02:14:48.119086Z
25
ben
183
CoursePeer.php
file
2010-07-31T05:41:53.000000Z
2087e31180403154931dddb230f9f278
2009-05-28T02:14:48.119086Z
25
ben
454
Employee.php
file
2010-07-31T05:41:53.000000Z
752500a858ee251746dafa57e618845c
2009-05-28T02:14:48.119086Z
25
ben
429
EmployeeI18n.php
file
2010-07-31T05:41:53.000000Z
f6a0ff6f38402d6a0b4629adeb16fc35
2009-05-28T02:14:48.119086Z
25
ben
163
LuEmployeePositionPeer.php
file
2010-07-31T05:41:53.000000Z
7be512ce1f753871ec2e093189a74462
2009-05-28T02:14:48.119086Z
25
ben
541
EventI18n.php
file
2010-07-31T05:41:53.000000Z
11ecf2d41c994f80d4435ed3c613db14
2009-05-28T02:14:48.119086Z
25
ben
154
Event.php
file
2010-07-31T05:41:53.000000Z
12cd1134956188833c32215123f7a020
2009-05-28T02:14:48.119086Z
25
ben
141
om
dir
map
dir

View File

@@ -0,0 +1,12 @@
<?php
/**
* Subclass for representing a row from the 'Course' table.
*
*
*
* @package lib.model
*/
class Course extends BaseCourse
{
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Subclass for representing a row from the 'Course_i18n' table.
*
*
*
* @package lib.model
*/
class CourseI18n extends BaseCourseI18n
{
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Subclass for performing query and update operations on the 'Course_i18n' table.
*
*
*
* @package lib.model
*/
class CourseI18nPeer extends BaseCourseI18nPeer
{
}

View File

@@ -0,0 +1,25 @@
<?php
/**
* Subclass for performing query and update operations on the 'Course' table.
*
*
*
* @package lib.model
*/
class CoursePeer extends BaseCoursePeer
{
/**
* Gets a course by the slug
*
* @return the course matching the slug
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
public static function getBySlug($slug)
{
$c = new Criteria();
$c->add(self::SLUG, $slug);
return self::doSelect($c);
}
}

View File

@@ -0,0 +1,23 @@
<?php
/**
* Subclass for representing a row from the 'Employee' table.
*
*
*
* @package lib.model
*/
class Employee extends BaseEmployee
{
/**
* Gets the text of the position linked to
* in the LuEmployeePosition table
*
* @return position text
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
public function getPositionText()
{
return $this->getLuEmployeePosition()->getPosition();
}
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Subclass for representing a row from the 'Employee_i18n' table.
*
*
*
* @package lib.model
*/
class EmployeeI18n extends BaseEmployeeI18n
{
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Subclass for performing query and update operations on the 'Employee_i18n' table.
*
*
*
* @package lib.model
*/
class EmployeeI18nPeer extends BaseEmployeeI18nPeer
{
}

View File

@@ -0,0 +1,61 @@
<?php
/**
* Subclass for performing query and update operations on the 'Employee' table.
*
*
*
* @package lib.model
*/
class EmployeePeer extends BaseEmployeePeer
{
/**
* Gets the staff members of the employees.
*
* @return staff employees
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
public static function getStaff()
{
$c = new Criteria();
$c->addJoin(self::POSITION, LuEmployeePositionPeer::ID);
$c->add(LuEmployeePositionPeer::POSITION, 'staff');
$c->add(self::ACTIVE, true);
$c->addAscendingOrderByColumn(self::SORT_ORDER);
$c->addAscendingOrderByColumn(self::NAME);
return self::doSelect($c);
}
/**
* Gets all the trainers of the employees.
*
* @return trainer employees
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
public static function getTrainers()
{
$c = new Criteria();
$c->addJoin(self::POSITION, LuEmployeePositionPeer::ID);
$c->add(LuEmployeePositionPeer::POSITION, 'trainer');
$c->add(self::ACTIVE, true);
$c->addAscendingOrderByColumn(self::SORT_ORDER);
$c->addAscendingOrderByColumn(self::NAME);
return self::doSelect($c);
}
/**
* Gets a employee by the slug
*
* @return the employee matching the slug
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
public static function getBySlug($slug)
{
$c = new Criteria();
$c->add(self::SLUG, $slug);
return self::doSelect($c);
}
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Subclass for representing a row from the 'Event' table.
*
*
*
* @package lib.model
*/
class Event extends BaseEvent
{
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Subclass for representing a row from the 'Event_i18n' table.
*
*
*
* @package lib.model
*/
class EventI18n extends BaseEventI18n
{
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Subclass for performing query and update operations on the 'Event_i18n' table.
*
*
*
* @package lib.model
*/
class EventI18nPeer extends BaseEventI18nPeer
{
}

View File

@@ -0,0 +1,27 @@
<?php
/**
* Subclass for performing query and update operations on the 'Event' table.
*
*
*
* @package lib.model
*/
class EventPeer extends BaseEventPeer
{
/**
* Gets events whose expiration date is
* still in the future
*
* @return void
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
public static function getActive()
{
$c = new Criteria();
$c->add(self::EXPIRES_ON, time(), Criteria::GREATER_THAN);
$c->addAscendingOrderByColumn(self::EXPIRES_ON);
return self::doSelect($c);
}
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Subclass for representing a row from the 'LU_Employee_Position' table.
*
*
*
* @package lib.model
*/
class LuEmployeePosition extends BaseLuEmployeePosition
{
}

View File

@@ -0,0 +1,26 @@
<?php
/**
* Subclass for performing query and update operations on the 'LU_Employee_Position' table.
*
*
*
* @package lib.model
*/
class LuEmployeePositionPeer extends BaseLuEmployeePositionPeer
{
/**
* Get the id of the lookup employee position by
* the position name
*
* @return void
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
public static function getIdByPosition($position)
{
$c = new Criteria();
$c->add(self::POSITION, $position);
return self::doSelectOne($c)->getId();
}
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Subclass for representing a row from the 'Reference' table.
*
*
*
* @package lib.model
*/
class Reference extends BaseReference
{
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Subclass for performing query and update operations on the 'Reference' table.
*
*
*
* @package lib.model
*/
class ReferencePeer extends BaseReferencePeer
{
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Subclass for representing a row from the 'Course' table.
*
*
*
* @package lib.model
*/
class Course extends BaseCourse
{
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Subclass for representing a row from the 'Course_i18n' table.
*
*
*
* @package lib.model
*/
class CourseI18n extends BaseCourseI18n
{
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Subclass for performing query and update operations on the 'Course_i18n' table.
*
*
*
* @package lib.model
*/
class CourseI18nPeer extends BaseCourseI18nPeer
{
}

View File

@@ -0,0 +1,25 @@
<?php
/**
* Subclass for performing query and update operations on the 'Course' table.
*
*
*
* @package lib.model
*/
class CoursePeer extends BaseCoursePeer
{
/**
* Gets a course by the slug
*
* @return the course matching the slug
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
public static function getBySlug($slug)
{
$c = new Criteria();
$c->add(self::SLUG, $slug);
return self::doSelect($c);
}
}

View File

@@ -0,0 +1,23 @@
<?php
/**
* Subclass for representing a row from the 'Employee' table.
*
*
*
* @package lib.model
*/
class Employee extends BaseEmployee
{
/**
* Gets the text of the position linked to
* in the LuEmployeePosition table
*
* @return position text
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
public function getPositionText()
{
return $this->getLuEmployeePosition()->getPosition();
}
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Subclass for representing a row from the 'Employee_i18n' table.
*
*
*
* @package lib.model
*/
class EmployeeI18n extends BaseEmployeeI18n
{
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Subclass for performing query and update operations on the 'Employee_i18n' table.
*
*
*
* @package lib.model
*/
class EmployeeI18nPeer extends BaseEmployeeI18nPeer
{
}

View File

@@ -0,0 +1,61 @@
<?php
/**
* Subclass for performing query and update operations on the 'Employee' table.
*
*
*
* @package lib.model
*/
class EmployeePeer extends BaseEmployeePeer
{
/**
* Gets the staff members of the employees.
*
* @return staff employees
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
public static function getStaff()
{
$c = new Criteria();
$c->addJoin(self::POSITION, LuEmployeePositionPeer::ID);
$c->add(LuEmployeePositionPeer::POSITION, 'staff');
$c->add(self::ACTIVE, true);
$c->addAscendingOrderByColumn(self::SORT_ORDER);
$c->addAscendingOrderByColumn(self::NAME);
return self::doSelect($c);
}
/**
* Gets all the trainers of the employees.
*
* @return trainer employees
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
public static function getTrainers()
{
$c = new Criteria();
$c->addJoin(self::POSITION, LuEmployeePositionPeer::ID);
$c->add(LuEmployeePositionPeer::POSITION, 'trainer');
$c->add(self::ACTIVE, true);
$c->addAscendingOrderByColumn(self::SORT_ORDER);
$c->addAscendingOrderByColumn(self::NAME);
return self::doSelect($c);
}
/**
* Gets a employee by the slug
*
* @return the employee matching the slug
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
public static function getBySlug($slug)
{
$c = new Criteria();
$c->add(self::SLUG, $slug);
return self::doSelect($c);
}
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Subclass for representing a row from the 'Event' table.
*
*
*
* @package lib.model
*/
class Event extends BaseEvent
{
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Subclass for representing a row from the 'Event_i18n' table.
*
*
*
* @package lib.model
*/
class EventI18n extends BaseEventI18n
{
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Subclass for performing query and update operations on the 'Event_i18n' table.
*
*
*
* @package lib.model
*/
class EventI18nPeer extends BaseEventI18nPeer
{
}

View File

@@ -0,0 +1,27 @@
<?php
/**
* Subclass for performing query and update operations on the 'Event' table.
*
*
*
* @package lib.model
*/
class EventPeer extends BaseEventPeer
{
/**
* Gets events whose expiration date is
* still in the future
*
* @return void
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
public static function getActive()
{
$c = new Criteria();
$c->add(self::EXPIRES_ON, time(), Criteria::GREATER_THAN);
$c->addAscendingOrderByColumn(self::EXPIRES_ON);
return self::doSelect($c);
}
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Subclass for representing a row from the 'LU_Employee_Position' table.
*
*
*
* @package lib.model
*/
class LuEmployeePosition extends BaseLuEmployeePosition
{
}

View File

@@ -0,0 +1,26 @@
<?php
/**
* Subclass for performing query and update operations on the 'LU_Employee_Position' table.
*
*
*
* @package lib.model
*/
class LuEmployeePositionPeer extends BaseLuEmployeePositionPeer
{
/**
* Get the id of the lookup employee position by
* the position name
*
* @return void
* @author Benjamin Ramey <ben.ramey@gmail.com>
**/
public static function getIdByPosition($position)
{
$c = new Criteria();
$c->add(self::POSITION, $position);
return self::doSelectOne($c)->getId();
}
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Subclass for representing a row from the 'Reference' table.
*
*
*
* @package lib.model
*/
class Reference extends BaseReference
{
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Subclass for performing query and update operations on the 'Reference' table.
*
*
*
* @package lib.model
*/
class ReferencePeer extends BaseReferencePeer
{
}

View File

@@ -0,0 +1,53 @@
K 25
svn:wc:ra_dav:version-url
V 63
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/map
END
LuEmployeePositionMapBuilder.php
K 25
svn:wc:ra_dav:version-url
V 96
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/map/LuEmployeePositionMapBuilder.php
END
ReferenceMapBuilder.php
K 25
svn:wc:ra_dav:version-url
V 87
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/map/ReferenceMapBuilder.php
END
EmployeeI18nMapBuilder.php
K 25
svn:wc:ra_dav:version-url
V 90
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/map/EmployeeI18nMapBuilder.php
END
EmployeeMapBuilder.php
K 25
svn:wc:ra_dav:version-url
V 86
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/map/EmployeeMapBuilder.php
END
CourseI18nMapBuilder.php
K 25
svn:wc:ra_dav:version-url
V 88
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/map/CourseI18nMapBuilder.php
END
CourseMapBuilder.php
K 25
svn:wc:ra_dav:version-url
V 84
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/map/CourseMapBuilder.php
END
EventI18nMapBuilder.php
K 25
svn:wc:ra_dav:version-url
V 87
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/map/EventI18nMapBuilder.php
END
EventMapBuilder.php
K 25
svn:wc:ra_dav:version-url
V 83
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/map/EventMapBuilder.php
END

View File

@@ -0,0 +1,300 @@
10
dir
55
http://barnabas/svn/pae.co.at/trunk/proactiveenglish/lib/model/map
http://barnabas/svn
2009-05-28T02:14:48.119086Z
25
ben
5f44b648-3ce2-dc11-a6be-00b0d029fcea
LuEmployeePositionMapBuilder.php
file
2010-07-31T05:41:53.000000Z
8d2da7c7080ad27f04812ee386cdaf38
2009-05-28T02:14:48.119086Z
25
ben
666
ReferenceMapBuilder.php
file
2010-07-31T05:41:53.000000Z
66c8de8ca5fafd77f1c957e99db528cf
2009-05-28T02:14:48.119086Z
25
ben
636
EmployeeI18nMapBuilder.php
file
2010-07-31T05:41:53.000000Z
db7cb6f47b35f1920dbc5672d61147bc
2009-05-28T02:14:48.119086Z
25
ben
848
EmployeeMapBuilder.php
file
2010-07-31T05:41:53.000000Z
c38b852a490cd95736a508e65785efb4
2009-05-28T02:14:48.119086Z
25
ben
1433
CourseI18nMapBuilder.php
file
2010-07-31T05:41:53.000000Z
b29e0f3e0da2e9a7a273ee062fb32542
2009-05-28T02:14:48.119086Z
25
ben
842
CourseMapBuilder.php
file
2010-07-31T05:41:53.000000Z
82809020391107efb5911eb751f9f5a7
2009-05-28T02:14:48.119086Z
25
ben
609
EventI18nMapBuilder.php
file
2010-07-31T05:41:53.000000Z
1958e735b6594d1e1436f1c4180dbbfc
2009-05-28T02:14:48.119086Z
25
ben
837
EventMapBuilder.php
file
2010-07-31T05:41:53.000000Z
6b62d5cb6c35929e542860a6cefd6dd4
2009-05-28T02:14:48.119086Z
25
ben
704

View File

@@ -0,0 +1,44 @@
<?php
class CourseI18nMapBuilder {
const CLASS_NAME = 'lib.model.map.CourseI18nMapBuilder';
private $dbMap;
public function isBuilt()
{
return ($this->dbMap !== null);
}
public function getDatabaseMap()
{
return $this->dbMap;
}
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('propel');
$tMap = $this->dbMap->addTable('Course_i18n');
$tMap->setPhpName('CourseI18n');
$tMap->setUseIdGenerator(false);
$tMap->addColumn('TITLE', 'Title', 'string', CreoleTypes::VARCHAR, false, 255);
$tMap->addColumn('DESCRIPTION', 'Description', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addForeignPrimaryKey('ID', 'Id', 'int' , CreoleTypes::INTEGER, 'Course', 'ID', true, null);
$tMap->addPrimaryKey('CULTURE', 'Culture', 'string', CreoleTypes::VARCHAR, true, 7);
}
}

View File

@@ -0,0 +1,40 @@
<?php
class CourseMapBuilder {
const CLASS_NAME = 'lib.model.map.CourseMapBuilder';
private $dbMap;
public function isBuilt()
{
return ($this->dbMap !== null);
}
public function getDatabaseMap()
{
return $this->dbMap;
}
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('propel');
$tMap = $this->dbMap->addTable('Course');
$tMap->setPhpName('Course');
$tMap->setUseIdGenerator(true);
$tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addColumn('SLUG', 'Slug', 'string', CreoleTypes::VARCHAR, false, 100);
}
}

View File

@@ -0,0 +1,44 @@
<?php
class EmployeeI18nMapBuilder {
const CLASS_NAME = 'lib.model.map.EmployeeI18nMapBuilder';
private $dbMap;
public function isBuilt()
{
return ($this->dbMap !== null);
}
public function getDatabaseMap()
{
return $this->dbMap;
}
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('propel');
$tMap = $this->dbMap->addTable('Employee_i18n');
$tMap->setPhpName('EmployeeI18n');
$tMap->setUseIdGenerator(false);
$tMap->addColumn('BIOGRAPHY', 'Biography', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('TITLE', 'Title', 'string', CreoleTypes::VARCHAR, false, 100);
$tMap->addForeignPrimaryKey('ID', 'Id', 'int' , CreoleTypes::INTEGER, 'Employee', 'ID', true, null);
$tMap->addPrimaryKey('CULTURE', 'Culture', 'string', CreoleTypes::VARCHAR, true, 7);
}
}

View File

@@ -0,0 +1,58 @@
<?php
class EmployeeMapBuilder {
const CLASS_NAME = 'lib.model.map.EmployeeMapBuilder';
private $dbMap;
public function isBuilt()
{
return ($this->dbMap !== null);
}
public function getDatabaseMap()
{
return $this->dbMap;
}
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('propel');
$tMap = $this->dbMap->addTable('Employee');
$tMap->setPhpName('Employee');
$tMap->setUseIdGenerator(true);
$tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addColumn('NAME', 'Name', 'string', CreoleTypes::VARCHAR, false, 100);
$tMap->addColumn('DEGREES', 'Degrees', 'string', CreoleTypes::VARCHAR, false, 255);
$tMap->addColumn('PHONE', 'Phone', 'string', CreoleTypes::VARCHAR, false, 25);
$tMap->addColumn('CELLPHONE', 'Cellphone', 'string', CreoleTypes::VARCHAR, false, 25);
$tMap->addColumn('EMAIL', 'Email', 'string', CreoleTypes::VARCHAR, false, 100);
$tMap->addColumn('PICTURE', 'Picture', 'string', CreoleTypes::VARCHAR, false, 100);
$tMap->addColumn('ACTIVE', 'Active', 'boolean', CreoleTypes::BOOLEAN, false, null);
$tMap->addForeignKey('POSITION', 'Position', 'int', CreoleTypes::INTEGER, 'LU_Employee_Position', 'ID', false, null);
$tMap->addColumn('SLUG', 'Slug', 'string', CreoleTypes::VARCHAR, false, 100);
$tMap->addColumn('SORT_ORDER', 'SortOrder', 'int', CreoleTypes::INTEGER, false, null);
}
}

View File

@@ -0,0 +1,44 @@
<?php
class EventI18nMapBuilder {
const CLASS_NAME = 'lib.model.map.EventI18nMapBuilder';
private $dbMap;
public function isBuilt()
{
return ($this->dbMap !== null);
}
public function getDatabaseMap()
{
return $this->dbMap;
}
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('propel');
$tMap = $this->dbMap->addTable('Event_i18n');
$tMap->setPhpName('EventI18n');
$tMap->setUseIdGenerator(false);
$tMap->addColumn('TITLE', 'Title', 'string', CreoleTypes::VARCHAR, false, 255);
$tMap->addColumn('DESCRIPTION', 'Description', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addForeignPrimaryKey('ID', 'Id', 'int' , CreoleTypes::INTEGER, 'Event', 'ID', true, null);
$tMap->addPrimaryKey('CULTURE', 'Culture', 'string', CreoleTypes::VARCHAR, true, 7);
}
}

View File

@@ -0,0 +1,42 @@
<?php
class EventMapBuilder {
const CLASS_NAME = 'lib.model.map.EventMapBuilder';
private $dbMap;
public function isBuilt()
{
return ($this->dbMap !== null);
}
public function getDatabaseMap()
{
return $this->dbMap;
}
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('propel');
$tMap = $this->dbMap->addTable('Event');
$tMap->setPhpName('Event');
$tMap->setUseIdGenerator(true);
$tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addColumn('PICTURE', 'Picture', 'string', CreoleTypes::VARCHAR, false, 255);
$tMap->addColumn('EXPIRES_ON', 'ExpiresOn', 'int', CreoleTypes::TIMESTAMP, false, null);
}
}

View File

@@ -0,0 +1,40 @@
<?php
class LuEmployeePositionMapBuilder {
const CLASS_NAME = 'lib.model.map.LuEmployeePositionMapBuilder';
private $dbMap;
public function isBuilt()
{
return ($this->dbMap !== null);
}
public function getDatabaseMap()
{
return $this->dbMap;
}
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('propel');
$tMap = $this->dbMap->addTable('LU_Employee_Position');
$tMap->setPhpName('LuEmployeePosition');
$tMap->setUseIdGenerator(true);
$tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addColumn('POSITION', 'Position', 'string', CreoleTypes::VARCHAR, false, 25);
}
}

View File

@@ -0,0 +1,40 @@
<?php
class ReferenceMapBuilder {
const CLASS_NAME = 'lib.model.map.ReferenceMapBuilder';
private $dbMap;
public function isBuilt()
{
return ($this->dbMap !== null);
}
public function getDatabaseMap()
{
return $this->dbMap;
}
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('propel');
$tMap = $this->dbMap->addTable('Reference');
$tMap->setPhpName('Reference');
$tMap->setUseIdGenerator(true);
$tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addColumn('COMPANY_NAME', 'CompanyName', 'string', CreoleTypes::VARCHAR, false, 255);
}
}

View File

@@ -0,0 +1,44 @@
<?php
class CourseI18nMapBuilder {
const CLASS_NAME = 'lib.model.map.CourseI18nMapBuilder';
private $dbMap;
public function isBuilt()
{
return ($this->dbMap !== null);
}
public function getDatabaseMap()
{
return $this->dbMap;
}
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('propel');
$tMap = $this->dbMap->addTable('Course_i18n');
$tMap->setPhpName('CourseI18n');
$tMap->setUseIdGenerator(false);
$tMap->addColumn('TITLE', 'Title', 'string', CreoleTypes::VARCHAR, false, 255);
$tMap->addColumn('DESCRIPTION', 'Description', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addForeignPrimaryKey('ID', 'Id', 'int' , CreoleTypes::INTEGER, 'Course', 'ID', true, null);
$tMap->addPrimaryKey('CULTURE', 'Culture', 'string', CreoleTypes::VARCHAR, true, 7);
}
}

View File

@@ -0,0 +1,40 @@
<?php
class CourseMapBuilder {
const CLASS_NAME = 'lib.model.map.CourseMapBuilder';
private $dbMap;
public function isBuilt()
{
return ($this->dbMap !== null);
}
public function getDatabaseMap()
{
return $this->dbMap;
}
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('propel');
$tMap = $this->dbMap->addTable('Course');
$tMap->setPhpName('Course');
$tMap->setUseIdGenerator(true);
$tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addColumn('SLUG', 'Slug', 'string', CreoleTypes::VARCHAR, false, 100);
}
}

View File

@@ -0,0 +1,44 @@
<?php
class EmployeeI18nMapBuilder {
const CLASS_NAME = 'lib.model.map.EmployeeI18nMapBuilder';
private $dbMap;
public function isBuilt()
{
return ($this->dbMap !== null);
}
public function getDatabaseMap()
{
return $this->dbMap;
}
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('propel');
$tMap = $this->dbMap->addTable('Employee_i18n');
$tMap->setPhpName('EmployeeI18n');
$tMap->setUseIdGenerator(false);
$tMap->addColumn('BIOGRAPHY', 'Biography', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('TITLE', 'Title', 'string', CreoleTypes::VARCHAR, false, 100);
$tMap->addForeignPrimaryKey('ID', 'Id', 'int' , CreoleTypes::INTEGER, 'Employee', 'ID', true, null);
$tMap->addPrimaryKey('CULTURE', 'Culture', 'string', CreoleTypes::VARCHAR, true, 7);
}
}

View File

@@ -0,0 +1,58 @@
<?php
class EmployeeMapBuilder {
const CLASS_NAME = 'lib.model.map.EmployeeMapBuilder';
private $dbMap;
public function isBuilt()
{
return ($this->dbMap !== null);
}
public function getDatabaseMap()
{
return $this->dbMap;
}
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('propel');
$tMap = $this->dbMap->addTable('Employee');
$tMap->setPhpName('Employee');
$tMap->setUseIdGenerator(true);
$tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addColumn('NAME', 'Name', 'string', CreoleTypes::VARCHAR, false, 100);
$tMap->addColumn('DEGREES', 'Degrees', 'string', CreoleTypes::VARCHAR, false, 255);
$tMap->addColumn('PHONE', 'Phone', 'string', CreoleTypes::VARCHAR, false, 25);
$tMap->addColumn('CELLPHONE', 'Cellphone', 'string', CreoleTypes::VARCHAR, false, 25);
$tMap->addColumn('EMAIL', 'Email', 'string', CreoleTypes::VARCHAR, false, 100);
$tMap->addColumn('PICTURE', 'Picture', 'string', CreoleTypes::VARCHAR, false, 100);
$tMap->addColumn('ACTIVE', 'Active', 'boolean', CreoleTypes::BOOLEAN, false, null);
$tMap->addForeignKey('POSITION', 'Position', 'int', CreoleTypes::INTEGER, 'LU_Employee_Position', 'ID', false, null);
$tMap->addColumn('SLUG', 'Slug', 'string', CreoleTypes::VARCHAR, false, 100);
$tMap->addColumn('SORT_ORDER', 'SortOrder', 'int', CreoleTypes::INTEGER, false, null);
}
}

View File

@@ -0,0 +1,44 @@
<?php
class EventI18nMapBuilder {
const CLASS_NAME = 'lib.model.map.EventI18nMapBuilder';
private $dbMap;
public function isBuilt()
{
return ($this->dbMap !== null);
}
public function getDatabaseMap()
{
return $this->dbMap;
}
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('propel');
$tMap = $this->dbMap->addTable('Event_i18n');
$tMap->setPhpName('EventI18n');
$tMap->setUseIdGenerator(false);
$tMap->addColumn('TITLE', 'Title', 'string', CreoleTypes::VARCHAR, false, 255);
$tMap->addColumn('DESCRIPTION', 'Description', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addForeignPrimaryKey('ID', 'Id', 'int' , CreoleTypes::INTEGER, 'Event', 'ID', true, null);
$tMap->addPrimaryKey('CULTURE', 'Culture', 'string', CreoleTypes::VARCHAR, true, 7);
}
}

View File

@@ -0,0 +1,42 @@
<?php
class EventMapBuilder {
const CLASS_NAME = 'lib.model.map.EventMapBuilder';
private $dbMap;
public function isBuilt()
{
return ($this->dbMap !== null);
}
public function getDatabaseMap()
{
return $this->dbMap;
}
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('propel');
$tMap = $this->dbMap->addTable('Event');
$tMap->setPhpName('Event');
$tMap->setUseIdGenerator(true);
$tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addColumn('PICTURE', 'Picture', 'string', CreoleTypes::VARCHAR, false, 255);
$tMap->addColumn('EXPIRES_ON', 'ExpiresOn', 'int', CreoleTypes::TIMESTAMP, false, null);
}
}

View File

@@ -0,0 +1,40 @@
<?php
class LuEmployeePositionMapBuilder {
const CLASS_NAME = 'lib.model.map.LuEmployeePositionMapBuilder';
private $dbMap;
public function isBuilt()
{
return ($this->dbMap !== null);
}
public function getDatabaseMap()
{
return $this->dbMap;
}
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('propel');
$tMap = $this->dbMap->addTable('LU_Employee_Position');
$tMap->setPhpName('LuEmployeePosition');
$tMap->setUseIdGenerator(true);
$tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addColumn('POSITION', 'Position', 'string', CreoleTypes::VARCHAR, false, 25);
}
}

View File

@@ -0,0 +1,40 @@
<?php
class ReferenceMapBuilder {
const CLASS_NAME = 'lib.model.map.ReferenceMapBuilder';
private $dbMap;
public function isBuilt()
{
return ($this->dbMap !== null);
}
public function getDatabaseMap()
{
return $this->dbMap;
}
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('propel');
$tMap = $this->dbMap->addTable('Reference');
$tMap->setPhpName('Reference');
$tMap->setUseIdGenerator(true);
$tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addColumn('COMPANY_NAME', 'CompanyName', 'string', CreoleTypes::VARCHAR, false, 255);
}
}

View File

@@ -0,0 +1,101 @@
K 25
svn:wc:ra_dav:version-url
V 62
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/om
END
BaseReference.php
K 25
svn:wc:ra_dav:version-url
V 80
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/om/BaseReference.php
END
BaseCourse.php
K 25
svn:wc:ra_dav:version-url
V 77
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/om/BaseCourse.php
END
BaseCourseI18n.php
K 25
svn:wc:ra_dav:version-url
V 81
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/om/BaseCourseI18n.php
END
BaseLuEmployeePosition.php
K 25
svn:wc:ra_dav:version-url
V 89
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/om/BaseLuEmployeePosition.php
END
BaseReferencePeer.php
K 25
svn:wc:ra_dav:version-url
V 84
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/om/BaseReferencePeer.php
END
BaseCourseI18nPeer.php
K 25
svn:wc:ra_dav:version-url
V 85
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/om/BaseCourseI18nPeer.php
END
BaseCoursePeer.php
K 25
svn:wc:ra_dav:version-url
V 81
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/om/BaseCoursePeer.php
END
BaseEmployee.php
K 25
svn:wc:ra_dav:version-url
V 79
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/om/BaseEmployee.php
END
BaseEmployeeI18n.php
K 25
svn:wc:ra_dav:version-url
V 83
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/om/BaseEmployeeI18n.php
END
BaseEvent.php
K 25
svn:wc:ra_dav:version-url
V 76
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/om/BaseEvent.php
END
BaseEventI18n.php
K 25
svn:wc:ra_dav:version-url
V 80
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/om/BaseEventI18n.php
END
BaseLuEmployeePositionPeer.php
K 25
svn:wc:ra_dav:version-url
V 93
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/om/BaseLuEmployeePositionPeer.php
END
BaseEmployeeI18nPeer.php
K 25
svn:wc:ra_dav:version-url
V 87
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/om/BaseEmployeeI18nPeer.php
END
BaseEmployeePeer.php
K 25
svn:wc:ra_dav:version-url
V 83
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/om/BaseEmployeePeer.php
END
BaseEventI18nPeer.php
K 25
svn:wc:ra_dav:version-url
V 84
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/om/BaseEventI18nPeer.php
END
BaseEventPeer.php
K 25
svn:wc:ra_dav:version-url
V 80
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/model/om/BaseEventPeer.php
END

View File

@@ -0,0 +1,572 @@
10
dir
55
http://barnabas/svn/pae.co.at/trunk/proactiveenglish/lib/model/om
http://barnabas/svn
2009-05-28T02:14:48.119086Z
25
ben
5f44b648-3ce2-dc11-a6be-00b0d029fcea
BaseReference.php
file
2010-07-31T05:41:53.000000Z
55fbf3e11633d21b25d05f64c009aab4
2009-05-28T02:14:48.119086Z
25
ben
5774
BaseCourse.php
file
2010-07-31T05:41:53.000000Z
32d63e88a683e6d8ddb1e80524f784c9
2009-05-28T02:14:48.119086Z
25
ben
9266
BaseCourseI18n.php
file
2010-07-31T05:41:53.000000Z
55e525a1c092dc217b12fe7f069c7ed5
2009-05-28T02:14:48.119086Z
25
ben
8354
BaseLuEmployeePosition.php
file
2010-07-31T05:41:53.000000Z
e70c20575d91e2d9d33c2489e15280a5
2009-05-28T02:14:48.119086Z
25
ben
8223
BaseReferencePeer.php
file
2010-07-31T05:41:53.000000Z
420accf6af267c38e736e2cdcdbe589b
2009-05-28T02:14:48.119086Z
25
ben
8894
BaseCourseI18nPeer.php
file
2010-07-31T05:41:53.000000Z
66175b96b8b9f2aa6bcdbcab184baca3
2009-05-28T02:14:48.119086Z
25
ben
13260
BaseCoursePeer.php
file
2010-07-31T05:41:53.000000Z
cce813d2240c3afd3e623fcddbca48bb
2009-05-28T02:14:48.119086Z
25
ben
10377
BaseEmployee.php
file
2010-07-31T05:41:53.000000Z
6ebafb844b373adfd1fecd7b747d5388
2009-05-28T02:14:48.119086Z
25
ben
17152
BaseEmployeeI18n.php
file
2010-07-31T05:41:53.000000Z
ce89a65d78b634ca2a2f14cfd4881dd6
2009-05-28T02:14:48.119086Z
25
ben
8422
BaseEvent.php
file
2010-07-31T05:41:53.000000Z
fec16ee2f6230b4ee745d2a113dc216f
2009-05-28T02:14:48.119086Z
25
ben
10752
BaseEventI18n.php
file
2010-07-31T05:41:53.000000Z
6e7bd7696bd9ba6b3114016d6212590e
2009-05-28T02:14:48.119086Z
25
ben
8303
BaseLuEmployeePositionPeer.php
file
2010-07-31T05:41:53.000000Z
bb861a20615c7f6291bac7922242aa3b
2009-05-28T02:14:48.119086Z
25
ben
9302
BaseEmployeeI18nPeer.php
file
2010-07-31T05:41:53.000000Z
3edb553f17ba50ca8694be8b2f48b98d
2009-05-28T02:14:48.119086Z
25
ben
13430
BaseEmployeePeer.php
file
2010-07-31T05:41:53.000000Z
1471c891b0b5c9eae3fcae5860631d64
2009-05-28T02:14:48.119086Z
25
ben
16312
BaseEventPeer.php
file
2010-07-31T05:41:53.000000Z
2ae8614cb2abcb1fd1d9f3592156a9ae
2009-05-28T02:14:48.119086Z
25
ben
10557
BaseEventI18nPeer.php
file
2010-07-31T05:41:53.000000Z
66cc6ac53b74920c8578978ea911b81c
2009-05-28T02:14:48.119086Z
25
ben
13166

View File

@@ -0,0 +1,488 @@
<?php
abstract class BaseCourse extends BaseObject implements Persistent {
protected static $peer;
protected $id;
protected $slug;
protected $collCourseI18ns;
protected $lastCourseI18nCriteria = null;
protected $alreadyInSave = false;
protected $alreadyInValidation = false;
protected $culture;
public function getId()
{
return $this->id;
}
public function getSlug()
{
return $this->slug;
}
public function setId($v)
{
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = CoursePeer::ID;
}
}
public function setSlug($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->slug !== $v) {
$this->slug = $v;
$this->modifiedColumns[] = CoursePeer::SLUG;
}
}
public function hydrate(ResultSet $rs, $startcol = 1)
{
try {
$this->id = $rs->getInt($startcol + 0);
$this->slug = $rs->getString($startcol + 1);
$this->resetModified();
$this->setNew(false);
return $startcol + 2;
} catch (Exception $e) {
throw new PropelException("Error populating Course object", $e);
}
}
public function delete($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(CoursePeer::DATABASE_NAME);
}
try {
$con->begin();
CoursePeer::doDelete($this, $con);
$this->setDeleted(true);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public function save($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("You cannot save an object that has been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(CoursePeer::DATABASE_NAME);
}
try {
$con->begin();
$affectedRows = $this->doSave($con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
protected function doSave($con)
{
$affectedRows = 0; if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
if ($this->isModified()) {
if ($this->isNew()) {
$pk = CoursePeer::doInsert($this, $con);
$affectedRows += 1;
$this->setId($pk);
$this->setNew(false);
} else {
$affectedRows += CoursePeer::doUpdate($this, $con);
}
$this->resetModified(); }
if ($this->collCourseI18ns !== null) {
foreach($this->collCourseI18ns as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
}
$this->alreadyInSave = false;
}
return $affectedRows;
}
protected $validationFailures = array();
public function getValidationFailures()
{
return $this->validationFailures;
}
public function validate($columns = null)
{
$res = $this->doValidate($columns);
if ($res === true) {
$this->validationFailures = array();
return true;
} else {
$this->validationFailures = $res;
return false;
}
}
protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
if (($retval = CoursePeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
if ($this->collCourseI18ns !== null) {
foreach($this->collCourseI18ns as $referrerFK) {
if (!$referrerFK->validate($columns)) {
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
}
}
}
$this->alreadyInValidation = false;
}
return (!empty($failureMap) ? $failureMap : true);
}
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = CoursePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->getByPosition($pos);
}
public function getByPosition($pos)
{
switch($pos) {
case 0:
return $this->getId();
break;
case 1:
return $this->getSlug();
break;
default:
return null;
break;
} }
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
{
$keys = CoursePeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getSlug(),
);
return $result;
}
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = CoursePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
public function setByPosition($pos, $value)
{
switch($pos) {
case 0:
$this->setId($value);
break;
case 1:
$this->setSlug($value);
break;
} }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = CoursePeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setSlug($arr[$keys[1]]);
}
public function buildCriteria()
{
$criteria = new Criteria(CoursePeer::DATABASE_NAME);
if ($this->isColumnModified(CoursePeer::ID)) $criteria->add(CoursePeer::ID, $this->id);
if ($this->isColumnModified(CoursePeer::SLUG)) $criteria->add(CoursePeer::SLUG, $this->slug);
return $criteria;
}
public function buildPkeyCriteria()
{
$criteria = new Criteria(CoursePeer::DATABASE_NAME);
$criteria->add(CoursePeer::ID, $this->id);
return $criteria;
}
public function getPrimaryKey()
{
return $this->getId();
}
public function setPrimaryKey($key)
{
$this->setId($key);
}
public function copyInto($copyObj, $deepCopy = false)
{
$copyObj->setSlug($this->slug);
if ($deepCopy) {
$copyObj->setNew(false);
foreach($this->getCourseI18ns() as $relObj) {
$copyObj->addCourseI18n($relObj->copy($deepCopy));
}
}
$copyObj->setNew(true);
$copyObj->setId(NULL);
}
public function copy($deepCopy = false)
{
$clazz = get_class($this);
$copyObj = new $clazz();
$this->copyInto($copyObj, $deepCopy);
return $copyObj;
}
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new CoursePeer();
}
return self::$peer;
}
public function initCourseI18ns()
{
if ($this->collCourseI18ns === null) {
$this->collCourseI18ns = array();
}
}
public function getCourseI18ns($criteria = null, $con = null)
{
include_once 'lib/model/om/BaseCourseI18nPeer.php';
if ($criteria === null) {
$criteria = new Criteria();
}
elseif ($criteria instanceof Criteria)
{
$criteria = clone $criteria;
}
if ($this->collCourseI18ns === null) {
if ($this->isNew()) {
$this->collCourseI18ns = array();
} else {
$criteria->add(CourseI18nPeer::ID, $this->getId());
CourseI18nPeer::addSelectColumns($criteria);
$this->collCourseI18ns = CourseI18nPeer::doSelect($criteria, $con);
}
} else {
if (!$this->isNew()) {
$criteria->add(CourseI18nPeer::ID, $this->getId());
CourseI18nPeer::addSelectColumns($criteria);
if (!isset($this->lastCourseI18nCriteria) || !$this->lastCourseI18nCriteria->equals($criteria)) {
$this->collCourseI18ns = CourseI18nPeer::doSelect($criteria, $con);
}
}
}
$this->lastCourseI18nCriteria = $criteria;
return $this->collCourseI18ns;
}
public function countCourseI18ns($criteria = null, $distinct = false, $con = null)
{
include_once 'lib/model/om/BaseCourseI18nPeer.php';
if ($criteria === null) {
$criteria = new Criteria();
}
elseif ($criteria instanceof Criteria)
{
$criteria = clone $criteria;
}
$criteria->add(CourseI18nPeer::ID, $this->getId());
return CourseI18nPeer::doCount($criteria, $distinct, $con);
}
public function addCourseI18n(CourseI18n $l)
{
$this->collCourseI18ns[] = $l;
$l->setCourse($this);
}
public function getCulture()
{
return $this->culture;
}
public function setCulture($culture)
{
$this->culture = $culture;
}
public function getTitle()
{
$obj = $this->getCurrentCourseI18n();
return ($obj ? $obj->getTitle() : null);
}
public function setTitle($value)
{
$this->getCurrentCourseI18n()->setTitle($value);
}
public function getDescription()
{
$obj = $this->getCurrentCourseI18n();
return ($obj ? $obj->getDescription() : null);
}
public function setDescription($value)
{
$this->getCurrentCourseI18n()->setDescription($value);
}
protected $current_i18n = array();
public function getCurrentCourseI18n()
{
if (!isset($this->current_i18n[$this->culture]))
{
$obj = CourseI18nPeer::retrieveByPK($this->getId(), $this->culture);
if ($obj)
{
$this->setCourseI18nForCulture($obj, $this->culture);
}
else
{
$this->setCourseI18nForCulture(new CourseI18n(), $this->culture);
$this->current_i18n[$this->culture]->setCulture($this->culture);
}
}
return $this->current_i18n[$this->culture];
}
public function setCourseI18nForCulture($object, $culture)
{
$this->current_i18n[$culture] = $object;
$this->addCourseI18n($object);
}
}

View File

@@ -0,0 +1,465 @@
<?php
abstract class BaseCourseI18n extends BaseObject implements Persistent {
protected static $peer;
protected $title;
protected $description;
protected $id;
protected $culture;
protected $aCourse;
protected $alreadyInSave = false;
protected $alreadyInValidation = false;
public function getTitle()
{
return $this->title;
}
public function getDescription()
{
return $this->description;
}
public function getId()
{
return $this->id;
}
public function getCulture()
{
return $this->culture;
}
public function setTitle($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->title !== $v) {
$this->title = $v;
$this->modifiedColumns[] = CourseI18nPeer::TITLE;
}
}
public function setDescription($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->description !== $v) {
$this->description = $v;
$this->modifiedColumns[] = CourseI18nPeer::DESCRIPTION;
}
}
public function setId($v)
{
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = CourseI18nPeer::ID;
}
if ($this->aCourse !== null && $this->aCourse->getId() !== $v) {
$this->aCourse = null;
}
}
public function setCulture($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->culture !== $v) {
$this->culture = $v;
$this->modifiedColumns[] = CourseI18nPeer::CULTURE;
}
}
public function hydrate(ResultSet $rs, $startcol = 1)
{
try {
$this->title = $rs->getString($startcol + 0);
$this->description = $rs->getString($startcol + 1);
$this->id = $rs->getInt($startcol + 2);
$this->culture = $rs->getString($startcol + 3);
$this->resetModified();
$this->setNew(false);
return $startcol + 4;
} catch (Exception $e) {
throw new PropelException("Error populating CourseI18n object", $e);
}
}
public function delete($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(CourseI18nPeer::DATABASE_NAME);
}
try {
$con->begin();
CourseI18nPeer::doDelete($this, $con);
$this->setDeleted(true);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public function save($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("You cannot save an object that has been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(CourseI18nPeer::DATABASE_NAME);
}
try {
$con->begin();
$affectedRows = $this->doSave($con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
protected function doSave($con)
{
$affectedRows = 0; if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
if ($this->aCourse !== null) {
if ($this->aCourse->isModified() || $this->aCourse->getCurrentCourseI18n()->isModified()) {
$affectedRows += $this->aCourse->save($con);
}
$this->setCourse($this->aCourse);
}
if ($this->isModified()) {
if ($this->isNew()) {
$pk = CourseI18nPeer::doInsert($this, $con);
$affectedRows += 1;
$this->setNew(false);
} else {
$affectedRows += CourseI18nPeer::doUpdate($this, $con);
}
$this->resetModified(); }
$this->alreadyInSave = false;
}
return $affectedRows;
}
protected $validationFailures = array();
public function getValidationFailures()
{
return $this->validationFailures;
}
public function validate($columns = null)
{
$res = $this->doValidate($columns);
if ($res === true) {
$this->validationFailures = array();
return true;
} else {
$this->validationFailures = $res;
return false;
}
}
protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
if ($this->aCourse !== null) {
if (!$this->aCourse->validate($columns)) {
$failureMap = array_merge($failureMap, $this->aCourse->getValidationFailures());
}
}
if (($retval = CourseI18nPeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
$this->alreadyInValidation = false;
}
return (!empty($failureMap) ? $failureMap : true);
}
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = CourseI18nPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->getByPosition($pos);
}
public function getByPosition($pos)
{
switch($pos) {
case 0:
return $this->getTitle();
break;
case 1:
return $this->getDescription();
break;
case 2:
return $this->getId();
break;
case 3:
return $this->getCulture();
break;
default:
return null;
break;
} }
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
{
$keys = CourseI18nPeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getTitle(),
$keys[1] => $this->getDescription(),
$keys[2] => $this->getId(),
$keys[3] => $this->getCulture(),
);
return $result;
}
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = CourseI18nPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
public function setByPosition($pos, $value)
{
switch($pos) {
case 0:
$this->setTitle($value);
break;
case 1:
$this->setDescription($value);
break;
case 2:
$this->setId($value);
break;
case 3:
$this->setCulture($value);
break;
} }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = CourseI18nPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setTitle($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setDescription($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setId($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setCulture($arr[$keys[3]]);
}
public function buildCriteria()
{
$criteria = new Criteria(CourseI18nPeer::DATABASE_NAME);
if ($this->isColumnModified(CourseI18nPeer::TITLE)) $criteria->add(CourseI18nPeer::TITLE, $this->title);
if ($this->isColumnModified(CourseI18nPeer::DESCRIPTION)) $criteria->add(CourseI18nPeer::DESCRIPTION, $this->description);
if ($this->isColumnModified(CourseI18nPeer::ID)) $criteria->add(CourseI18nPeer::ID, $this->id);
if ($this->isColumnModified(CourseI18nPeer::CULTURE)) $criteria->add(CourseI18nPeer::CULTURE, $this->culture);
return $criteria;
}
public function buildPkeyCriteria()
{
$criteria = new Criteria(CourseI18nPeer::DATABASE_NAME);
$criteria->add(CourseI18nPeer::ID, $this->id);
$criteria->add(CourseI18nPeer::CULTURE, $this->culture);
return $criteria;
}
public function getPrimaryKey()
{
$pks = array();
$pks[0] = $this->getId();
$pks[1] = $this->getCulture();
return $pks;
}
public function setPrimaryKey($keys)
{
$this->setId($keys[0]);
$this->setCulture($keys[1]);
}
public function copyInto($copyObj, $deepCopy = false)
{
$copyObj->setTitle($this->title);
$copyObj->setDescription($this->description);
$copyObj->setNew(true);
$copyObj->setId(NULL);
$copyObj->setCulture(NULL);
}
public function copy($deepCopy = false)
{
$clazz = get_class($this);
$copyObj = new $clazz();
$this->copyInto($copyObj, $deepCopy);
return $copyObj;
}
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new CourseI18nPeer();
}
return self::$peer;
}
public function setCourse($v)
{
if ($v === null) {
$this->setId(NULL);
} else {
$this->setId($v->getId());
}
$this->aCourse = $v;
}
public function getCourse($con = null)
{
if ($this->aCourse === null && ($this->id !== null)) {
include_once 'lib/model/om/BaseCoursePeer.php';
$this->aCourse = CoursePeer::retrieveByPK($this->id, $con);
}
return $this->aCourse;
}
}

View File

@@ -0,0 +1,531 @@
<?php
abstract class BaseCourseI18nPeer {
const DATABASE_NAME = 'propel';
const TABLE_NAME = 'Course_i18n';
const CLASS_DEFAULT = 'lib.model.CourseI18n';
const NUM_COLUMNS = 4;
const NUM_LAZY_LOAD_COLUMNS = 0;
const TITLE = 'Course_i18n.TITLE';
const DESCRIPTION = 'Course_i18n.DESCRIPTION';
const ID = 'Course_i18n.ID';
const CULTURE = 'Course_i18n.CULTURE';
private static $phpNameMap = null;
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Title', 'Description', 'Id', 'Culture', ),
BasePeer::TYPE_COLNAME => array (CourseI18nPeer::TITLE, CourseI18nPeer::DESCRIPTION, CourseI18nPeer::ID, CourseI18nPeer::CULTURE, ),
BasePeer::TYPE_FIELDNAME => array ('title', 'description', 'id', 'culture', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Title' => 0, 'Description' => 1, 'Id' => 2, 'Culture' => 3, ),
BasePeer::TYPE_COLNAME => array (CourseI18nPeer::TITLE => 0, CourseI18nPeer::DESCRIPTION => 1, CourseI18nPeer::ID => 2, CourseI18nPeer::CULTURE => 3, ),
BasePeer::TYPE_FIELDNAME => array ('title' => 0, 'description' => 1, 'id' => 2, 'culture' => 3, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
public static function getMapBuilder()
{
include_once 'lib/model/map/CourseI18nMapBuilder.php';
return BasePeer::getMapBuilder('lib.model.map.CourseI18nMapBuilder');
}
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = CourseI18nPeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
public static function alias($alias, $column)
{
return str_replace(CourseI18nPeer::TABLE_NAME.'.', $alias.'.', $column);
}
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(CourseI18nPeer::TITLE);
$criteria->addSelectColumn(CourseI18nPeer::DESCRIPTION);
$criteria->addSelectColumn(CourseI18nPeer::ID);
$criteria->addSelectColumn(CourseI18nPeer::CULTURE);
}
const COUNT = 'COUNT(Course_i18n.ID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT Course_i18n.ID)';
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(CourseI18nPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(CourseI18nPeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$rs = CourseI18nPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = CourseI18nPeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
public static function doSelect(Criteria $criteria, $con = null)
{
return CourseI18nPeer::populateObjects(CourseI18nPeer::doSelectRS($criteria, $con));
}
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
CourseI18nPeer::addSelectColumns($criteria);
}
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doSelect($criteria, $con);
}
public static function populateObjects(ResultSet $rs)
{
$results = array();
$cls = CourseI18nPeer::getOMClass();
$cls = Propel::import($cls);
while($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
public static function doCountJoinCourse(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(CourseI18nPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(CourseI18nPeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(CourseI18nPeer::ID, CoursePeer::ID);
$rs = CourseI18nPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectJoinCourse(Criteria $c, $con = null)
{
$c = clone $c;
if ($c->getDbName() == Propel::getDefaultDB()) {
$c->setDbName(self::DATABASE_NAME);
}
CourseI18nPeer::addSelectColumns($c);
$startcol = (CourseI18nPeer::NUM_COLUMNS - CourseI18nPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
CoursePeer::addSelectColumns($c);
$c->addJoin(CourseI18nPeer::ID, CoursePeer::ID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = CourseI18nPeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$omClass = CoursePeer::getOMClass();
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol);
$newObject = true;
foreach($results as $temp_obj1) {
$temp_obj2 = $temp_obj1->getCourse(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
$temp_obj2->addCourseI18n($obj1); break;
}
}
if ($newObject) {
$obj2->initCourseI18ns();
$obj2->addCourseI18n($obj1); }
$results[] = $obj1;
}
return $results;
}
public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(CourseI18nPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(CourseI18nPeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(CourseI18nPeer::ID, CoursePeer::ID);
$rs = CourseI18nPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectJoinAll(Criteria $c, $con = null)
{
$c = clone $c;
if ($c->getDbName() == Propel::getDefaultDB()) {
$c->setDbName(self::DATABASE_NAME);
}
CourseI18nPeer::addSelectColumns($c);
$startcol2 = (CourseI18nPeer::NUM_COLUMNS - CourseI18nPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
CoursePeer::addSelectColumns($c);
$startcol3 = $startcol2 + CoursePeer::NUM_COLUMNS;
$c->addJoin(CourseI18nPeer::ID, CoursePeer::ID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = CourseI18nPeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$omClass = CoursePeer::getOMClass();
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol2);
$newObject = true;
for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
$temp_obj1 = $results[$j];
$temp_obj2 = $temp_obj1->getCourse(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
$temp_obj2->addCourseI18n($obj1); break;
}
}
if ($newObject) {
$obj2->initCourseI18ns();
$obj2->addCourseI18n($obj1);
}
$results[] = $obj1;
}
return $results;
}
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
public static function getOMClass()
{
return CourseI18nPeer::CLASS_DEFAULT;
}
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } else {
$criteria = $values->buildCriteria(); }
$criteria->setDbName(self::DATABASE_NAME);
try {
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch(PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values;
$comparison = $criteria->getComparison(CourseI18nPeer::ID);
$selectCriteria->add(CourseI18nPeer::ID, $criteria->remove(CourseI18nPeer::ID), $comparison);
$comparison = $criteria->getComparison(CourseI18nPeer::CULTURE);
$selectCriteria->add(CourseI18nPeer::CULTURE, $criteria->remove(CourseI18nPeer::CULTURE), $comparison);
} else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); }
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; try {
$con->begin();
$affectedRows += BasePeer::doDeleteAll(CourseI18nPeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(CourseI18nPeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } elseif ($values instanceof CourseI18n) {
$criteria = $values->buildPkeyCriteria();
} else {
$criteria = new Criteria(self::DATABASE_NAME);
if(count($values) == count($values, COUNT_RECURSIVE))
{
$values = array($values);
}
$vals = array();
foreach($values as $value)
{
$vals[0][] = $value[0];
$vals[1][] = $value[1];
}
$criteria->add(CourseI18nPeer::ID, $vals[0], Criteria::IN);
$criteria->add(CourseI18nPeer::CULTURE, $vals[1], Criteria::IN);
}
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0;
try {
$con->begin();
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doValidate(CourseI18n $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(CourseI18nPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(CourseI18nPeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
$res = BasePeer::doValidate(CourseI18nPeer::DATABASE_NAME, CourseI18nPeer::TABLE_NAME, $columns);
if ($res !== true) {
$request = sfContext::getInstance()->getRequest();
foreach ($res as $failed) {
$col = CourseI18nPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
$request->setError($col, $failed->getMessage());
}
}
return $res;
}
public static function retrieveByPK( $id, $culture, $con = null) {
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria();
$criteria->add(CourseI18nPeer::ID, $id);
$criteria->add(CourseI18nPeer::CULTURE, $culture);
$v = CourseI18nPeer::doSelect($criteria, $con);
return !empty($v) ? $v[0] : null;
}
}
if (Propel::isInit()) {
try {
BaseCourseI18nPeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
require_once 'lib/model/map/CourseI18nMapBuilder.php';
Propel::registerMapBuilder('lib.model.map.CourseI18nMapBuilder');
}

View File

@@ -0,0 +1,436 @@
<?php
abstract class BaseCoursePeer {
const DATABASE_NAME = 'propel';
const TABLE_NAME = 'Course';
const CLASS_DEFAULT = 'lib.model.Course';
const NUM_COLUMNS = 2;
const NUM_LAZY_LOAD_COLUMNS = 0;
const ID = 'Course.ID';
const SLUG = 'Course.SLUG';
private static $phpNameMap = null;
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Id', 'Slug', ),
BasePeer::TYPE_COLNAME => array (CoursePeer::ID, CoursePeer::SLUG, ),
BasePeer::TYPE_FIELDNAME => array ('id', 'slug', ),
BasePeer::TYPE_NUM => array (0, 1, )
);
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Slug' => 1, ),
BasePeer::TYPE_COLNAME => array (CoursePeer::ID => 0, CoursePeer::SLUG => 1, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'slug' => 1, ),
BasePeer::TYPE_NUM => array (0, 1, )
);
public static function getMapBuilder()
{
include_once 'lib/model/map/CourseMapBuilder.php';
return BasePeer::getMapBuilder('lib.model.map.CourseMapBuilder');
}
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = CoursePeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
public static function alias($alias, $column)
{
return str_replace(CoursePeer::TABLE_NAME.'.', $alias.'.', $column);
}
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(CoursePeer::ID);
$criteria->addSelectColumn(CoursePeer::SLUG);
}
const COUNT = 'COUNT(Course.ID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT Course.ID)';
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(CoursePeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(CoursePeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$rs = CoursePeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = CoursePeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
public static function doSelect(Criteria $criteria, $con = null)
{
return CoursePeer::populateObjects(CoursePeer::doSelectRS($criteria, $con));
}
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
CoursePeer::addSelectColumns($criteria);
}
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doSelect($criteria, $con);
}
public static function populateObjects(ResultSet $rs)
{
$results = array();
$cls = CoursePeer::getOMClass();
$cls = Propel::import($cls);
while($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
public static function doSelectWithI18n(Criteria $c, $culture = null, $con = null)
{
if ($culture === null)
{
$culture = sfContext::getInstance()->getUser()->getCulture();
}
if ($c->getDbName() == Propel::getDefaultDB())
{
$c->setDbName(self::DATABASE_NAME);
}
CoursePeer::addSelectColumns($c);
$startcol = (CoursePeer::NUM_COLUMNS - CoursePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
CourseI18nPeer::addSelectColumns($c);
$c->addJoin(CoursePeer::ID, CourseI18nPeer::ID);
$c->add(CourseI18nPeer::CULTURE, $culture);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = CoursePeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$obj1->setCulture($culture);
$omClass = CourseI18nPeer::getOMClass($rs, $startcol);
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol);
$obj1->setCourseI18nForCulture($obj2, $culture);
$obj2->setCourse($obj1);
$results[] = $obj1;
}
return $results;
}
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
public static function getOMClass()
{
return CoursePeer::CLASS_DEFAULT;
}
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } else {
$criteria = $values->buildCriteria(); }
$criteria->remove(CoursePeer::ID);
$criteria->setDbName(self::DATABASE_NAME);
try {
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch(PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values;
$comparison = $criteria->getComparison(CoursePeer::ID);
$selectCriteria->add(CoursePeer::ID, $criteria->remove(CoursePeer::ID), $comparison);
} else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); }
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; try {
$con->begin();
$affectedRows += CoursePeer::doOnDeleteCascade(new Criteria(), $con);
$affectedRows += BasePeer::doDeleteAll(CoursePeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(CoursePeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } elseif ($values instanceof Course) {
$criteria = $values->buildPkeyCriteria();
} else {
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(CoursePeer::ID, (array) $values, Criteria::IN);
}
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0;
try {
$con->begin();
$affectedRows += CoursePeer::doOnDeleteCascade($criteria, $con);
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
protected static function doOnDeleteCascade(Criteria $criteria, Connection $con)
{
$affectedRows = 0;
$objects = CoursePeer::doSelect($criteria, $con);
foreach($objects as $obj) {
include_once 'lib/model/CourseI18n.php';
$c = new Criteria();
$c->add(CourseI18nPeer::ID, $obj->getId());
$affectedRows += CourseI18nPeer::doDelete($c, $con);
}
return $affectedRows;
}
public static function doValidate(Course $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(CoursePeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(CoursePeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
$res = BasePeer::doValidate(CoursePeer::DATABASE_NAME, CoursePeer::TABLE_NAME, $columns);
if ($res !== true) {
$request = sfContext::getInstance()->getRequest();
foreach ($res as $failed) {
$col = CoursePeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
$request->setError($col, $failed->getMessage());
}
}
return $res;
}
public static function retrieveByPK($pk, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria(CoursePeer::DATABASE_NAME);
$criteria->add(CoursePeer::ID, $pk);
$v = CoursePeer::doSelect($criteria, $con);
return !empty($v) > 0 ? $v[0] : null;
}
public static function retrieveByPKs($pks, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria();
$criteria->add(CoursePeer::ID, $pks, Criteria::IN);
$objs = CoursePeer::doSelect($criteria, $con);
}
return $objs;
}
}
if (Propel::isInit()) {
try {
BaseCoursePeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
require_once 'lib/model/map/CourseMapBuilder.php';
Propel::registerMapBuilder('lib.model.map.CourseMapBuilder');
}

View File

@@ -0,0 +1,895 @@
<?php
abstract class BaseEmployee extends BaseObject implements Persistent {
protected static $peer;
protected $id;
protected $name;
protected $degrees;
protected $phone;
protected $cellphone;
protected $email;
protected $picture;
protected $active;
protected $position;
protected $slug;
protected $sort_order;
protected $aLuEmployeePosition;
protected $collEmployeeI18ns;
protected $lastEmployeeI18nCriteria = null;
protected $alreadyInSave = false;
protected $alreadyInValidation = false;
protected $culture;
public function getId()
{
return $this->id;
}
public function getName()
{
return $this->name;
}
public function getDegrees()
{
return $this->degrees;
}
public function getPhone()
{
return $this->phone;
}
public function getCellphone()
{
return $this->cellphone;
}
public function getEmail()
{
return $this->email;
}
public function getPicture()
{
return $this->picture;
}
public function getActive()
{
return $this->active;
}
public function getPosition()
{
return $this->position;
}
public function getSlug()
{
return $this->slug;
}
public function getSortOrder()
{
return $this->sort_order;
}
public function setId($v)
{
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = EmployeePeer::ID;
}
}
public function setName($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->name !== $v) {
$this->name = $v;
$this->modifiedColumns[] = EmployeePeer::NAME;
}
}
public function setDegrees($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->degrees !== $v) {
$this->degrees = $v;
$this->modifiedColumns[] = EmployeePeer::DEGREES;
}
}
public function setPhone($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->phone !== $v) {
$this->phone = $v;
$this->modifiedColumns[] = EmployeePeer::PHONE;
}
}
public function setCellphone($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->cellphone !== $v) {
$this->cellphone = $v;
$this->modifiedColumns[] = EmployeePeer::CELLPHONE;
}
}
public function setEmail($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->email !== $v) {
$this->email = $v;
$this->modifiedColumns[] = EmployeePeer::EMAIL;
}
}
public function setPicture($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->picture !== $v) {
$this->picture = $v;
$this->modifiedColumns[] = EmployeePeer::PICTURE;
}
}
public function setActive($v)
{
if ($this->active !== $v) {
$this->active = $v;
$this->modifiedColumns[] = EmployeePeer::ACTIVE;
}
}
public function setPosition($v)
{
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->position !== $v) {
$this->position = $v;
$this->modifiedColumns[] = EmployeePeer::POSITION;
}
if ($this->aLuEmployeePosition !== null && $this->aLuEmployeePosition->getId() !== $v) {
$this->aLuEmployeePosition = null;
}
}
public function setSlug($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->slug !== $v) {
$this->slug = $v;
$this->modifiedColumns[] = EmployeePeer::SLUG;
}
}
public function setSortOrder($v)
{
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->sort_order !== $v) {
$this->sort_order = $v;
$this->modifiedColumns[] = EmployeePeer::SORT_ORDER;
}
}
public function hydrate(ResultSet $rs, $startcol = 1)
{
try {
$this->id = $rs->getInt($startcol + 0);
$this->name = $rs->getString($startcol + 1);
$this->degrees = $rs->getString($startcol + 2);
$this->phone = $rs->getString($startcol + 3);
$this->cellphone = $rs->getString($startcol + 4);
$this->email = $rs->getString($startcol + 5);
$this->picture = $rs->getString($startcol + 6);
$this->active = $rs->getBoolean($startcol + 7);
$this->position = $rs->getInt($startcol + 8);
$this->slug = $rs->getString($startcol + 9);
$this->sort_order = $rs->getInt($startcol + 10);
$this->resetModified();
$this->setNew(false);
return $startcol + 11;
} catch (Exception $e) {
throw new PropelException("Error populating Employee object", $e);
}
}
public function delete($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(EmployeePeer::DATABASE_NAME);
}
try {
$con->begin();
EmployeePeer::doDelete($this, $con);
$this->setDeleted(true);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public function save($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("You cannot save an object that has been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(EmployeePeer::DATABASE_NAME);
}
try {
$con->begin();
$affectedRows = $this->doSave($con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
protected function doSave($con)
{
$affectedRows = 0; if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
if ($this->aLuEmployeePosition !== null) {
if ($this->aLuEmployeePosition->isModified()) {
$affectedRows += $this->aLuEmployeePosition->save($con);
}
$this->setLuEmployeePosition($this->aLuEmployeePosition);
}
if ($this->isModified()) {
if ($this->isNew()) {
$pk = EmployeePeer::doInsert($this, $con);
$affectedRows += 1;
$this->setId($pk);
$this->setNew(false);
} else {
$affectedRows += EmployeePeer::doUpdate($this, $con);
}
$this->resetModified(); }
if ($this->collEmployeeI18ns !== null) {
foreach($this->collEmployeeI18ns as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
}
$this->alreadyInSave = false;
}
return $affectedRows;
}
protected $validationFailures = array();
public function getValidationFailures()
{
return $this->validationFailures;
}
public function validate($columns = null)
{
$res = $this->doValidate($columns);
if ($res === true) {
$this->validationFailures = array();
return true;
} else {
$this->validationFailures = $res;
return false;
}
}
protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
if ($this->aLuEmployeePosition !== null) {
if (!$this->aLuEmployeePosition->validate($columns)) {
$failureMap = array_merge($failureMap, $this->aLuEmployeePosition->getValidationFailures());
}
}
if (($retval = EmployeePeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
if ($this->collEmployeeI18ns !== null) {
foreach($this->collEmployeeI18ns as $referrerFK) {
if (!$referrerFK->validate($columns)) {
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
}
}
}
$this->alreadyInValidation = false;
}
return (!empty($failureMap) ? $failureMap : true);
}
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = EmployeePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->getByPosition($pos);
}
public function getByPosition($pos)
{
switch($pos) {
case 0:
return $this->getId();
break;
case 1:
return $this->getName();
break;
case 2:
return $this->getDegrees();
break;
case 3:
return $this->getPhone();
break;
case 4:
return $this->getCellphone();
break;
case 5:
return $this->getEmail();
break;
case 6:
return $this->getPicture();
break;
case 7:
return $this->getActive();
break;
case 8:
return $this->getPosition();
break;
case 9:
return $this->getSlug();
break;
case 10:
return $this->getSortOrder();
break;
default:
return null;
break;
} }
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
{
$keys = EmployeePeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getName(),
$keys[2] => $this->getDegrees(),
$keys[3] => $this->getPhone(),
$keys[4] => $this->getCellphone(),
$keys[5] => $this->getEmail(),
$keys[6] => $this->getPicture(),
$keys[7] => $this->getActive(),
$keys[8] => $this->getPosition(),
$keys[9] => $this->getSlug(),
$keys[10] => $this->getSortOrder(),
);
return $result;
}
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = EmployeePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
public function setByPosition($pos, $value)
{
switch($pos) {
case 0:
$this->setId($value);
break;
case 1:
$this->setName($value);
break;
case 2:
$this->setDegrees($value);
break;
case 3:
$this->setPhone($value);
break;
case 4:
$this->setCellphone($value);
break;
case 5:
$this->setEmail($value);
break;
case 6:
$this->setPicture($value);
break;
case 7:
$this->setActive($value);
break;
case 8:
$this->setPosition($value);
break;
case 9:
$this->setSlug($value);
break;
case 10:
$this->setSortOrder($value);
break;
} }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = EmployeePeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setName($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setDegrees($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setPhone($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setCellphone($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setEmail($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setPicture($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setActive($arr[$keys[7]]);
if (array_key_exists($keys[8], $arr)) $this->setPosition($arr[$keys[8]]);
if (array_key_exists($keys[9], $arr)) $this->setSlug($arr[$keys[9]]);
if (array_key_exists($keys[10], $arr)) $this->setSortOrder($arr[$keys[10]]);
}
public function buildCriteria()
{
$criteria = new Criteria(EmployeePeer::DATABASE_NAME);
if ($this->isColumnModified(EmployeePeer::ID)) $criteria->add(EmployeePeer::ID, $this->id);
if ($this->isColumnModified(EmployeePeer::NAME)) $criteria->add(EmployeePeer::NAME, $this->name);
if ($this->isColumnModified(EmployeePeer::DEGREES)) $criteria->add(EmployeePeer::DEGREES, $this->degrees);
if ($this->isColumnModified(EmployeePeer::PHONE)) $criteria->add(EmployeePeer::PHONE, $this->phone);
if ($this->isColumnModified(EmployeePeer::CELLPHONE)) $criteria->add(EmployeePeer::CELLPHONE, $this->cellphone);
if ($this->isColumnModified(EmployeePeer::EMAIL)) $criteria->add(EmployeePeer::EMAIL, $this->email);
if ($this->isColumnModified(EmployeePeer::PICTURE)) $criteria->add(EmployeePeer::PICTURE, $this->picture);
if ($this->isColumnModified(EmployeePeer::ACTIVE)) $criteria->add(EmployeePeer::ACTIVE, $this->active);
if ($this->isColumnModified(EmployeePeer::POSITION)) $criteria->add(EmployeePeer::POSITION, $this->position);
if ($this->isColumnModified(EmployeePeer::SLUG)) $criteria->add(EmployeePeer::SLUG, $this->slug);
if ($this->isColumnModified(EmployeePeer::SORT_ORDER)) $criteria->add(EmployeePeer::SORT_ORDER, $this->sort_order);
return $criteria;
}
public function buildPkeyCriteria()
{
$criteria = new Criteria(EmployeePeer::DATABASE_NAME);
$criteria->add(EmployeePeer::ID, $this->id);
return $criteria;
}
public function getPrimaryKey()
{
return $this->getId();
}
public function setPrimaryKey($key)
{
$this->setId($key);
}
public function copyInto($copyObj, $deepCopy = false)
{
$copyObj->setName($this->name);
$copyObj->setDegrees($this->degrees);
$copyObj->setPhone($this->phone);
$copyObj->setCellphone($this->cellphone);
$copyObj->setEmail($this->email);
$copyObj->setPicture($this->picture);
$copyObj->setActive($this->active);
$copyObj->setPosition($this->position);
$copyObj->setSlug($this->slug);
$copyObj->setSortOrder($this->sort_order);
if ($deepCopy) {
$copyObj->setNew(false);
foreach($this->getEmployeeI18ns() as $relObj) {
$copyObj->addEmployeeI18n($relObj->copy($deepCopy));
}
}
$copyObj->setNew(true);
$copyObj->setId(NULL);
}
public function copy($deepCopy = false)
{
$clazz = get_class($this);
$copyObj = new $clazz();
$this->copyInto($copyObj, $deepCopy);
return $copyObj;
}
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new EmployeePeer();
}
return self::$peer;
}
public function setLuEmployeePosition($v)
{
if ($v === null) {
$this->setPosition(NULL);
} else {
$this->setPosition($v->getId());
}
$this->aLuEmployeePosition = $v;
}
public function getLuEmployeePosition($con = null)
{
if ($this->aLuEmployeePosition === null && ($this->position !== null)) {
include_once 'lib/model/om/BaseLuEmployeePositionPeer.php';
$this->aLuEmployeePosition = LuEmployeePositionPeer::retrieveByPK($this->position, $con);
}
return $this->aLuEmployeePosition;
}
public function initEmployeeI18ns()
{
if ($this->collEmployeeI18ns === null) {
$this->collEmployeeI18ns = array();
}
}
public function getEmployeeI18ns($criteria = null, $con = null)
{
include_once 'lib/model/om/BaseEmployeeI18nPeer.php';
if ($criteria === null) {
$criteria = new Criteria();
}
elseif ($criteria instanceof Criteria)
{
$criteria = clone $criteria;
}
if ($this->collEmployeeI18ns === null) {
if ($this->isNew()) {
$this->collEmployeeI18ns = array();
} else {
$criteria->add(EmployeeI18nPeer::ID, $this->getId());
EmployeeI18nPeer::addSelectColumns($criteria);
$this->collEmployeeI18ns = EmployeeI18nPeer::doSelect($criteria, $con);
}
} else {
if (!$this->isNew()) {
$criteria->add(EmployeeI18nPeer::ID, $this->getId());
EmployeeI18nPeer::addSelectColumns($criteria);
if (!isset($this->lastEmployeeI18nCriteria) || !$this->lastEmployeeI18nCriteria->equals($criteria)) {
$this->collEmployeeI18ns = EmployeeI18nPeer::doSelect($criteria, $con);
}
}
}
$this->lastEmployeeI18nCriteria = $criteria;
return $this->collEmployeeI18ns;
}
public function countEmployeeI18ns($criteria = null, $distinct = false, $con = null)
{
include_once 'lib/model/om/BaseEmployeeI18nPeer.php';
if ($criteria === null) {
$criteria = new Criteria();
}
elseif ($criteria instanceof Criteria)
{
$criteria = clone $criteria;
}
$criteria->add(EmployeeI18nPeer::ID, $this->getId());
return EmployeeI18nPeer::doCount($criteria, $distinct, $con);
}
public function addEmployeeI18n(EmployeeI18n $l)
{
$this->collEmployeeI18ns[] = $l;
$l->setEmployee($this);
}
public function getCulture()
{
return $this->culture;
}
public function setCulture($culture)
{
$this->culture = $culture;
}
public function getBiography()
{
$obj = $this->getCurrentEmployeeI18n();
return ($obj ? $obj->getBiography() : null);
}
public function setBiography($value)
{
$this->getCurrentEmployeeI18n()->setBiography($value);
}
public function getTitle()
{
$obj = $this->getCurrentEmployeeI18n();
return ($obj ? $obj->getTitle() : null);
}
public function setTitle($value)
{
$this->getCurrentEmployeeI18n()->setTitle($value);
}
protected $current_i18n = array();
public function getCurrentEmployeeI18n()
{
if (!isset($this->current_i18n[$this->culture]))
{
$obj = EmployeeI18nPeer::retrieveByPK($this->getId(), $this->culture);
if ($obj)
{
$this->setEmployeeI18nForCulture($obj, $this->culture);
}
else
{
$this->setEmployeeI18nForCulture(new EmployeeI18n(), $this->culture);
$this->current_i18n[$this->culture]->setCulture($this->culture);
}
}
return $this->current_i18n[$this->culture];
}
public function setEmployeeI18nForCulture($object, $culture)
{
$this->current_i18n[$culture] = $object;
$this->addEmployeeI18n($object);
}
}

View File

@@ -0,0 +1,465 @@
<?php
abstract class BaseEmployeeI18n extends BaseObject implements Persistent {
protected static $peer;
protected $biography;
protected $title;
protected $id;
protected $culture;
protected $aEmployee;
protected $alreadyInSave = false;
protected $alreadyInValidation = false;
public function getBiography()
{
return $this->biography;
}
public function getTitle()
{
return $this->title;
}
public function getId()
{
return $this->id;
}
public function getCulture()
{
return $this->culture;
}
public function setBiography($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->biography !== $v) {
$this->biography = $v;
$this->modifiedColumns[] = EmployeeI18nPeer::BIOGRAPHY;
}
}
public function setTitle($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->title !== $v) {
$this->title = $v;
$this->modifiedColumns[] = EmployeeI18nPeer::TITLE;
}
}
public function setId($v)
{
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = EmployeeI18nPeer::ID;
}
if ($this->aEmployee !== null && $this->aEmployee->getId() !== $v) {
$this->aEmployee = null;
}
}
public function setCulture($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->culture !== $v) {
$this->culture = $v;
$this->modifiedColumns[] = EmployeeI18nPeer::CULTURE;
}
}
public function hydrate(ResultSet $rs, $startcol = 1)
{
try {
$this->biography = $rs->getString($startcol + 0);
$this->title = $rs->getString($startcol + 1);
$this->id = $rs->getInt($startcol + 2);
$this->culture = $rs->getString($startcol + 3);
$this->resetModified();
$this->setNew(false);
return $startcol + 4;
} catch (Exception $e) {
throw new PropelException("Error populating EmployeeI18n object", $e);
}
}
public function delete($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(EmployeeI18nPeer::DATABASE_NAME);
}
try {
$con->begin();
EmployeeI18nPeer::doDelete($this, $con);
$this->setDeleted(true);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public function save($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("You cannot save an object that has been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(EmployeeI18nPeer::DATABASE_NAME);
}
try {
$con->begin();
$affectedRows = $this->doSave($con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
protected function doSave($con)
{
$affectedRows = 0; if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
if ($this->aEmployee !== null) {
if ($this->aEmployee->isModified() || $this->aEmployee->getCurrentEmployeeI18n()->isModified()) {
$affectedRows += $this->aEmployee->save($con);
}
$this->setEmployee($this->aEmployee);
}
if ($this->isModified()) {
if ($this->isNew()) {
$pk = EmployeeI18nPeer::doInsert($this, $con);
$affectedRows += 1;
$this->setNew(false);
} else {
$affectedRows += EmployeeI18nPeer::doUpdate($this, $con);
}
$this->resetModified(); }
$this->alreadyInSave = false;
}
return $affectedRows;
}
protected $validationFailures = array();
public function getValidationFailures()
{
return $this->validationFailures;
}
public function validate($columns = null)
{
$res = $this->doValidate($columns);
if ($res === true) {
$this->validationFailures = array();
return true;
} else {
$this->validationFailures = $res;
return false;
}
}
protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
if ($this->aEmployee !== null) {
if (!$this->aEmployee->validate($columns)) {
$failureMap = array_merge($failureMap, $this->aEmployee->getValidationFailures());
}
}
if (($retval = EmployeeI18nPeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
$this->alreadyInValidation = false;
}
return (!empty($failureMap) ? $failureMap : true);
}
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = EmployeeI18nPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->getByPosition($pos);
}
public function getByPosition($pos)
{
switch($pos) {
case 0:
return $this->getBiography();
break;
case 1:
return $this->getTitle();
break;
case 2:
return $this->getId();
break;
case 3:
return $this->getCulture();
break;
default:
return null;
break;
} }
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
{
$keys = EmployeeI18nPeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getBiography(),
$keys[1] => $this->getTitle(),
$keys[2] => $this->getId(),
$keys[3] => $this->getCulture(),
);
return $result;
}
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = EmployeeI18nPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
public function setByPosition($pos, $value)
{
switch($pos) {
case 0:
$this->setBiography($value);
break;
case 1:
$this->setTitle($value);
break;
case 2:
$this->setId($value);
break;
case 3:
$this->setCulture($value);
break;
} }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = EmployeeI18nPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setBiography($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setTitle($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setId($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setCulture($arr[$keys[3]]);
}
public function buildCriteria()
{
$criteria = new Criteria(EmployeeI18nPeer::DATABASE_NAME);
if ($this->isColumnModified(EmployeeI18nPeer::BIOGRAPHY)) $criteria->add(EmployeeI18nPeer::BIOGRAPHY, $this->biography);
if ($this->isColumnModified(EmployeeI18nPeer::TITLE)) $criteria->add(EmployeeI18nPeer::TITLE, $this->title);
if ($this->isColumnModified(EmployeeI18nPeer::ID)) $criteria->add(EmployeeI18nPeer::ID, $this->id);
if ($this->isColumnModified(EmployeeI18nPeer::CULTURE)) $criteria->add(EmployeeI18nPeer::CULTURE, $this->culture);
return $criteria;
}
public function buildPkeyCriteria()
{
$criteria = new Criteria(EmployeeI18nPeer::DATABASE_NAME);
$criteria->add(EmployeeI18nPeer::ID, $this->id);
$criteria->add(EmployeeI18nPeer::CULTURE, $this->culture);
return $criteria;
}
public function getPrimaryKey()
{
$pks = array();
$pks[0] = $this->getId();
$pks[1] = $this->getCulture();
return $pks;
}
public function setPrimaryKey($keys)
{
$this->setId($keys[0]);
$this->setCulture($keys[1]);
}
public function copyInto($copyObj, $deepCopy = false)
{
$copyObj->setBiography($this->biography);
$copyObj->setTitle($this->title);
$copyObj->setNew(true);
$copyObj->setId(NULL);
$copyObj->setCulture(NULL);
}
public function copy($deepCopy = false)
{
$clazz = get_class($this);
$copyObj = new $clazz();
$this->copyInto($copyObj, $deepCopy);
return $copyObj;
}
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new EmployeeI18nPeer();
}
return self::$peer;
}
public function setEmployee($v)
{
if ($v === null) {
$this->setId(NULL);
} else {
$this->setId($v->getId());
}
$this->aEmployee = $v;
}
public function getEmployee($con = null)
{
if ($this->aEmployee === null && ($this->id !== null)) {
include_once 'lib/model/om/BaseEmployeePeer.php';
$this->aEmployee = EmployeePeer::retrieveByPK($this->id, $con);
}
return $this->aEmployee;
}
}

View File

@@ -0,0 +1,531 @@
<?php
abstract class BaseEmployeeI18nPeer {
const DATABASE_NAME = 'propel';
const TABLE_NAME = 'Employee_i18n';
const CLASS_DEFAULT = 'lib.model.EmployeeI18n';
const NUM_COLUMNS = 4;
const NUM_LAZY_LOAD_COLUMNS = 0;
const BIOGRAPHY = 'Employee_i18n.BIOGRAPHY';
const TITLE = 'Employee_i18n.TITLE';
const ID = 'Employee_i18n.ID';
const CULTURE = 'Employee_i18n.CULTURE';
private static $phpNameMap = null;
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Biography', 'Title', 'Id', 'Culture', ),
BasePeer::TYPE_COLNAME => array (EmployeeI18nPeer::BIOGRAPHY, EmployeeI18nPeer::TITLE, EmployeeI18nPeer::ID, EmployeeI18nPeer::CULTURE, ),
BasePeer::TYPE_FIELDNAME => array ('biography', 'title', 'id', 'culture', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Biography' => 0, 'Title' => 1, 'Id' => 2, 'Culture' => 3, ),
BasePeer::TYPE_COLNAME => array (EmployeeI18nPeer::BIOGRAPHY => 0, EmployeeI18nPeer::TITLE => 1, EmployeeI18nPeer::ID => 2, EmployeeI18nPeer::CULTURE => 3, ),
BasePeer::TYPE_FIELDNAME => array ('biography' => 0, 'title' => 1, 'id' => 2, 'culture' => 3, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
public static function getMapBuilder()
{
include_once 'lib/model/map/EmployeeI18nMapBuilder.php';
return BasePeer::getMapBuilder('lib.model.map.EmployeeI18nMapBuilder');
}
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = EmployeeI18nPeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
public static function alias($alias, $column)
{
return str_replace(EmployeeI18nPeer::TABLE_NAME.'.', $alias.'.', $column);
}
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(EmployeeI18nPeer::BIOGRAPHY);
$criteria->addSelectColumn(EmployeeI18nPeer::TITLE);
$criteria->addSelectColumn(EmployeeI18nPeer::ID);
$criteria->addSelectColumn(EmployeeI18nPeer::CULTURE);
}
const COUNT = 'COUNT(Employee_i18n.ID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT Employee_i18n.ID)';
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(EmployeeI18nPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(EmployeeI18nPeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$rs = EmployeeI18nPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = EmployeeI18nPeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
public static function doSelect(Criteria $criteria, $con = null)
{
return EmployeeI18nPeer::populateObjects(EmployeeI18nPeer::doSelectRS($criteria, $con));
}
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
EmployeeI18nPeer::addSelectColumns($criteria);
}
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doSelect($criteria, $con);
}
public static function populateObjects(ResultSet $rs)
{
$results = array();
$cls = EmployeeI18nPeer::getOMClass();
$cls = Propel::import($cls);
while($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
public static function doCountJoinEmployee(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(EmployeeI18nPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(EmployeeI18nPeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(EmployeeI18nPeer::ID, EmployeePeer::ID);
$rs = EmployeeI18nPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectJoinEmployee(Criteria $c, $con = null)
{
$c = clone $c;
if ($c->getDbName() == Propel::getDefaultDB()) {
$c->setDbName(self::DATABASE_NAME);
}
EmployeeI18nPeer::addSelectColumns($c);
$startcol = (EmployeeI18nPeer::NUM_COLUMNS - EmployeeI18nPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
EmployeePeer::addSelectColumns($c);
$c->addJoin(EmployeeI18nPeer::ID, EmployeePeer::ID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = EmployeeI18nPeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$omClass = EmployeePeer::getOMClass();
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol);
$newObject = true;
foreach($results as $temp_obj1) {
$temp_obj2 = $temp_obj1->getEmployee(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
$temp_obj2->addEmployeeI18n($obj1); break;
}
}
if ($newObject) {
$obj2->initEmployeeI18ns();
$obj2->addEmployeeI18n($obj1); }
$results[] = $obj1;
}
return $results;
}
public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(EmployeeI18nPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(EmployeeI18nPeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(EmployeeI18nPeer::ID, EmployeePeer::ID);
$rs = EmployeeI18nPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectJoinAll(Criteria $c, $con = null)
{
$c = clone $c;
if ($c->getDbName() == Propel::getDefaultDB()) {
$c->setDbName(self::DATABASE_NAME);
}
EmployeeI18nPeer::addSelectColumns($c);
$startcol2 = (EmployeeI18nPeer::NUM_COLUMNS - EmployeeI18nPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
EmployeePeer::addSelectColumns($c);
$startcol3 = $startcol2 + EmployeePeer::NUM_COLUMNS;
$c->addJoin(EmployeeI18nPeer::ID, EmployeePeer::ID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = EmployeeI18nPeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$omClass = EmployeePeer::getOMClass();
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol2);
$newObject = true;
for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
$temp_obj1 = $results[$j];
$temp_obj2 = $temp_obj1->getEmployee(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
$temp_obj2->addEmployeeI18n($obj1); break;
}
}
if ($newObject) {
$obj2->initEmployeeI18ns();
$obj2->addEmployeeI18n($obj1);
}
$results[] = $obj1;
}
return $results;
}
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
public static function getOMClass()
{
return EmployeeI18nPeer::CLASS_DEFAULT;
}
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } else {
$criteria = $values->buildCriteria(); }
$criteria->setDbName(self::DATABASE_NAME);
try {
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch(PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values;
$comparison = $criteria->getComparison(EmployeeI18nPeer::ID);
$selectCriteria->add(EmployeeI18nPeer::ID, $criteria->remove(EmployeeI18nPeer::ID), $comparison);
$comparison = $criteria->getComparison(EmployeeI18nPeer::CULTURE);
$selectCriteria->add(EmployeeI18nPeer::CULTURE, $criteria->remove(EmployeeI18nPeer::CULTURE), $comparison);
} else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); }
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; try {
$con->begin();
$affectedRows += BasePeer::doDeleteAll(EmployeeI18nPeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(EmployeeI18nPeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } elseif ($values instanceof EmployeeI18n) {
$criteria = $values->buildPkeyCriteria();
} else {
$criteria = new Criteria(self::DATABASE_NAME);
if(count($values) == count($values, COUNT_RECURSIVE))
{
$values = array($values);
}
$vals = array();
foreach($values as $value)
{
$vals[0][] = $value[0];
$vals[1][] = $value[1];
}
$criteria->add(EmployeeI18nPeer::ID, $vals[0], Criteria::IN);
$criteria->add(EmployeeI18nPeer::CULTURE, $vals[1], Criteria::IN);
}
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0;
try {
$con->begin();
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doValidate(EmployeeI18n $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(EmployeeI18nPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(EmployeeI18nPeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
$res = BasePeer::doValidate(EmployeeI18nPeer::DATABASE_NAME, EmployeeI18nPeer::TABLE_NAME, $columns);
if ($res !== true) {
$request = sfContext::getInstance()->getRequest();
foreach ($res as $failed) {
$col = EmployeeI18nPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
$request->setError($col, $failed->getMessage());
}
}
return $res;
}
public static function retrieveByPK( $id, $culture, $con = null) {
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria();
$criteria->add(EmployeeI18nPeer::ID, $id);
$criteria->add(EmployeeI18nPeer::CULTURE, $culture);
$v = EmployeeI18nPeer::doSelect($criteria, $con);
return !empty($v) ? $v[0] : null;
}
}
if (Propel::isInit()) {
try {
BaseEmployeeI18nPeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
require_once 'lib/model/map/EmployeeI18nMapBuilder.php';
Propel::registerMapBuilder('lib.model.map.EmployeeI18nMapBuilder');
}

View File

@@ -0,0 +1,642 @@
<?php
abstract class BaseEmployeePeer {
const DATABASE_NAME = 'propel';
const TABLE_NAME = 'Employee';
const CLASS_DEFAULT = 'lib.model.Employee';
const NUM_COLUMNS = 11;
const NUM_LAZY_LOAD_COLUMNS = 0;
const ID = 'Employee.ID';
const NAME = 'Employee.NAME';
const DEGREES = 'Employee.DEGREES';
const PHONE = 'Employee.PHONE';
const CELLPHONE = 'Employee.CELLPHONE';
const EMAIL = 'Employee.EMAIL';
const PICTURE = 'Employee.PICTURE';
const ACTIVE = 'Employee.ACTIVE';
const POSITION = 'Employee.POSITION';
const SLUG = 'Employee.SLUG';
const SORT_ORDER = 'Employee.SORT_ORDER';
private static $phpNameMap = null;
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Id', 'Name', 'Degrees', 'Phone', 'Cellphone', 'Email', 'Picture', 'Active', 'Position', 'Slug', 'SortOrder', ),
BasePeer::TYPE_COLNAME => array (EmployeePeer::ID, EmployeePeer::NAME, EmployeePeer::DEGREES, EmployeePeer::PHONE, EmployeePeer::CELLPHONE, EmployeePeer::EMAIL, EmployeePeer::PICTURE, EmployeePeer::ACTIVE, EmployeePeer::POSITION, EmployeePeer::SLUG, EmployeePeer::SORT_ORDER, ),
BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'degrees', 'phone', 'cellphone', 'email', 'picture', 'active', 'position', 'slug', 'sort_order', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
);
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Name' => 1, 'Degrees' => 2, 'Phone' => 3, 'Cellphone' => 4, 'Email' => 5, 'Picture' => 6, 'Active' => 7, 'Position' => 8, 'Slug' => 9, 'SortOrder' => 10, ),
BasePeer::TYPE_COLNAME => array (EmployeePeer::ID => 0, EmployeePeer::NAME => 1, EmployeePeer::DEGREES => 2, EmployeePeer::PHONE => 3, EmployeePeer::CELLPHONE => 4, EmployeePeer::EMAIL => 5, EmployeePeer::PICTURE => 6, EmployeePeer::ACTIVE => 7, EmployeePeer::POSITION => 8, EmployeePeer::SLUG => 9, EmployeePeer::SORT_ORDER => 10, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'degrees' => 2, 'phone' => 3, 'cellphone' => 4, 'email' => 5, 'picture' => 6, 'active' => 7, 'position' => 8, 'slug' => 9, 'sort_order' => 10, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
);
public static function getMapBuilder()
{
include_once 'lib/model/map/EmployeeMapBuilder.php';
return BasePeer::getMapBuilder('lib.model.map.EmployeeMapBuilder');
}
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = EmployeePeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
public static function alias($alias, $column)
{
return str_replace(EmployeePeer::TABLE_NAME.'.', $alias.'.', $column);
}
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(EmployeePeer::ID);
$criteria->addSelectColumn(EmployeePeer::NAME);
$criteria->addSelectColumn(EmployeePeer::DEGREES);
$criteria->addSelectColumn(EmployeePeer::PHONE);
$criteria->addSelectColumn(EmployeePeer::CELLPHONE);
$criteria->addSelectColumn(EmployeePeer::EMAIL);
$criteria->addSelectColumn(EmployeePeer::PICTURE);
$criteria->addSelectColumn(EmployeePeer::ACTIVE);
$criteria->addSelectColumn(EmployeePeer::POSITION);
$criteria->addSelectColumn(EmployeePeer::SLUG);
$criteria->addSelectColumn(EmployeePeer::SORT_ORDER);
}
const COUNT = 'COUNT(Employee.ID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT Employee.ID)';
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(EmployeePeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(EmployeePeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$rs = EmployeePeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = EmployeePeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
public static function doSelect(Criteria $criteria, $con = null)
{
return EmployeePeer::populateObjects(EmployeePeer::doSelectRS($criteria, $con));
}
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
EmployeePeer::addSelectColumns($criteria);
}
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doSelect($criteria, $con);
}
public static function populateObjects(ResultSet $rs)
{
$results = array();
$cls = EmployeePeer::getOMClass();
$cls = Propel::import($cls);
while($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
public static function doCountJoinLuEmployeePosition(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(EmployeePeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(EmployeePeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(EmployeePeer::POSITION, LuEmployeePositionPeer::ID);
$rs = EmployeePeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectJoinLuEmployeePosition(Criteria $c, $con = null)
{
$c = clone $c;
if ($c->getDbName() == Propel::getDefaultDB()) {
$c->setDbName(self::DATABASE_NAME);
}
EmployeePeer::addSelectColumns($c);
$startcol = (EmployeePeer::NUM_COLUMNS - EmployeePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
LuEmployeePositionPeer::addSelectColumns($c);
$c->addJoin(EmployeePeer::POSITION, LuEmployeePositionPeer::ID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = EmployeePeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$omClass = LuEmployeePositionPeer::getOMClass();
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol);
$newObject = true;
foreach($results as $temp_obj1) {
$temp_obj2 = $temp_obj1->getLuEmployeePosition(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
$temp_obj2->addEmployee($obj1); break;
}
}
if ($newObject) {
$obj2->initEmployees();
$obj2->addEmployee($obj1); }
$results[] = $obj1;
}
return $results;
}
public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(EmployeePeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(EmployeePeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(EmployeePeer::POSITION, LuEmployeePositionPeer::ID);
$rs = EmployeePeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectJoinAll(Criteria $c, $con = null)
{
$c = clone $c;
if ($c->getDbName() == Propel::getDefaultDB()) {
$c->setDbName(self::DATABASE_NAME);
}
EmployeePeer::addSelectColumns($c);
$startcol2 = (EmployeePeer::NUM_COLUMNS - EmployeePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
LuEmployeePositionPeer::addSelectColumns($c);
$startcol3 = $startcol2 + LuEmployeePositionPeer::NUM_COLUMNS;
$c->addJoin(EmployeePeer::POSITION, LuEmployeePositionPeer::ID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = EmployeePeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$omClass = LuEmployeePositionPeer::getOMClass();
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol2);
$newObject = true;
for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
$temp_obj1 = $results[$j];
$temp_obj2 = $temp_obj1->getLuEmployeePosition(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
$temp_obj2->addEmployee($obj1); break;
}
}
if ($newObject) {
$obj2->initEmployees();
$obj2->addEmployee($obj1);
}
$results[] = $obj1;
}
return $results;
}
public static function doSelectWithI18n(Criteria $c, $culture = null, $con = null)
{
if ($culture === null)
{
$culture = sfContext::getInstance()->getUser()->getCulture();
}
if ($c->getDbName() == Propel::getDefaultDB())
{
$c->setDbName(self::DATABASE_NAME);
}
EmployeePeer::addSelectColumns($c);
$startcol = (EmployeePeer::NUM_COLUMNS - EmployeePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
EmployeeI18nPeer::addSelectColumns($c);
$c->addJoin(EmployeePeer::ID, EmployeeI18nPeer::ID);
$c->add(EmployeeI18nPeer::CULTURE, $culture);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = EmployeePeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$obj1->setCulture($culture);
$omClass = EmployeeI18nPeer::getOMClass($rs, $startcol);
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol);
$obj1->setEmployeeI18nForCulture($obj2, $culture);
$obj2->setEmployee($obj1);
$results[] = $obj1;
}
return $results;
}
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
public static function getOMClass()
{
return EmployeePeer::CLASS_DEFAULT;
}
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } else {
$criteria = $values->buildCriteria(); }
$criteria->remove(EmployeePeer::ID);
$criteria->setDbName(self::DATABASE_NAME);
try {
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch(PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values;
$comparison = $criteria->getComparison(EmployeePeer::ID);
$selectCriteria->add(EmployeePeer::ID, $criteria->remove(EmployeePeer::ID), $comparison);
} else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); }
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; try {
$con->begin();
$affectedRows += EmployeePeer::doOnDeleteCascade(new Criteria(), $con);
$affectedRows += BasePeer::doDeleteAll(EmployeePeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(EmployeePeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } elseif ($values instanceof Employee) {
$criteria = $values->buildPkeyCriteria();
} else {
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(EmployeePeer::ID, (array) $values, Criteria::IN);
}
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0;
try {
$con->begin();
$affectedRows += EmployeePeer::doOnDeleteCascade($criteria, $con);
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
protected static function doOnDeleteCascade(Criteria $criteria, Connection $con)
{
$affectedRows = 0;
$objects = EmployeePeer::doSelect($criteria, $con);
foreach($objects as $obj) {
include_once 'lib/model/EmployeeI18n.php';
$c = new Criteria();
$c->add(EmployeeI18nPeer::ID, $obj->getId());
$affectedRows += EmployeeI18nPeer::doDelete($c, $con);
}
return $affectedRows;
}
public static function doValidate(Employee $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(EmployeePeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(EmployeePeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
$res = BasePeer::doValidate(EmployeePeer::DATABASE_NAME, EmployeePeer::TABLE_NAME, $columns);
if ($res !== true) {
$request = sfContext::getInstance()->getRequest();
foreach ($res as $failed) {
$col = EmployeePeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
$request->setError($col, $failed->getMessage());
}
}
return $res;
}
public static function retrieveByPK($pk, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria(EmployeePeer::DATABASE_NAME);
$criteria->add(EmployeePeer::ID, $pk);
$v = EmployeePeer::doSelect($criteria, $con);
return !empty($v) > 0 ? $v[0] : null;
}
public static function retrieveByPKs($pks, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria();
$criteria->add(EmployeePeer::ID, $pks, Criteria::IN);
$objs = EmployeePeer::doSelect($criteria, $con);
}
return $objs;
}
}
if (Propel::isInit()) {
try {
BaseEmployeePeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
require_once 'lib/model/map/EmployeeMapBuilder.php';
Propel::registerMapBuilder('lib.model.map.EmployeeMapBuilder');
}

View File

@@ -0,0 +1,544 @@
<?php
abstract class BaseEvent extends BaseObject implements Persistent {
protected static $peer;
protected $id;
protected $picture;
protected $expires_on;
protected $collEventI18ns;
protected $lastEventI18nCriteria = null;
protected $alreadyInSave = false;
protected $alreadyInValidation = false;
protected $culture;
public function getId()
{
return $this->id;
}
public function getPicture()
{
return $this->picture;
}
public function getExpiresOn($format = 'Y-m-d H:i:s')
{
if ($this->expires_on === null || $this->expires_on === '') {
return null;
} elseif (!is_int($this->expires_on)) {
$ts = strtotime($this->expires_on);
if ($ts === -1 || $ts === false) { throw new PropelException("Unable to parse value of [expires_on] as date/time value: " . var_export($this->expires_on, true));
}
} else {
$ts = $this->expires_on;
}
if ($format === null) {
return $ts;
} elseif (strpos($format, '%') !== false) {
return strftime($format, $ts);
} else {
return date($format, $ts);
}
}
public function setId($v)
{
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = EventPeer::ID;
}
}
public function setPicture($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->picture !== $v) {
$this->picture = $v;
$this->modifiedColumns[] = EventPeer::PICTURE;
}
}
public function setExpiresOn($v)
{
if ($v !== null && !is_int($v)) {
$ts = strtotime($v);
if ($ts === -1 || $ts === false) { throw new PropelException("Unable to parse date/time value for [expires_on] from input: " . var_export($v, true));
}
} else {
$ts = $v;
}
if ($this->expires_on !== $ts) {
$this->expires_on = $ts;
$this->modifiedColumns[] = EventPeer::EXPIRES_ON;
}
}
public function hydrate(ResultSet $rs, $startcol = 1)
{
try {
$this->id = $rs->getInt($startcol + 0);
$this->picture = $rs->getString($startcol + 1);
$this->expires_on = $rs->getTimestamp($startcol + 2, null);
$this->resetModified();
$this->setNew(false);
return $startcol + 3;
} catch (Exception $e) {
throw new PropelException("Error populating Event object", $e);
}
}
public function delete($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(EventPeer::DATABASE_NAME);
}
try {
$con->begin();
EventPeer::doDelete($this, $con);
$this->setDeleted(true);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public function save($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("You cannot save an object that has been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(EventPeer::DATABASE_NAME);
}
try {
$con->begin();
$affectedRows = $this->doSave($con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
protected function doSave($con)
{
$affectedRows = 0; if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
if ($this->isModified()) {
if ($this->isNew()) {
$pk = EventPeer::doInsert($this, $con);
$affectedRows += 1;
$this->setId($pk);
$this->setNew(false);
} else {
$affectedRows += EventPeer::doUpdate($this, $con);
}
$this->resetModified(); }
if ($this->collEventI18ns !== null) {
foreach($this->collEventI18ns as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
}
$this->alreadyInSave = false;
}
return $affectedRows;
}
protected $validationFailures = array();
public function getValidationFailures()
{
return $this->validationFailures;
}
public function validate($columns = null)
{
$res = $this->doValidate($columns);
if ($res === true) {
$this->validationFailures = array();
return true;
} else {
$this->validationFailures = $res;
return false;
}
}
protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
if (($retval = EventPeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
if ($this->collEventI18ns !== null) {
foreach($this->collEventI18ns as $referrerFK) {
if (!$referrerFK->validate($columns)) {
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
}
}
}
$this->alreadyInValidation = false;
}
return (!empty($failureMap) ? $failureMap : true);
}
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = EventPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->getByPosition($pos);
}
public function getByPosition($pos)
{
switch($pos) {
case 0:
return $this->getId();
break;
case 1:
return $this->getPicture();
break;
case 2:
return $this->getExpiresOn();
break;
default:
return null;
break;
} }
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
{
$keys = EventPeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getPicture(),
$keys[2] => $this->getExpiresOn(),
);
return $result;
}
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = EventPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
public function setByPosition($pos, $value)
{
switch($pos) {
case 0:
$this->setId($value);
break;
case 1:
$this->setPicture($value);
break;
case 2:
$this->setExpiresOn($value);
break;
} }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = EventPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setPicture($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setExpiresOn($arr[$keys[2]]);
}
public function buildCriteria()
{
$criteria = new Criteria(EventPeer::DATABASE_NAME);
if ($this->isColumnModified(EventPeer::ID)) $criteria->add(EventPeer::ID, $this->id);
if ($this->isColumnModified(EventPeer::PICTURE)) $criteria->add(EventPeer::PICTURE, $this->picture);
if ($this->isColumnModified(EventPeer::EXPIRES_ON)) $criteria->add(EventPeer::EXPIRES_ON, $this->expires_on);
return $criteria;
}
public function buildPkeyCriteria()
{
$criteria = new Criteria(EventPeer::DATABASE_NAME);
$criteria->add(EventPeer::ID, $this->id);
return $criteria;
}
public function getPrimaryKey()
{
return $this->getId();
}
public function setPrimaryKey($key)
{
$this->setId($key);
}
public function copyInto($copyObj, $deepCopy = false)
{
$copyObj->setPicture($this->picture);
$copyObj->setExpiresOn($this->expires_on);
if ($deepCopy) {
$copyObj->setNew(false);
foreach($this->getEventI18ns() as $relObj) {
$copyObj->addEventI18n($relObj->copy($deepCopy));
}
}
$copyObj->setNew(true);
$copyObj->setId(NULL);
}
public function copy($deepCopy = false)
{
$clazz = get_class($this);
$copyObj = new $clazz();
$this->copyInto($copyObj, $deepCopy);
return $copyObj;
}
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new EventPeer();
}
return self::$peer;
}
public function initEventI18ns()
{
if ($this->collEventI18ns === null) {
$this->collEventI18ns = array();
}
}
public function getEventI18ns($criteria = null, $con = null)
{
include_once 'lib/model/om/BaseEventI18nPeer.php';
if ($criteria === null) {
$criteria = new Criteria();
}
elseif ($criteria instanceof Criteria)
{
$criteria = clone $criteria;
}
if ($this->collEventI18ns === null) {
if ($this->isNew()) {
$this->collEventI18ns = array();
} else {
$criteria->add(EventI18nPeer::ID, $this->getId());
EventI18nPeer::addSelectColumns($criteria);
$this->collEventI18ns = EventI18nPeer::doSelect($criteria, $con);
}
} else {
if (!$this->isNew()) {
$criteria->add(EventI18nPeer::ID, $this->getId());
EventI18nPeer::addSelectColumns($criteria);
if (!isset($this->lastEventI18nCriteria) || !$this->lastEventI18nCriteria->equals($criteria)) {
$this->collEventI18ns = EventI18nPeer::doSelect($criteria, $con);
}
}
}
$this->lastEventI18nCriteria = $criteria;
return $this->collEventI18ns;
}
public function countEventI18ns($criteria = null, $distinct = false, $con = null)
{
include_once 'lib/model/om/BaseEventI18nPeer.php';
if ($criteria === null) {
$criteria = new Criteria();
}
elseif ($criteria instanceof Criteria)
{
$criteria = clone $criteria;
}
$criteria->add(EventI18nPeer::ID, $this->getId());
return EventI18nPeer::doCount($criteria, $distinct, $con);
}
public function addEventI18n(EventI18n $l)
{
$this->collEventI18ns[] = $l;
$l->setEvent($this);
}
public function getCulture()
{
return $this->culture;
}
public function setCulture($culture)
{
$this->culture = $culture;
}
public function getTitle()
{
$obj = $this->getCurrentEventI18n();
return ($obj ? $obj->getTitle() : null);
}
public function setTitle($value)
{
$this->getCurrentEventI18n()->setTitle($value);
}
public function getDescription()
{
$obj = $this->getCurrentEventI18n();
return ($obj ? $obj->getDescription() : null);
}
public function setDescription($value)
{
$this->getCurrentEventI18n()->setDescription($value);
}
protected $current_i18n = array();
public function getCurrentEventI18n()
{
if (!isset($this->current_i18n[$this->culture]))
{
$obj = EventI18nPeer::retrieveByPK($this->getId(), $this->culture);
if ($obj)
{
$this->setEventI18nForCulture($obj, $this->culture);
}
else
{
$this->setEventI18nForCulture(new EventI18n(), $this->culture);
$this->current_i18n[$this->culture]->setCulture($this->culture);
}
}
return $this->current_i18n[$this->culture];
}
public function setEventI18nForCulture($object, $culture)
{
$this->current_i18n[$culture] = $object;
$this->addEventI18n($object);
}
}

View File

@@ -0,0 +1,465 @@
<?php
abstract class BaseEventI18n extends BaseObject implements Persistent {
protected static $peer;
protected $title;
protected $description;
protected $id;
protected $culture;
protected $aEvent;
protected $alreadyInSave = false;
protected $alreadyInValidation = false;
public function getTitle()
{
return $this->title;
}
public function getDescription()
{
return $this->description;
}
public function getId()
{
return $this->id;
}
public function getCulture()
{
return $this->culture;
}
public function setTitle($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->title !== $v) {
$this->title = $v;
$this->modifiedColumns[] = EventI18nPeer::TITLE;
}
}
public function setDescription($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->description !== $v) {
$this->description = $v;
$this->modifiedColumns[] = EventI18nPeer::DESCRIPTION;
}
}
public function setId($v)
{
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = EventI18nPeer::ID;
}
if ($this->aEvent !== null && $this->aEvent->getId() !== $v) {
$this->aEvent = null;
}
}
public function setCulture($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->culture !== $v) {
$this->culture = $v;
$this->modifiedColumns[] = EventI18nPeer::CULTURE;
}
}
public function hydrate(ResultSet $rs, $startcol = 1)
{
try {
$this->title = $rs->getString($startcol + 0);
$this->description = $rs->getString($startcol + 1);
$this->id = $rs->getInt($startcol + 2);
$this->culture = $rs->getString($startcol + 3);
$this->resetModified();
$this->setNew(false);
return $startcol + 4;
} catch (Exception $e) {
throw new PropelException("Error populating EventI18n object", $e);
}
}
public function delete($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(EventI18nPeer::DATABASE_NAME);
}
try {
$con->begin();
EventI18nPeer::doDelete($this, $con);
$this->setDeleted(true);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public function save($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("You cannot save an object that has been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(EventI18nPeer::DATABASE_NAME);
}
try {
$con->begin();
$affectedRows = $this->doSave($con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
protected function doSave($con)
{
$affectedRows = 0; if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
if ($this->aEvent !== null) {
if ($this->aEvent->isModified() || $this->aEvent->getCurrentEventI18n()->isModified()) {
$affectedRows += $this->aEvent->save($con);
}
$this->setEvent($this->aEvent);
}
if ($this->isModified()) {
if ($this->isNew()) {
$pk = EventI18nPeer::doInsert($this, $con);
$affectedRows += 1;
$this->setNew(false);
} else {
$affectedRows += EventI18nPeer::doUpdate($this, $con);
}
$this->resetModified(); }
$this->alreadyInSave = false;
}
return $affectedRows;
}
protected $validationFailures = array();
public function getValidationFailures()
{
return $this->validationFailures;
}
public function validate($columns = null)
{
$res = $this->doValidate($columns);
if ($res === true) {
$this->validationFailures = array();
return true;
} else {
$this->validationFailures = $res;
return false;
}
}
protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
if ($this->aEvent !== null) {
if (!$this->aEvent->validate($columns)) {
$failureMap = array_merge($failureMap, $this->aEvent->getValidationFailures());
}
}
if (($retval = EventI18nPeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
$this->alreadyInValidation = false;
}
return (!empty($failureMap) ? $failureMap : true);
}
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = EventI18nPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->getByPosition($pos);
}
public function getByPosition($pos)
{
switch($pos) {
case 0:
return $this->getTitle();
break;
case 1:
return $this->getDescription();
break;
case 2:
return $this->getId();
break;
case 3:
return $this->getCulture();
break;
default:
return null;
break;
} }
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
{
$keys = EventI18nPeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getTitle(),
$keys[1] => $this->getDescription(),
$keys[2] => $this->getId(),
$keys[3] => $this->getCulture(),
);
return $result;
}
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = EventI18nPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
public function setByPosition($pos, $value)
{
switch($pos) {
case 0:
$this->setTitle($value);
break;
case 1:
$this->setDescription($value);
break;
case 2:
$this->setId($value);
break;
case 3:
$this->setCulture($value);
break;
} }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = EventI18nPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setTitle($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setDescription($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setId($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setCulture($arr[$keys[3]]);
}
public function buildCriteria()
{
$criteria = new Criteria(EventI18nPeer::DATABASE_NAME);
if ($this->isColumnModified(EventI18nPeer::TITLE)) $criteria->add(EventI18nPeer::TITLE, $this->title);
if ($this->isColumnModified(EventI18nPeer::DESCRIPTION)) $criteria->add(EventI18nPeer::DESCRIPTION, $this->description);
if ($this->isColumnModified(EventI18nPeer::ID)) $criteria->add(EventI18nPeer::ID, $this->id);
if ($this->isColumnModified(EventI18nPeer::CULTURE)) $criteria->add(EventI18nPeer::CULTURE, $this->culture);
return $criteria;
}
public function buildPkeyCriteria()
{
$criteria = new Criteria(EventI18nPeer::DATABASE_NAME);
$criteria->add(EventI18nPeer::ID, $this->id);
$criteria->add(EventI18nPeer::CULTURE, $this->culture);
return $criteria;
}
public function getPrimaryKey()
{
$pks = array();
$pks[0] = $this->getId();
$pks[1] = $this->getCulture();
return $pks;
}
public function setPrimaryKey($keys)
{
$this->setId($keys[0]);
$this->setCulture($keys[1]);
}
public function copyInto($copyObj, $deepCopy = false)
{
$copyObj->setTitle($this->title);
$copyObj->setDescription($this->description);
$copyObj->setNew(true);
$copyObj->setId(NULL);
$copyObj->setCulture(NULL);
}
public function copy($deepCopy = false)
{
$clazz = get_class($this);
$copyObj = new $clazz();
$this->copyInto($copyObj, $deepCopy);
return $copyObj;
}
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new EventI18nPeer();
}
return self::$peer;
}
public function setEvent($v)
{
if ($v === null) {
$this->setId(NULL);
} else {
$this->setId($v->getId());
}
$this->aEvent = $v;
}
public function getEvent($con = null)
{
if ($this->aEvent === null && ($this->id !== null)) {
include_once 'lib/model/om/BaseEventPeer.php';
$this->aEvent = EventPeer::retrieveByPK($this->id, $con);
}
return $this->aEvent;
}
}

View File

@@ -0,0 +1,531 @@
<?php
abstract class BaseEventI18nPeer {
const DATABASE_NAME = 'propel';
const TABLE_NAME = 'Event_i18n';
const CLASS_DEFAULT = 'lib.model.EventI18n';
const NUM_COLUMNS = 4;
const NUM_LAZY_LOAD_COLUMNS = 0;
const TITLE = 'Event_i18n.TITLE';
const DESCRIPTION = 'Event_i18n.DESCRIPTION';
const ID = 'Event_i18n.ID';
const CULTURE = 'Event_i18n.CULTURE';
private static $phpNameMap = null;
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Title', 'Description', 'Id', 'Culture', ),
BasePeer::TYPE_COLNAME => array (EventI18nPeer::TITLE, EventI18nPeer::DESCRIPTION, EventI18nPeer::ID, EventI18nPeer::CULTURE, ),
BasePeer::TYPE_FIELDNAME => array ('title', 'description', 'id', 'culture', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Title' => 0, 'Description' => 1, 'Id' => 2, 'Culture' => 3, ),
BasePeer::TYPE_COLNAME => array (EventI18nPeer::TITLE => 0, EventI18nPeer::DESCRIPTION => 1, EventI18nPeer::ID => 2, EventI18nPeer::CULTURE => 3, ),
BasePeer::TYPE_FIELDNAME => array ('title' => 0, 'description' => 1, 'id' => 2, 'culture' => 3, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
public static function getMapBuilder()
{
include_once 'lib/model/map/EventI18nMapBuilder.php';
return BasePeer::getMapBuilder('lib.model.map.EventI18nMapBuilder');
}
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = EventI18nPeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
public static function alias($alias, $column)
{
return str_replace(EventI18nPeer::TABLE_NAME.'.', $alias.'.', $column);
}
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(EventI18nPeer::TITLE);
$criteria->addSelectColumn(EventI18nPeer::DESCRIPTION);
$criteria->addSelectColumn(EventI18nPeer::ID);
$criteria->addSelectColumn(EventI18nPeer::CULTURE);
}
const COUNT = 'COUNT(Event_i18n.ID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT Event_i18n.ID)';
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(EventI18nPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(EventI18nPeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$rs = EventI18nPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = EventI18nPeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
public static function doSelect(Criteria $criteria, $con = null)
{
return EventI18nPeer::populateObjects(EventI18nPeer::doSelectRS($criteria, $con));
}
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
EventI18nPeer::addSelectColumns($criteria);
}
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doSelect($criteria, $con);
}
public static function populateObjects(ResultSet $rs)
{
$results = array();
$cls = EventI18nPeer::getOMClass();
$cls = Propel::import($cls);
while($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
public static function doCountJoinEvent(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(EventI18nPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(EventI18nPeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(EventI18nPeer::ID, EventPeer::ID);
$rs = EventI18nPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectJoinEvent(Criteria $c, $con = null)
{
$c = clone $c;
if ($c->getDbName() == Propel::getDefaultDB()) {
$c->setDbName(self::DATABASE_NAME);
}
EventI18nPeer::addSelectColumns($c);
$startcol = (EventI18nPeer::NUM_COLUMNS - EventI18nPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
EventPeer::addSelectColumns($c);
$c->addJoin(EventI18nPeer::ID, EventPeer::ID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = EventI18nPeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$omClass = EventPeer::getOMClass();
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol);
$newObject = true;
foreach($results as $temp_obj1) {
$temp_obj2 = $temp_obj1->getEvent(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
$temp_obj2->addEventI18n($obj1); break;
}
}
if ($newObject) {
$obj2->initEventI18ns();
$obj2->addEventI18n($obj1); }
$results[] = $obj1;
}
return $results;
}
public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(EventI18nPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(EventI18nPeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(EventI18nPeer::ID, EventPeer::ID);
$rs = EventI18nPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectJoinAll(Criteria $c, $con = null)
{
$c = clone $c;
if ($c->getDbName() == Propel::getDefaultDB()) {
$c->setDbName(self::DATABASE_NAME);
}
EventI18nPeer::addSelectColumns($c);
$startcol2 = (EventI18nPeer::NUM_COLUMNS - EventI18nPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
EventPeer::addSelectColumns($c);
$startcol3 = $startcol2 + EventPeer::NUM_COLUMNS;
$c->addJoin(EventI18nPeer::ID, EventPeer::ID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = EventI18nPeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$omClass = EventPeer::getOMClass();
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol2);
$newObject = true;
for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
$temp_obj1 = $results[$j];
$temp_obj2 = $temp_obj1->getEvent(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
$temp_obj2->addEventI18n($obj1); break;
}
}
if ($newObject) {
$obj2->initEventI18ns();
$obj2->addEventI18n($obj1);
}
$results[] = $obj1;
}
return $results;
}
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
public static function getOMClass()
{
return EventI18nPeer::CLASS_DEFAULT;
}
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } else {
$criteria = $values->buildCriteria(); }
$criteria->setDbName(self::DATABASE_NAME);
try {
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch(PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values;
$comparison = $criteria->getComparison(EventI18nPeer::ID);
$selectCriteria->add(EventI18nPeer::ID, $criteria->remove(EventI18nPeer::ID), $comparison);
$comparison = $criteria->getComparison(EventI18nPeer::CULTURE);
$selectCriteria->add(EventI18nPeer::CULTURE, $criteria->remove(EventI18nPeer::CULTURE), $comparison);
} else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); }
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; try {
$con->begin();
$affectedRows += BasePeer::doDeleteAll(EventI18nPeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(EventI18nPeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } elseif ($values instanceof EventI18n) {
$criteria = $values->buildPkeyCriteria();
} else {
$criteria = new Criteria(self::DATABASE_NAME);
if(count($values) == count($values, COUNT_RECURSIVE))
{
$values = array($values);
}
$vals = array();
foreach($values as $value)
{
$vals[0][] = $value[0];
$vals[1][] = $value[1];
}
$criteria->add(EventI18nPeer::ID, $vals[0], Criteria::IN);
$criteria->add(EventI18nPeer::CULTURE, $vals[1], Criteria::IN);
}
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0;
try {
$con->begin();
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doValidate(EventI18n $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(EventI18nPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(EventI18nPeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
$res = BasePeer::doValidate(EventI18nPeer::DATABASE_NAME, EventI18nPeer::TABLE_NAME, $columns);
if ($res !== true) {
$request = sfContext::getInstance()->getRequest();
foreach ($res as $failed) {
$col = EventI18nPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
$request->setError($col, $failed->getMessage());
}
}
return $res;
}
public static function retrieveByPK( $id, $culture, $con = null) {
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria();
$criteria->add(EventI18nPeer::ID, $id);
$criteria->add(EventI18nPeer::CULTURE, $culture);
$v = EventI18nPeer::doSelect($criteria, $con);
return !empty($v) ? $v[0] : null;
}
}
if (Propel::isInit()) {
try {
BaseEventI18nPeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
require_once 'lib/model/map/EventI18nMapBuilder.php';
Propel::registerMapBuilder('lib.model.map.EventI18nMapBuilder');
}

View File

@@ -0,0 +1,441 @@
<?php
abstract class BaseEventPeer {
const DATABASE_NAME = 'propel';
const TABLE_NAME = 'Event';
const CLASS_DEFAULT = 'lib.model.Event';
const NUM_COLUMNS = 3;
const NUM_LAZY_LOAD_COLUMNS = 0;
const ID = 'Event.ID';
const PICTURE = 'Event.PICTURE';
const EXPIRES_ON = 'Event.EXPIRES_ON';
private static $phpNameMap = null;
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Id', 'Picture', 'ExpiresOn', ),
BasePeer::TYPE_COLNAME => array (EventPeer::ID, EventPeer::PICTURE, EventPeer::EXPIRES_ON, ),
BasePeer::TYPE_FIELDNAME => array ('id', 'picture', 'expires_on', ),
BasePeer::TYPE_NUM => array (0, 1, 2, )
);
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Picture' => 1, 'ExpiresOn' => 2, ),
BasePeer::TYPE_COLNAME => array (EventPeer::ID => 0, EventPeer::PICTURE => 1, EventPeer::EXPIRES_ON => 2, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'picture' => 1, 'expires_on' => 2, ),
BasePeer::TYPE_NUM => array (0, 1, 2, )
);
public static function getMapBuilder()
{
include_once 'lib/model/map/EventMapBuilder.php';
return BasePeer::getMapBuilder('lib.model.map.EventMapBuilder');
}
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = EventPeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
public static function alias($alias, $column)
{
return str_replace(EventPeer::TABLE_NAME.'.', $alias.'.', $column);
}
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(EventPeer::ID);
$criteria->addSelectColumn(EventPeer::PICTURE);
$criteria->addSelectColumn(EventPeer::EXPIRES_ON);
}
const COUNT = 'COUNT(Event.ID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT Event.ID)';
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(EventPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(EventPeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$rs = EventPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = EventPeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
public static function doSelect(Criteria $criteria, $con = null)
{
return EventPeer::populateObjects(EventPeer::doSelectRS($criteria, $con));
}
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
EventPeer::addSelectColumns($criteria);
}
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doSelect($criteria, $con);
}
public static function populateObjects(ResultSet $rs)
{
$results = array();
$cls = EventPeer::getOMClass();
$cls = Propel::import($cls);
while($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
public static function doSelectWithI18n(Criteria $c, $culture = null, $con = null)
{
if ($culture === null)
{
$culture = sfContext::getInstance()->getUser()->getCulture();
}
if ($c->getDbName() == Propel::getDefaultDB())
{
$c->setDbName(self::DATABASE_NAME);
}
EventPeer::addSelectColumns($c);
$startcol = (EventPeer::NUM_COLUMNS - EventPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
EventI18nPeer::addSelectColumns($c);
$c->addJoin(EventPeer::ID, EventI18nPeer::ID);
$c->add(EventI18nPeer::CULTURE, $culture);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = EventPeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$obj1->setCulture($culture);
$omClass = EventI18nPeer::getOMClass($rs, $startcol);
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol);
$obj1->setEventI18nForCulture($obj2, $culture);
$obj2->setEvent($obj1);
$results[] = $obj1;
}
return $results;
}
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
public static function getOMClass()
{
return EventPeer::CLASS_DEFAULT;
}
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } else {
$criteria = $values->buildCriteria(); }
$criteria->remove(EventPeer::ID);
$criteria->setDbName(self::DATABASE_NAME);
try {
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch(PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values;
$comparison = $criteria->getComparison(EventPeer::ID);
$selectCriteria->add(EventPeer::ID, $criteria->remove(EventPeer::ID), $comparison);
} else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); }
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; try {
$con->begin();
$affectedRows += EventPeer::doOnDeleteCascade(new Criteria(), $con);
$affectedRows += BasePeer::doDeleteAll(EventPeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(EventPeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } elseif ($values instanceof Event) {
$criteria = $values->buildPkeyCriteria();
} else {
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(EventPeer::ID, (array) $values, Criteria::IN);
}
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0;
try {
$con->begin();
$affectedRows += EventPeer::doOnDeleteCascade($criteria, $con);
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
protected static function doOnDeleteCascade(Criteria $criteria, Connection $con)
{
$affectedRows = 0;
$objects = EventPeer::doSelect($criteria, $con);
foreach($objects as $obj) {
include_once 'lib/model/EventI18n.php';
$c = new Criteria();
$c->add(EventI18nPeer::ID, $obj->getId());
$affectedRows += EventI18nPeer::doDelete($c, $con);
}
return $affectedRows;
}
public static function doValidate(Event $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(EventPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(EventPeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
$res = BasePeer::doValidate(EventPeer::DATABASE_NAME, EventPeer::TABLE_NAME, $columns);
if ($res !== true) {
$request = sfContext::getInstance()->getRequest();
foreach ($res as $failed) {
$col = EventPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
$request->setError($col, $failed->getMessage());
}
}
return $res;
}
public static function retrieveByPK($pk, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria(EventPeer::DATABASE_NAME);
$criteria->add(EventPeer::ID, $pk);
$v = EventPeer::doSelect($criteria, $con);
return !empty($v) > 0 ? $v[0] : null;
}
public static function retrieveByPKs($pks, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria();
$criteria->add(EventPeer::ID, $pks, Criteria::IN);
$objs = EventPeer::doSelect($criteria, $con);
}
return $objs;
}
}
if (Propel::isInit()) {
try {
BaseEventPeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
require_once 'lib/model/map/EventMapBuilder.php';
Propel::registerMapBuilder('lib.model.map.EventMapBuilder');
}

View File

@@ -0,0 +1,424 @@
<?php
abstract class BaseLuEmployeePosition extends BaseObject implements Persistent {
protected static $peer;
protected $id;
protected $position;
protected $collEmployees;
protected $lastEmployeeCriteria = null;
protected $alreadyInSave = false;
protected $alreadyInValidation = false;
public function getId()
{
return $this->id;
}
public function getPosition()
{
return $this->position;
}
public function setId($v)
{
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = LuEmployeePositionPeer::ID;
}
}
public function setPosition($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->position !== $v) {
$this->position = $v;
$this->modifiedColumns[] = LuEmployeePositionPeer::POSITION;
}
}
public function hydrate(ResultSet $rs, $startcol = 1)
{
try {
$this->id = $rs->getInt($startcol + 0);
$this->position = $rs->getString($startcol + 1);
$this->resetModified();
$this->setNew(false);
return $startcol + 2;
} catch (Exception $e) {
throw new PropelException("Error populating LuEmployeePosition object", $e);
}
}
public function delete($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(LuEmployeePositionPeer::DATABASE_NAME);
}
try {
$con->begin();
LuEmployeePositionPeer::doDelete($this, $con);
$this->setDeleted(true);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public function save($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("You cannot save an object that has been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(LuEmployeePositionPeer::DATABASE_NAME);
}
try {
$con->begin();
$affectedRows = $this->doSave($con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
protected function doSave($con)
{
$affectedRows = 0; if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
if ($this->isModified()) {
if ($this->isNew()) {
$pk = LuEmployeePositionPeer::doInsert($this, $con);
$affectedRows += 1;
$this->setId($pk);
$this->setNew(false);
} else {
$affectedRows += LuEmployeePositionPeer::doUpdate($this, $con);
}
$this->resetModified(); }
if ($this->collEmployees !== null) {
foreach($this->collEmployees as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
}
$this->alreadyInSave = false;
}
return $affectedRows;
}
protected $validationFailures = array();
public function getValidationFailures()
{
return $this->validationFailures;
}
public function validate($columns = null)
{
$res = $this->doValidate($columns);
if ($res === true) {
$this->validationFailures = array();
return true;
} else {
$this->validationFailures = $res;
return false;
}
}
protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
if (($retval = LuEmployeePositionPeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
if ($this->collEmployees !== null) {
foreach($this->collEmployees as $referrerFK) {
if (!$referrerFK->validate($columns)) {
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
}
}
}
$this->alreadyInValidation = false;
}
return (!empty($failureMap) ? $failureMap : true);
}
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = LuEmployeePositionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->getByPosition($pos);
}
public function getByPosition($pos)
{
switch($pos) {
case 0:
return $this->getId();
break;
case 1:
return $this->getPosition();
break;
default:
return null;
break;
} }
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
{
$keys = LuEmployeePositionPeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getPosition(),
);
return $result;
}
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = LuEmployeePositionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
public function setByPosition($pos, $value)
{
switch($pos) {
case 0:
$this->setId($value);
break;
case 1:
$this->setPosition($value);
break;
} }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = LuEmployeePositionPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setPosition($arr[$keys[1]]);
}
public function buildCriteria()
{
$criteria = new Criteria(LuEmployeePositionPeer::DATABASE_NAME);
if ($this->isColumnModified(LuEmployeePositionPeer::ID)) $criteria->add(LuEmployeePositionPeer::ID, $this->id);
if ($this->isColumnModified(LuEmployeePositionPeer::POSITION)) $criteria->add(LuEmployeePositionPeer::POSITION, $this->position);
return $criteria;
}
public function buildPkeyCriteria()
{
$criteria = new Criteria(LuEmployeePositionPeer::DATABASE_NAME);
$criteria->add(LuEmployeePositionPeer::ID, $this->id);
return $criteria;
}
public function getPrimaryKey()
{
return $this->getId();
}
public function setPrimaryKey($key)
{
$this->setId($key);
}
public function copyInto($copyObj, $deepCopy = false)
{
$copyObj->setPosition($this->position);
if ($deepCopy) {
$copyObj->setNew(false);
foreach($this->getEmployees() as $relObj) {
$copyObj->addEmployee($relObj->copy($deepCopy));
}
}
$copyObj->setNew(true);
$copyObj->setId(NULL);
}
public function copy($deepCopy = false)
{
$clazz = get_class($this);
$copyObj = new $clazz();
$this->copyInto($copyObj, $deepCopy);
return $copyObj;
}
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new LuEmployeePositionPeer();
}
return self::$peer;
}
public function initEmployees()
{
if ($this->collEmployees === null) {
$this->collEmployees = array();
}
}
public function getEmployees($criteria = null, $con = null)
{
include_once 'lib/model/om/BaseEmployeePeer.php';
if ($criteria === null) {
$criteria = new Criteria();
}
elseif ($criteria instanceof Criteria)
{
$criteria = clone $criteria;
}
if ($this->collEmployees === null) {
if ($this->isNew()) {
$this->collEmployees = array();
} else {
$criteria->add(EmployeePeer::POSITION, $this->getId());
EmployeePeer::addSelectColumns($criteria);
$this->collEmployees = EmployeePeer::doSelect($criteria, $con);
}
} else {
if (!$this->isNew()) {
$criteria->add(EmployeePeer::POSITION, $this->getId());
EmployeePeer::addSelectColumns($criteria);
if (!isset($this->lastEmployeeCriteria) || !$this->lastEmployeeCriteria->equals($criteria)) {
$this->collEmployees = EmployeePeer::doSelect($criteria, $con);
}
}
}
$this->lastEmployeeCriteria = $criteria;
return $this->collEmployees;
}
public function countEmployees($criteria = null, $distinct = false, $con = null)
{
include_once 'lib/model/om/BaseEmployeePeer.php';
if ($criteria === null) {
$criteria = new Criteria();
}
elseif ($criteria instanceof Criteria)
{
$criteria = clone $criteria;
}
$criteria->add(EmployeePeer::POSITION, $this->getId());
return EmployeePeer::doCount($criteria, $distinct, $con);
}
public function addEmployee(Employee $l)
{
$this->collEmployees[] = $l;
$l->setLuEmployeePosition($this);
}
}

View File

@@ -0,0 +1,368 @@
<?php
abstract class BaseLuEmployeePositionPeer {
const DATABASE_NAME = 'propel';
const TABLE_NAME = 'LU_Employee_Position';
const CLASS_DEFAULT = 'lib.model.LuEmployeePosition';
const NUM_COLUMNS = 2;
const NUM_LAZY_LOAD_COLUMNS = 0;
const ID = 'LU_Employee_Position.ID';
const POSITION = 'LU_Employee_Position.POSITION';
private static $phpNameMap = null;
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Id', 'Position', ),
BasePeer::TYPE_COLNAME => array (LuEmployeePositionPeer::ID, LuEmployeePositionPeer::POSITION, ),
BasePeer::TYPE_FIELDNAME => array ('id', 'position', ),
BasePeer::TYPE_NUM => array (0, 1, )
);
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Position' => 1, ),
BasePeer::TYPE_COLNAME => array (LuEmployeePositionPeer::ID => 0, LuEmployeePositionPeer::POSITION => 1, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'position' => 1, ),
BasePeer::TYPE_NUM => array (0, 1, )
);
public static function getMapBuilder()
{
include_once 'lib/model/map/LuEmployeePositionMapBuilder.php';
return BasePeer::getMapBuilder('lib.model.map.LuEmployeePositionMapBuilder');
}
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = LuEmployeePositionPeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
public static function alias($alias, $column)
{
return str_replace(LuEmployeePositionPeer::TABLE_NAME.'.', $alias.'.', $column);
}
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(LuEmployeePositionPeer::ID);
$criteria->addSelectColumn(LuEmployeePositionPeer::POSITION);
}
const COUNT = 'COUNT(LU_Employee_Position.ID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT LU_Employee_Position.ID)';
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(LuEmployeePositionPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(LuEmployeePositionPeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$rs = LuEmployeePositionPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = LuEmployeePositionPeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
public static function doSelect(Criteria $criteria, $con = null)
{
return LuEmployeePositionPeer::populateObjects(LuEmployeePositionPeer::doSelectRS($criteria, $con));
}
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
LuEmployeePositionPeer::addSelectColumns($criteria);
}
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doSelect($criteria, $con);
}
public static function populateObjects(ResultSet $rs)
{
$results = array();
$cls = LuEmployeePositionPeer::getOMClass();
$cls = Propel::import($cls);
while($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
public static function getOMClass()
{
return LuEmployeePositionPeer::CLASS_DEFAULT;
}
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } else {
$criteria = $values->buildCriteria(); }
$criteria->remove(LuEmployeePositionPeer::ID);
$criteria->setDbName(self::DATABASE_NAME);
try {
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch(PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values;
$comparison = $criteria->getComparison(LuEmployeePositionPeer::ID);
$selectCriteria->add(LuEmployeePositionPeer::ID, $criteria->remove(LuEmployeePositionPeer::ID), $comparison);
} else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); }
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; try {
$con->begin();
$affectedRows += BasePeer::doDeleteAll(LuEmployeePositionPeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(LuEmployeePositionPeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } elseif ($values instanceof LuEmployeePosition) {
$criteria = $values->buildPkeyCriteria();
} else {
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(LuEmployeePositionPeer::ID, (array) $values, Criteria::IN);
}
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0;
try {
$con->begin();
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doValidate(LuEmployeePosition $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(LuEmployeePositionPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(LuEmployeePositionPeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
$res = BasePeer::doValidate(LuEmployeePositionPeer::DATABASE_NAME, LuEmployeePositionPeer::TABLE_NAME, $columns);
if ($res !== true) {
$request = sfContext::getInstance()->getRequest();
foreach ($res as $failed) {
$col = LuEmployeePositionPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
$request->setError($col, $failed->getMessage());
}
}
return $res;
}
public static function retrieveByPK($pk, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria(LuEmployeePositionPeer::DATABASE_NAME);
$criteria->add(LuEmployeePositionPeer::ID, $pk);
$v = LuEmployeePositionPeer::doSelect($criteria, $con);
return !empty($v) > 0 ? $v[0] : null;
}
public static function retrieveByPKs($pks, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria();
$criteria->add(LuEmployeePositionPeer::ID, $pks, Criteria::IN);
$objs = LuEmployeePositionPeer::doSelect($criteria, $con);
}
return $objs;
}
}
if (Propel::isInit()) {
try {
BaseLuEmployeePositionPeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
require_once 'lib/model/map/LuEmployeePositionMapBuilder.php';
Propel::registerMapBuilder('lib.model.map.LuEmployeePositionMapBuilder');
}

View File

@@ -0,0 +1,323 @@
<?php
abstract class BaseReference extends BaseObject implements Persistent {
protected static $peer;
protected $id;
protected $company_name;
protected $alreadyInSave = false;
protected $alreadyInValidation = false;
public function getId()
{
return $this->id;
}
public function getCompanyName()
{
return $this->company_name;
}
public function setId($v)
{
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = ReferencePeer::ID;
}
}
public function setCompanyName($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->company_name !== $v) {
$this->company_name = $v;
$this->modifiedColumns[] = ReferencePeer::COMPANY_NAME;
}
}
public function hydrate(ResultSet $rs, $startcol = 1)
{
try {
$this->id = $rs->getInt($startcol + 0);
$this->company_name = $rs->getString($startcol + 1);
$this->resetModified();
$this->setNew(false);
return $startcol + 2;
} catch (Exception $e) {
throw new PropelException("Error populating Reference object", $e);
}
}
public function delete($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(ReferencePeer::DATABASE_NAME);
}
try {
$con->begin();
ReferencePeer::doDelete($this, $con);
$this->setDeleted(true);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public function save($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("You cannot save an object that has been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(ReferencePeer::DATABASE_NAME);
}
try {
$con->begin();
$affectedRows = $this->doSave($con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
protected function doSave($con)
{
$affectedRows = 0; if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
if ($this->isModified()) {
if ($this->isNew()) {
$pk = ReferencePeer::doInsert($this, $con);
$affectedRows += 1;
$this->setId($pk);
$this->setNew(false);
} else {
$affectedRows += ReferencePeer::doUpdate($this, $con);
}
$this->resetModified(); }
$this->alreadyInSave = false;
}
return $affectedRows;
}
protected $validationFailures = array();
public function getValidationFailures()
{
return $this->validationFailures;
}
public function validate($columns = null)
{
$res = $this->doValidate($columns);
if ($res === true) {
$this->validationFailures = array();
return true;
} else {
$this->validationFailures = $res;
return false;
}
}
protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
if (($retval = ReferencePeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
$this->alreadyInValidation = false;
}
return (!empty($failureMap) ? $failureMap : true);
}
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = ReferencePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->getByPosition($pos);
}
public function getByPosition($pos)
{
switch($pos) {
case 0:
return $this->getId();
break;
case 1:
return $this->getCompanyName();
break;
default:
return null;
break;
} }
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
{
$keys = ReferencePeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getCompanyName(),
);
return $result;
}
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = ReferencePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
public function setByPosition($pos, $value)
{
switch($pos) {
case 0:
$this->setId($value);
break;
case 1:
$this->setCompanyName($value);
break;
} }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = ReferencePeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setCompanyName($arr[$keys[1]]);
}
public function buildCriteria()
{
$criteria = new Criteria(ReferencePeer::DATABASE_NAME);
if ($this->isColumnModified(ReferencePeer::ID)) $criteria->add(ReferencePeer::ID, $this->id);
if ($this->isColumnModified(ReferencePeer::COMPANY_NAME)) $criteria->add(ReferencePeer::COMPANY_NAME, $this->company_name);
return $criteria;
}
public function buildPkeyCriteria()
{
$criteria = new Criteria(ReferencePeer::DATABASE_NAME);
$criteria->add(ReferencePeer::ID, $this->id);
return $criteria;
}
public function getPrimaryKey()
{
return $this->getId();
}
public function setPrimaryKey($key)
{
$this->setId($key);
}
public function copyInto($copyObj, $deepCopy = false)
{
$copyObj->setCompanyName($this->company_name);
$copyObj->setNew(true);
$copyObj->setId(NULL);
}
public function copy($deepCopy = false)
{
$clazz = get_class($this);
$copyObj = new $clazz();
$this->copyInto($copyObj, $deepCopy);
return $copyObj;
}
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new ReferencePeer();
}
return self::$peer;
}
}

View File

@@ -0,0 +1,368 @@
<?php
abstract class BaseReferencePeer {
const DATABASE_NAME = 'propel';
const TABLE_NAME = 'Reference';
const CLASS_DEFAULT = 'lib.model.Reference';
const NUM_COLUMNS = 2;
const NUM_LAZY_LOAD_COLUMNS = 0;
const ID = 'Reference.ID';
const COMPANY_NAME = 'Reference.COMPANY_NAME';
private static $phpNameMap = null;
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Id', 'CompanyName', ),
BasePeer::TYPE_COLNAME => array (ReferencePeer::ID, ReferencePeer::COMPANY_NAME, ),
BasePeer::TYPE_FIELDNAME => array ('id', 'company_name', ),
BasePeer::TYPE_NUM => array (0, 1, )
);
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'CompanyName' => 1, ),
BasePeer::TYPE_COLNAME => array (ReferencePeer::ID => 0, ReferencePeer::COMPANY_NAME => 1, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'company_name' => 1, ),
BasePeer::TYPE_NUM => array (0, 1, )
);
public static function getMapBuilder()
{
include_once 'lib/model/map/ReferenceMapBuilder.php';
return BasePeer::getMapBuilder('lib.model.map.ReferenceMapBuilder');
}
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = ReferencePeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
public static function alias($alias, $column)
{
return str_replace(ReferencePeer::TABLE_NAME.'.', $alias.'.', $column);
}
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(ReferencePeer::ID);
$criteria->addSelectColumn(ReferencePeer::COMPANY_NAME);
}
const COUNT = 'COUNT(Reference.ID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT Reference.ID)';
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(ReferencePeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(ReferencePeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$rs = ReferencePeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = ReferencePeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
public static function doSelect(Criteria $criteria, $con = null)
{
return ReferencePeer::populateObjects(ReferencePeer::doSelectRS($criteria, $con));
}
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
ReferencePeer::addSelectColumns($criteria);
}
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doSelect($criteria, $con);
}
public static function populateObjects(ResultSet $rs)
{
$results = array();
$cls = ReferencePeer::getOMClass();
$cls = Propel::import($cls);
while($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
public static function getOMClass()
{
return ReferencePeer::CLASS_DEFAULT;
}
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } else {
$criteria = $values->buildCriteria(); }
$criteria->remove(ReferencePeer::ID);
$criteria->setDbName(self::DATABASE_NAME);
try {
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch(PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values;
$comparison = $criteria->getComparison(ReferencePeer::ID);
$selectCriteria->add(ReferencePeer::ID, $criteria->remove(ReferencePeer::ID), $comparison);
} else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); }
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; try {
$con->begin();
$affectedRows += BasePeer::doDeleteAll(ReferencePeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(ReferencePeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } elseif ($values instanceof Reference) {
$criteria = $values->buildPkeyCriteria();
} else {
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(ReferencePeer::ID, (array) $values, Criteria::IN);
}
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0;
try {
$con->begin();
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doValidate(Reference $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(ReferencePeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(ReferencePeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
$res = BasePeer::doValidate(ReferencePeer::DATABASE_NAME, ReferencePeer::TABLE_NAME, $columns);
if ($res !== true) {
$request = sfContext::getInstance()->getRequest();
foreach ($res as $failed) {
$col = ReferencePeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
$request->setError($col, $failed->getMessage());
}
}
return $res;
}
public static function retrieveByPK($pk, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria(ReferencePeer::DATABASE_NAME);
$criteria->add(ReferencePeer::ID, $pk);
$v = ReferencePeer::doSelect($criteria, $con);
return !empty($v) > 0 ? $v[0] : null;
}
public static function retrieveByPKs($pks, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria();
$criteria->add(ReferencePeer::ID, $pks, Criteria::IN);
$objs = ReferencePeer::doSelect($criteria, $con);
}
return $objs;
}
}
if (Propel::isInit()) {
try {
BaseReferencePeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
require_once 'lib/model/map/ReferenceMapBuilder.php';
Propel::registerMapBuilder('lib.model.map.ReferenceMapBuilder');
}

View File

@@ -0,0 +1,488 @@
<?php
abstract class BaseCourse extends BaseObject implements Persistent {
protected static $peer;
protected $id;
protected $slug;
protected $collCourseI18ns;
protected $lastCourseI18nCriteria = null;
protected $alreadyInSave = false;
protected $alreadyInValidation = false;
protected $culture;
public function getId()
{
return $this->id;
}
public function getSlug()
{
return $this->slug;
}
public function setId($v)
{
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = CoursePeer::ID;
}
}
public function setSlug($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->slug !== $v) {
$this->slug = $v;
$this->modifiedColumns[] = CoursePeer::SLUG;
}
}
public function hydrate(ResultSet $rs, $startcol = 1)
{
try {
$this->id = $rs->getInt($startcol + 0);
$this->slug = $rs->getString($startcol + 1);
$this->resetModified();
$this->setNew(false);
return $startcol + 2;
} catch (Exception $e) {
throw new PropelException("Error populating Course object", $e);
}
}
public function delete($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(CoursePeer::DATABASE_NAME);
}
try {
$con->begin();
CoursePeer::doDelete($this, $con);
$this->setDeleted(true);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public function save($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("You cannot save an object that has been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(CoursePeer::DATABASE_NAME);
}
try {
$con->begin();
$affectedRows = $this->doSave($con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
protected function doSave($con)
{
$affectedRows = 0; if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
if ($this->isModified()) {
if ($this->isNew()) {
$pk = CoursePeer::doInsert($this, $con);
$affectedRows += 1;
$this->setId($pk);
$this->setNew(false);
} else {
$affectedRows += CoursePeer::doUpdate($this, $con);
}
$this->resetModified(); }
if ($this->collCourseI18ns !== null) {
foreach($this->collCourseI18ns as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
}
$this->alreadyInSave = false;
}
return $affectedRows;
}
protected $validationFailures = array();
public function getValidationFailures()
{
return $this->validationFailures;
}
public function validate($columns = null)
{
$res = $this->doValidate($columns);
if ($res === true) {
$this->validationFailures = array();
return true;
} else {
$this->validationFailures = $res;
return false;
}
}
protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
if (($retval = CoursePeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
if ($this->collCourseI18ns !== null) {
foreach($this->collCourseI18ns as $referrerFK) {
if (!$referrerFK->validate($columns)) {
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
}
}
}
$this->alreadyInValidation = false;
}
return (!empty($failureMap) ? $failureMap : true);
}
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = CoursePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->getByPosition($pos);
}
public function getByPosition($pos)
{
switch($pos) {
case 0:
return $this->getId();
break;
case 1:
return $this->getSlug();
break;
default:
return null;
break;
} }
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
{
$keys = CoursePeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getSlug(),
);
return $result;
}
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = CoursePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
public function setByPosition($pos, $value)
{
switch($pos) {
case 0:
$this->setId($value);
break;
case 1:
$this->setSlug($value);
break;
} }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = CoursePeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setSlug($arr[$keys[1]]);
}
public function buildCriteria()
{
$criteria = new Criteria(CoursePeer::DATABASE_NAME);
if ($this->isColumnModified(CoursePeer::ID)) $criteria->add(CoursePeer::ID, $this->id);
if ($this->isColumnModified(CoursePeer::SLUG)) $criteria->add(CoursePeer::SLUG, $this->slug);
return $criteria;
}
public function buildPkeyCriteria()
{
$criteria = new Criteria(CoursePeer::DATABASE_NAME);
$criteria->add(CoursePeer::ID, $this->id);
return $criteria;
}
public function getPrimaryKey()
{
return $this->getId();
}
public function setPrimaryKey($key)
{
$this->setId($key);
}
public function copyInto($copyObj, $deepCopy = false)
{
$copyObj->setSlug($this->slug);
if ($deepCopy) {
$copyObj->setNew(false);
foreach($this->getCourseI18ns() as $relObj) {
$copyObj->addCourseI18n($relObj->copy($deepCopy));
}
}
$copyObj->setNew(true);
$copyObj->setId(NULL);
}
public function copy($deepCopy = false)
{
$clazz = get_class($this);
$copyObj = new $clazz();
$this->copyInto($copyObj, $deepCopy);
return $copyObj;
}
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new CoursePeer();
}
return self::$peer;
}
public function initCourseI18ns()
{
if ($this->collCourseI18ns === null) {
$this->collCourseI18ns = array();
}
}
public function getCourseI18ns($criteria = null, $con = null)
{
include_once 'lib/model/om/BaseCourseI18nPeer.php';
if ($criteria === null) {
$criteria = new Criteria();
}
elseif ($criteria instanceof Criteria)
{
$criteria = clone $criteria;
}
if ($this->collCourseI18ns === null) {
if ($this->isNew()) {
$this->collCourseI18ns = array();
} else {
$criteria->add(CourseI18nPeer::ID, $this->getId());
CourseI18nPeer::addSelectColumns($criteria);
$this->collCourseI18ns = CourseI18nPeer::doSelect($criteria, $con);
}
} else {
if (!$this->isNew()) {
$criteria->add(CourseI18nPeer::ID, $this->getId());
CourseI18nPeer::addSelectColumns($criteria);
if (!isset($this->lastCourseI18nCriteria) || !$this->lastCourseI18nCriteria->equals($criteria)) {
$this->collCourseI18ns = CourseI18nPeer::doSelect($criteria, $con);
}
}
}
$this->lastCourseI18nCriteria = $criteria;
return $this->collCourseI18ns;
}
public function countCourseI18ns($criteria = null, $distinct = false, $con = null)
{
include_once 'lib/model/om/BaseCourseI18nPeer.php';
if ($criteria === null) {
$criteria = new Criteria();
}
elseif ($criteria instanceof Criteria)
{
$criteria = clone $criteria;
}
$criteria->add(CourseI18nPeer::ID, $this->getId());
return CourseI18nPeer::doCount($criteria, $distinct, $con);
}
public function addCourseI18n(CourseI18n $l)
{
$this->collCourseI18ns[] = $l;
$l->setCourse($this);
}
public function getCulture()
{
return $this->culture;
}
public function setCulture($culture)
{
$this->culture = $culture;
}
public function getTitle()
{
$obj = $this->getCurrentCourseI18n();
return ($obj ? $obj->getTitle() : null);
}
public function setTitle($value)
{
$this->getCurrentCourseI18n()->setTitle($value);
}
public function getDescription()
{
$obj = $this->getCurrentCourseI18n();
return ($obj ? $obj->getDescription() : null);
}
public function setDescription($value)
{
$this->getCurrentCourseI18n()->setDescription($value);
}
protected $current_i18n = array();
public function getCurrentCourseI18n()
{
if (!isset($this->current_i18n[$this->culture]))
{
$obj = CourseI18nPeer::retrieveByPK($this->getId(), $this->culture);
if ($obj)
{
$this->setCourseI18nForCulture($obj, $this->culture);
}
else
{
$this->setCourseI18nForCulture(new CourseI18n(), $this->culture);
$this->current_i18n[$this->culture]->setCulture($this->culture);
}
}
return $this->current_i18n[$this->culture];
}
public function setCourseI18nForCulture($object, $culture)
{
$this->current_i18n[$culture] = $object;
$this->addCourseI18n($object);
}
}

View File

@@ -0,0 +1,465 @@
<?php
abstract class BaseCourseI18n extends BaseObject implements Persistent {
protected static $peer;
protected $title;
protected $description;
protected $id;
protected $culture;
protected $aCourse;
protected $alreadyInSave = false;
protected $alreadyInValidation = false;
public function getTitle()
{
return $this->title;
}
public function getDescription()
{
return $this->description;
}
public function getId()
{
return $this->id;
}
public function getCulture()
{
return $this->culture;
}
public function setTitle($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->title !== $v) {
$this->title = $v;
$this->modifiedColumns[] = CourseI18nPeer::TITLE;
}
}
public function setDescription($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->description !== $v) {
$this->description = $v;
$this->modifiedColumns[] = CourseI18nPeer::DESCRIPTION;
}
}
public function setId($v)
{
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = CourseI18nPeer::ID;
}
if ($this->aCourse !== null && $this->aCourse->getId() !== $v) {
$this->aCourse = null;
}
}
public function setCulture($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->culture !== $v) {
$this->culture = $v;
$this->modifiedColumns[] = CourseI18nPeer::CULTURE;
}
}
public function hydrate(ResultSet $rs, $startcol = 1)
{
try {
$this->title = $rs->getString($startcol + 0);
$this->description = $rs->getString($startcol + 1);
$this->id = $rs->getInt($startcol + 2);
$this->culture = $rs->getString($startcol + 3);
$this->resetModified();
$this->setNew(false);
return $startcol + 4;
} catch (Exception $e) {
throw new PropelException("Error populating CourseI18n object", $e);
}
}
public function delete($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(CourseI18nPeer::DATABASE_NAME);
}
try {
$con->begin();
CourseI18nPeer::doDelete($this, $con);
$this->setDeleted(true);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public function save($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("You cannot save an object that has been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(CourseI18nPeer::DATABASE_NAME);
}
try {
$con->begin();
$affectedRows = $this->doSave($con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
protected function doSave($con)
{
$affectedRows = 0; if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
if ($this->aCourse !== null) {
if ($this->aCourse->isModified() || $this->aCourse->getCurrentCourseI18n()->isModified()) {
$affectedRows += $this->aCourse->save($con);
}
$this->setCourse($this->aCourse);
}
if ($this->isModified()) {
if ($this->isNew()) {
$pk = CourseI18nPeer::doInsert($this, $con);
$affectedRows += 1;
$this->setNew(false);
} else {
$affectedRows += CourseI18nPeer::doUpdate($this, $con);
}
$this->resetModified(); }
$this->alreadyInSave = false;
}
return $affectedRows;
}
protected $validationFailures = array();
public function getValidationFailures()
{
return $this->validationFailures;
}
public function validate($columns = null)
{
$res = $this->doValidate($columns);
if ($res === true) {
$this->validationFailures = array();
return true;
} else {
$this->validationFailures = $res;
return false;
}
}
protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
if ($this->aCourse !== null) {
if (!$this->aCourse->validate($columns)) {
$failureMap = array_merge($failureMap, $this->aCourse->getValidationFailures());
}
}
if (($retval = CourseI18nPeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
$this->alreadyInValidation = false;
}
return (!empty($failureMap) ? $failureMap : true);
}
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = CourseI18nPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->getByPosition($pos);
}
public function getByPosition($pos)
{
switch($pos) {
case 0:
return $this->getTitle();
break;
case 1:
return $this->getDescription();
break;
case 2:
return $this->getId();
break;
case 3:
return $this->getCulture();
break;
default:
return null;
break;
} }
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
{
$keys = CourseI18nPeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getTitle(),
$keys[1] => $this->getDescription(),
$keys[2] => $this->getId(),
$keys[3] => $this->getCulture(),
);
return $result;
}
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = CourseI18nPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
public function setByPosition($pos, $value)
{
switch($pos) {
case 0:
$this->setTitle($value);
break;
case 1:
$this->setDescription($value);
break;
case 2:
$this->setId($value);
break;
case 3:
$this->setCulture($value);
break;
} }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = CourseI18nPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setTitle($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setDescription($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setId($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setCulture($arr[$keys[3]]);
}
public function buildCriteria()
{
$criteria = new Criteria(CourseI18nPeer::DATABASE_NAME);
if ($this->isColumnModified(CourseI18nPeer::TITLE)) $criteria->add(CourseI18nPeer::TITLE, $this->title);
if ($this->isColumnModified(CourseI18nPeer::DESCRIPTION)) $criteria->add(CourseI18nPeer::DESCRIPTION, $this->description);
if ($this->isColumnModified(CourseI18nPeer::ID)) $criteria->add(CourseI18nPeer::ID, $this->id);
if ($this->isColumnModified(CourseI18nPeer::CULTURE)) $criteria->add(CourseI18nPeer::CULTURE, $this->culture);
return $criteria;
}
public function buildPkeyCriteria()
{
$criteria = new Criteria(CourseI18nPeer::DATABASE_NAME);
$criteria->add(CourseI18nPeer::ID, $this->id);
$criteria->add(CourseI18nPeer::CULTURE, $this->culture);
return $criteria;
}
public function getPrimaryKey()
{
$pks = array();
$pks[0] = $this->getId();
$pks[1] = $this->getCulture();
return $pks;
}
public function setPrimaryKey($keys)
{
$this->setId($keys[0]);
$this->setCulture($keys[1]);
}
public function copyInto($copyObj, $deepCopy = false)
{
$copyObj->setTitle($this->title);
$copyObj->setDescription($this->description);
$copyObj->setNew(true);
$copyObj->setId(NULL);
$copyObj->setCulture(NULL);
}
public function copy($deepCopy = false)
{
$clazz = get_class($this);
$copyObj = new $clazz();
$this->copyInto($copyObj, $deepCopy);
return $copyObj;
}
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new CourseI18nPeer();
}
return self::$peer;
}
public function setCourse($v)
{
if ($v === null) {
$this->setId(NULL);
} else {
$this->setId($v->getId());
}
$this->aCourse = $v;
}
public function getCourse($con = null)
{
if ($this->aCourse === null && ($this->id !== null)) {
include_once 'lib/model/om/BaseCoursePeer.php';
$this->aCourse = CoursePeer::retrieveByPK($this->id, $con);
}
return $this->aCourse;
}
}

View File

@@ -0,0 +1,531 @@
<?php
abstract class BaseCourseI18nPeer {
const DATABASE_NAME = 'propel';
const TABLE_NAME = 'Course_i18n';
const CLASS_DEFAULT = 'lib.model.CourseI18n';
const NUM_COLUMNS = 4;
const NUM_LAZY_LOAD_COLUMNS = 0;
const TITLE = 'Course_i18n.TITLE';
const DESCRIPTION = 'Course_i18n.DESCRIPTION';
const ID = 'Course_i18n.ID';
const CULTURE = 'Course_i18n.CULTURE';
private static $phpNameMap = null;
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Title', 'Description', 'Id', 'Culture', ),
BasePeer::TYPE_COLNAME => array (CourseI18nPeer::TITLE, CourseI18nPeer::DESCRIPTION, CourseI18nPeer::ID, CourseI18nPeer::CULTURE, ),
BasePeer::TYPE_FIELDNAME => array ('title', 'description', 'id', 'culture', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Title' => 0, 'Description' => 1, 'Id' => 2, 'Culture' => 3, ),
BasePeer::TYPE_COLNAME => array (CourseI18nPeer::TITLE => 0, CourseI18nPeer::DESCRIPTION => 1, CourseI18nPeer::ID => 2, CourseI18nPeer::CULTURE => 3, ),
BasePeer::TYPE_FIELDNAME => array ('title' => 0, 'description' => 1, 'id' => 2, 'culture' => 3, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
public static function getMapBuilder()
{
include_once 'lib/model/map/CourseI18nMapBuilder.php';
return BasePeer::getMapBuilder('lib.model.map.CourseI18nMapBuilder');
}
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = CourseI18nPeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
public static function alias($alias, $column)
{
return str_replace(CourseI18nPeer::TABLE_NAME.'.', $alias.'.', $column);
}
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(CourseI18nPeer::TITLE);
$criteria->addSelectColumn(CourseI18nPeer::DESCRIPTION);
$criteria->addSelectColumn(CourseI18nPeer::ID);
$criteria->addSelectColumn(CourseI18nPeer::CULTURE);
}
const COUNT = 'COUNT(Course_i18n.ID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT Course_i18n.ID)';
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(CourseI18nPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(CourseI18nPeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$rs = CourseI18nPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = CourseI18nPeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
public static function doSelect(Criteria $criteria, $con = null)
{
return CourseI18nPeer::populateObjects(CourseI18nPeer::doSelectRS($criteria, $con));
}
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
CourseI18nPeer::addSelectColumns($criteria);
}
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doSelect($criteria, $con);
}
public static function populateObjects(ResultSet $rs)
{
$results = array();
$cls = CourseI18nPeer::getOMClass();
$cls = Propel::import($cls);
while($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
public static function doCountJoinCourse(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(CourseI18nPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(CourseI18nPeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(CourseI18nPeer::ID, CoursePeer::ID);
$rs = CourseI18nPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectJoinCourse(Criteria $c, $con = null)
{
$c = clone $c;
if ($c->getDbName() == Propel::getDefaultDB()) {
$c->setDbName(self::DATABASE_NAME);
}
CourseI18nPeer::addSelectColumns($c);
$startcol = (CourseI18nPeer::NUM_COLUMNS - CourseI18nPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
CoursePeer::addSelectColumns($c);
$c->addJoin(CourseI18nPeer::ID, CoursePeer::ID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = CourseI18nPeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$omClass = CoursePeer::getOMClass();
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol);
$newObject = true;
foreach($results as $temp_obj1) {
$temp_obj2 = $temp_obj1->getCourse(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
$temp_obj2->addCourseI18n($obj1); break;
}
}
if ($newObject) {
$obj2->initCourseI18ns();
$obj2->addCourseI18n($obj1); }
$results[] = $obj1;
}
return $results;
}
public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(CourseI18nPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(CourseI18nPeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(CourseI18nPeer::ID, CoursePeer::ID);
$rs = CourseI18nPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectJoinAll(Criteria $c, $con = null)
{
$c = clone $c;
if ($c->getDbName() == Propel::getDefaultDB()) {
$c->setDbName(self::DATABASE_NAME);
}
CourseI18nPeer::addSelectColumns($c);
$startcol2 = (CourseI18nPeer::NUM_COLUMNS - CourseI18nPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
CoursePeer::addSelectColumns($c);
$startcol3 = $startcol2 + CoursePeer::NUM_COLUMNS;
$c->addJoin(CourseI18nPeer::ID, CoursePeer::ID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = CourseI18nPeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$omClass = CoursePeer::getOMClass();
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol2);
$newObject = true;
for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
$temp_obj1 = $results[$j];
$temp_obj2 = $temp_obj1->getCourse(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
$temp_obj2->addCourseI18n($obj1); break;
}
}
if ($newObject) {
$obj2->initCourseI18ns();
$obj2->addCourseI18n($obj1);
}
$results[] = $obj1;
}
return $results;
}
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
public static function getOMClass()
{
return CourseI18nPeer::CLASS_DEFAULT;
}
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } else {
$criteria = $values->buildCriteria(); }
$criteria->setDbName(self::DATABASE_NAME);
try {
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch(PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values;
$comparison = $criteria->getComparison(CourseI18nPeer::ID);
$selectCriteria->add(CourseI18nPeer::ID, $criteria->remove(CourseI18nPeer::ID), $comparison);
$comparison = $criteria->getComparison(CourseI18nPeer::CULTURE);
$selectCriteria->add(CourseI18nPeer::CULTURE, $criteria->remove(CourseI18nPeer::CULTURE), $comparison);
} else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); }
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; try {
$con->begin();
$affectedRows += BasePeer::doDeleteAll(CourseI18nPeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(CourseI18nPeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } elseif ($values instanceof CourseI18n) {
$criteria = $values->buildPkeyCriteria();
} else {
$criteria = new Criteria(self::DATABASE_NAME);
if(count($values) == count($values, COUNT_RECURSIVE))
{
$values = array($values);
}
$vals = array();
foreach($values as $value)
{
$vals[0][] = $value[0];
$vals[1][] = $value[1];
}
$criteria->add(CourseI18nPeer::ID, $vals[0], Criteria::IN);
$criteria->add(CourseI18nPeer::CULTURE, $vals[1], Criteria::IN);
}
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0;
try {
$con->begin();
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doValidate(CourseI18n $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(CourseI18nPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(CourseI18nPeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
$res = BasePeer::doValidate(CourseI18nPeer::DATABASE_NAME, CourseI18nPeer::TABLE_NAME, $columns);
if ($res !== true) {
$request = sfContext::getInstance()->getRequest();
foreach ($res as $failed) {
$col = CourseI18nPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
$request->setError($col, $failed->getMessage());
}
}
return $res;
}
public static function retrieveByPK( $id, $culture, $con = null) {
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria();
$criteria->add(CourseI18nPeer::ID, $id);
$criteria->add(CourseI18nPeer::CULTURE, $culture);
$v = CourseI18nPeer::doSelect($criteria, $con);
return !empty($v) ? $v[0] : null;
}
}
if (Propel::isInit()) {
try {
BaseCourseI18nPeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
require_once 'lib/model/map/CourseI18nMapBuilder.php';
Propel::registerMapBuilder('lib.model.map.CourseI18nMapBuilder');
}

View File

@@ -0,0 +1,436 @@
<?php
abstract class BaseCoursePeer {
const DATABASE_NAME = 'propel';
const TABLE_NAME = 'Course';
const CLASS_DEFAULT = 'lib.model.Course';
const NUM_COLUMNS = 2;
const NUM_LAZY_LOAD_COLUMNS = 0;
const ID = 'Course.ID';
const SLUG = 'Course.SLUG';
private static $phpNameMap = null;
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Id', 'Slug', ),
BasePeer::TYPE_COLNAME => array (CoursePeer::ID, CoursePeer::SLUG, ),
BasePeer::TYPE_FIELDNAME => array ('id', 'slug', ),
BasePeer::TYPE_NUM => array (0, 1, )
);
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Slug' => 1, ),
BasePeer::TYPE_COLNAME => array (CoursePeer::ID => 0, CoursePeer::SLUG => 1, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'slug' => 1, ),
BasePeer::TYPE_NUM => array (0, 1, )
);
public static function getMapBuilder()
{
include_once 'lib/model/map/CourseMapBuilder.php';
return BasePeer::getMapBuilder('lib.model.map.CourseMapBuilder');
}
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = CoursePeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
public static function alias($alias, $column)
{
return str_replace(CoursePeer::TABLE_NAME.'.', $alias.'.', $column);
}
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(CoursePeer::ID);
$criteria->addSelectColumn(CoursePeer::SLUG);
}
const COUNT = 'COUNT(Course.ID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT Course.ID)';
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(CoursePeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(CoursePeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$rs = CoursePeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = CoursePeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
public static function doSelect(Criteria $criteria, $con = null)
{
return CoursePeer::populateObjects(CoursePeer::doSelectRS($criteria, $con));
}
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
CoursePeer::addSelectColumns($criteria);
}
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doSelect($criteria, $con);
}
public static function populateObjects(ResultSet $rs)
{
$results = array();
$cls = CoursePeer::getOMClass();
$cls = Propel::import($cls);
while($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
public static function doSelectWithI18n(Criteria $c, $culture = null, $con = null)
{
if ($culture === null)
{
$culture = sfContext::getInstance()->getUser()->getCulture();
}
if ($c->getDbName() == Propel::getDefaultDB())
{
$c->setDbName(self::DATABASE_NAME);
}
CoursePeer::addSelectColumns($c);
$startcol = (CoursePeer::NUM_COLUMNS - CoursePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
CourseI18nPeer::addSelectColumns($c);
$c->addJoin(CoursePeer::ID, CourseI18nPeer::ID);
$c->add(CourseI18nPeer::CULTURE, $culture);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = CoursePeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$obj1->setCulture($culture);
$omClass = CourseI18nPeer::getOMClass($rs, $startcol);
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol);
$obj1->setCourseI18nForCulture($obj2, $culture);
$obj2->setCourse($obj1);
$results[] = $obj1;
}
return $results;
}
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
public static function getOMClass()
{
return CoursePeer::CLASS_DEFAULT;
}
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } else {
$criteria = $values->buildCriteria(); }
$criteria->remove(CoursePeer::ID);
$criteria->setDbName(self::DATABASE_NAME);
try {
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch(PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values;
$comparison = $criteria->getComparison(CoursePeer::ID);
$selectCriteria->add(CoursePeer::ID, $criteria->remove(CoursePeer::ID), $comparison);
} else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); }
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; try {
$con->begin();
$affectedRows += CoursePeer::doOnDeleteCascade(new Criteria(), $con);
$affectedRows += BasePeer::doDeleteAll(CoursePeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(CoursePeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } elseif ($values instanceof Course) {
$criteria = $values->buildPkeyCriteria();
} else {
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(CoursePeer::ID, (array) $values, Criteria::IN);
}
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0;
try {
$con->begin();
$affectedRows += CoursePeer::doOnDeleteCascade($criteria, $con);
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
protected static function doOnDeleteCascade(Criteria $criteria, Connection $con)
{
$affectedRows = 0;
$objects = CoursePeer::doSelect($criteria, $con);
foreach($objects as $obj) {
include_once 'lib/model/CourseI18n.php';
$c = new Criteria();
$c->add(CourseI18nPeer::ID, $obj->getId());
$affectedRows += CourseI18nPeer::doDelete($c, $con);
}
return $affectedRows;
}
public static function doValidate(Course $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(CoursePeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(CoursePeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
$res = BasePeer::doValidate(CoursePeer::DATABASE_NAME, CoursePeer::TABLE_NAME, $columns);
if ($res !== true) {
$request = sfContext::getInstance()->getRequest();
foreach ($res as $failed) {
$col = CoursePeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
$request->setError($col, $failed->getMessage());
}
}
return $res;
}
public static function retrieveByPK($pk, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria(CoursePeer::DATABASE_NAME);
$criteria->add(CoursePeer::ID, $pk);
$v = CoursePeer::doSelect($criteria, $con);
return !empty($v) > 0 ? $v[0] : null;
}
public static function retrieveByPKs($pks, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria();
$criteria->add(CoursePeer::ID, $pks, Criteria::IN);
$objs = CoursePeer::doSelect($criteria, $con);
}
return $objs;
}
}
if (Propel::isInit()) {
try {
BaseCoursePeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
require_once 'lib/model/map/CourseMapBuilder.php';
Propel::registerMapBuilder('lib.model.map.CourseMapBuilder');
}

View File

@@ -0,0 +1,875 @@
<?php
abstract class BaseEmployee extends BaseObject implements Persistent {
protected static $peer;
protected $id;
protected $name;
protected $degrees;
protected $phone;
protected $cellphone;
protected $email;
protected $picture;
protected $active;
protected $position;
protected $slug;
protected $sort_order;
protected $aLuEmployeePosition;
protected $collEmployeeI18ns;
protected $lastEmployeeI18nCriteria = null;
protected $alreadyInSave = false;
protected $alreadyInValidation = false;
protected $culture;
public function getId()
{
return $this->id;
}
public function getName()
{
return $this->name;
}
public function getDegrees()
{
return $this->degrees;
}
public function getPhone()
{
return $this->phone;
}
public function getCellphone()
{
return $this->cellphone;
}
public function getEmail()
{
return $this->email;
}
public function getPicture()
{
return $this->picture;
}
public function getActive()
{
return $this->active;
}
public function getPosition()
{
return $this->position;
}
public function getSlug()
{
return $this->slug;
}
public function getSortOrder()
{
return $this->sort_order;
}
public function setId($v)
{
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = EmployeePeer::ID;
}
}
public function setName($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->name !== $v) {
$this->name = $v;
$this->modifiedColumns[] = EmployeePeer::NAME;
}
}
public function setDegrees($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->degrees !== $v) {
$this->degrees = $v;
$this->modifiedColumns[] = EmployeePeer::DEGREES;
}
}
public function setPhone($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->phone !== $v) {
$this->phone = $v;
$this->modifiedColumns[] = EmployeePeer::PHONE;
}
}
public function setCellphone($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->cellphone !== $v) {
$this->cellphone = $v;
$this->modifiedColumns[] = EmployeePeer::CELLPHONE;
}
}
public function setEmail($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->email !== $v) {
$this->email = $v;
$this->modifiedColumns[] = EmployeePeer::EMAIL;
}
}
public function setPicture($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->picture !== $v) {
$this->picture = $v;
$this->modifiedColumns[] = EmployeePeer::PICTURE;
}
}
public function setActive($v)
{
if ($this->active !== $v) {
$this->active = $v;
$this->modifiedColumns[] = EmployeePeer::ACTIVE;
}
}
public function setPosition($v)
{
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->position !== $v) {
$this->position = $v;
$this->modifiedColumns[] = EmployeePeer::POSITION;
}
if ($this->aLuEmployeePosition !== null && $this->aLuEmployeePosition->getId() !== $v) {
$this->aLuEmployeePosition = null;
}
}
public function setSlug($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->slug !== $v) {
$this->slug = $v;
$this->modifiedColumns[] = EmployeePeer::SLUG;
}
}
public function setSortOrder($v)
{
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->sort_order !== $v) {
$this->sort_order = $v;
$this->modifiedColumns[] = EmployeePeer::SORT_ORDER;
}
}
public function hydrate(ResultSet $rs, $startcol = 1)
{
try {
$this->id = $rs->getInt($startcol + 0);
$this->name = $rs->getString($startcol + 1);
$this->degrees = $rs->getString($startcol + 2);
$this->phone = $rs->getString($startcol + 3);
$this->cellphone = $rs->getString($startcol + 4);
$this->email = $rs->getString($startcol + 5);
$this->picture = $rs->getString($startcol + 6);
$this->active = $rs->getBoolean($startcol + 7);
$this->position = $rs->getInt($startcol + 8);
$this->slug = $rs->getString($startcol + 9);
$this->sort_order = $rs->getInt($startcol + 10);
$this->resetModified();
$this->setNew(false);
return $startcol + 11;
} catch (Exception $e) {
throw new PropelException("Error populating Employee object", $e);
}
}
public function delete($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(EmployeePeer::DATABASE_NAME);
}
try {
$con->begin();
EmployeePeer::doDelete($this, $con);
$this->setDeleted(true);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public function save($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("You cannot save an object that has been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(EmployeePeer::DATABASE_NAME);
}
try {
$con->begin();
$affectedRows = $this->doSave($con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
protected function doSave($con)
{
$affectedRows = 0; if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
if ($this->aLuEmployeePosition !== null) {
if ($this->aLuEmployeePosition->isModified()) {
$affectedRows += $this->aLuEmployeePosition->save($con);
}
$this->setLuEmployeePosition($this->aLuEmployeePosition);
}
if ($this->isModified()) {
if ($this->isNew()) {
$pk = EmployeePeer::doInsert($this, $con);
$affectedRows += 1;
$this->setId($pk);
$this->setNew(false);
} else {
$affectedRows += EmployeePeer::doUpdate($this, $con);
}
$this->resetModified(); }
if ($this->collEmployeeI18ns !== null) {
foreach($this->collEmployeeI18ns as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
}
$this->alreadyInSave = false;
}
return $affectedRows;
}
protected $validationFailures = array();
public function getValidationFailures()
{
return $this->validationFailures;
}
public function validate($columns = null)
{
$res = $this->doValidate($columns);
if ($res === true) {
$this->validationFailures = array();
return true;
} else {
$this->validationFailures = $res;
return false;
}
}
protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
if ($this->aLuEmployeePosition !== null) {
if (!$this->aLuEmployeePosition->validate($columns)) {
$failureMap = array_merge($failureMap, $this->aLuEmployeePosition->getValidationFailures());
}
}
if (($retval = EmployeePeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
if ($this->collEmployeeI18ns !== null) {
foreach($this->collEmployeeI18ns as $referrerFK) {
if (!$referrerFK->validate($columns)) {
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
}
}
}
$this->alreadyInValidation = false;
}
return (!empty($failureMap) ? $failureMap : true);
}
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = EmployeePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->getByPosition($pos);
}
public function getByPosition($pos)
{
switch($pos) {
case 0:
return $this->getId();
break;
case 1:
return $this->getName();
break;
case 2:
return $this->getDegrees();
break;
case 3:
return $this->getPhone();
break;
case 4:
return $this->getCellphone();
break;
case 5:
return $this->getEmail();
break;
case 6:
return $this->getPicture();
break;
case 7:
return $this->getActive();
break;
case 8:
return $this->getPosition();
break;
case 9:
return $this->getSlug();
break;
case 10:
return $this->getSortOrder();
break;
default:
return null;
break;
} }
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
{
$keys = EmployeePeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getName(),
$keys[2] => $this->getDegrees(),
$keys[3] => $this->getPhone(),
$keys[4] => $this->getCellphone(),
$keys[5] => $this->getEmail(),
$keys[6] => $this->getPicture(),
$keys[7] => $this->getActive(),
$keys[8] => $this->getPosition(),
$keys[9] => $this->getSlug(),
$keys[10] => $this->getSortOrder(),
);
return $result;
}
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = EmployeePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
public function setByPosition($pos, $value)
{
switch($pos) {
case 0:
$this->setId($value);
break;
case 1:
$this->setName($value);
break;
case 2:
$this->setDegrees($value);
break;
case 3:
$this->setPhone($value);
break;
case 4:
$this->setCellphone($value);
break;
case 5:
$this->setEmail($value);
break;
case 6:
$this->setPicture($value);
break;
case 7:
$this->setActive($value);
break;
case 8:
$this->setPosition($value);
break;
case 9:
$this->setSlug($value);
break;
case 10:
$this->setSortOrder($value);
break;
} }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = EmployeePeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setName($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setDegrees($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setPhone($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setCellphone($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setEmail($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setPicture($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setActive($arr[$keys[7]]);
if (array_key_exists($keys[8], $arr)) $this->setPosition($arr[$keys[8]]);
if (array_key_exists($keys[9], $arr)) $this->setSlug($arr[$keys[9]]);
if (array_key_exists($keys[10], $arr)) $this->setSortOrder($arr[$keys[10]]);
}
public function buildCriteria()
{
$criteria = new Criteria(EmployeePeer::DATABASE_NAME);
if ($this->isColumnModified(EmployeePeer::ID)) $criteria->add(EmployeePeer::ID, $this->id);
if ($this->isColumnModified(EmployeePeer::NAME)) $criteria->add(EmployeePeer::NAME, $this->name);
if ($this->isColumnModified(EmployeePeer::DEGREES)) $criteria->add(EmployeePeer::DEGREES, $this->degrees);
if ($this->isColumnModified(EmployeePeer::PHONE)) $criteria->add(EmployeePeer::PHONE, $this->phone);
if ($this->isColumnModified(EmployeePeer::CELLPHONE)) $criteria->add(EmployeePeer::CELLPHONE, $this->cellphone);
if ($this->isColumnModified(EmployeePeer::EMAIL)) $criteria->add(EmployeePeer::EMAIL, $this->email);
if ($this->isColumnModified(EmployeePeer::PICTURE)) $criteria->add(EmployeePeer::PICTURE, $this->picture);
if ($this->isColumnModified(EmployeePeer::ACTIVE)) $criteria->add(EmployeePeer::ACTIVE, $this->active);
if ($this->isColumnModified(EmployeePeer::POSITION)) $criteria->add(EmployeePeer::POSITION, $this->position);
if ($this->isColumnModified(EmployeePeer::SLUG)) $criteria->add(EmployeePeer::SLUG, $this->slug);
if ($this->isColumnModified(EmployeePeer::SORT_ORDER)) $criteria->add(EmployeePeer::SORT_ORDER, $this->sort_order);
return $criteria;
}
public function buildPkeyCriteria()
{
$criteria = new Criteria(EmployeePeer::DATABASE_NAME);
$criteria->add(EmployeePeer::ID, $this->id);
return $criteria;
}
public function getPrimaryKey()
{
return $this->getId();
}
public function setPrimaryKey($key)
{
$this->setId($key);
}
public function copyInto($copyObj, $deepCopy = false)
{
$copyObj->setName($this->name);
$copyObj->setDegrees($this->degrees);
$copyObj->setPhone($this->phone);
$copyObj->setCellphone($this->cellphone);
$copyObj->setEmail($this->email);
$copyObj->setPicture($this->picture);
$copyObj->setActive($this->active);
$copyObj->setPosition($this->position);
$copyObj->setSlug($this->slug);
$copyObj->setSortOrder($this->sort_order);
if ($deepCopy) {
$copyObj->setNew(false);
foreach($this->getEmployeeI18ns() as $relObj) {
$copyObj->addEmployeeI18n($relObj->copy($deepCopy));
}
}
$copyObj->setNew(true);
$copyObj->setId(NULL);
}
public function copy($deepCopy = false)
{
$clazz = get_class($this);
$copyObj = new $clazz();
$this->copyInto($copyObj, $deepCopy);
return $copyObj;
}
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new EmployeePeer();
}
return self::$peer;
}
public function setLuEmployeePosition($v)
{
if ($v === null) {
$this->setPosition(NULL);
} else {
$this->setPosition($v->getId());
}
$this->aLuEmployeePosition = $v;
}
public function getLuEmployeePosition($con = null)
{
if ($this->aLuEmployeePosition === null && ($this->position !== null)) {
include_once 'lib/model/om/BaseLuEmployeePositionPeer.php';
$this->aLuEmployeePosition = LuEmployeePositionPeer::retrieveByPK($this->position, $con);
}
return $this->aLuEmployeePosition;
}
public function initEmployeeI18ns()
{
if ($this->collEmployeeI18ns === null) {
$this->collEmployeeI18ns = array();
}
}
public function getEmployeeI18ns($criteria = null, $con = null)
{
include_once 'lib/model/om/BaseEmployeeI18nPeer.php';
if ($criteria === null) {
$criteria = new Criteria();
}
elseif ($criteria instanceof Criteria)
{
$criteria = clone $criteria;
}
if ($this->collEmployeeI18ns === null) {
if ($this->isNew()) {
$this->collEmployeeI18ns = array();
} else {
$criteria->add(EmployeeI18nPeer::ID, $this->getId());
EmployeeI18nPeer::addSelectColumns($criteria);
$this->collEmployeeI18ns = EmployeeI18nPeer::doSelect($criteria, $con);
}
} else {
if (!$this->isNew()) {
$criteria->add(EmployeeI18nPeer::ID, $this->getId());
EmployeeI18nPeer::addSelectColumns($criteria);
if (!isset($this->lastEmployeeI18nCriteria) || !$this->lastEmployeeI18nCriteria->equals($criteria)) {
$this->collEmployeeI18ns = EmployeeI18nPeer::doSelect($criteria, $con);
}
}
}
$this->lastEmployeeI18nCriteria = $criteria;
return $this->collEmployeeI18ns;
}
public function countEmployeeI18ns($criteria = null, $distinct = false, $con = null)
{
include_once 'lib/model/om/BaseEmployeeI18nPeer.php';
if ($criteria === null) {
$criteria = new Criteria();
}
elseif ($criteria instanceof Criteria)
{
$criteria = clone $criteria;
}
$criteria->add(EmployeeI18nPeer::ID, $this->getId());
return EmployeeI18nPeer::doCount($criteria, $distinct, $con);
}
public function addEmployeeI18n(EmployeeI18n $l)
{
$this->collEmployeeI18ns[] = $l;
$l->setEmployee($this);
}
public function getCulture()
{
return $this->culture;
}
public function setCulture($culture)
{
$this->culture = $culture;
}
public function getBiography()
{
$obj = $this->getCurrentEmployeeI18n();
return ($obj ? $obj->getBiography() : null);
}
public function setBiography($value)
{
$this->getCurrentEmployeeI18n()->setBiography($value);
}
public function getTitle()
{
$obj = $this->getCurrentEmployeeI18n();
return ($obj ? $obj->getTitle() : null);
}
public function setTitle($value)
{
$this->getCurrentEmployeeI18n()->setTitle($value);
}
protected $current_i18n = array();
public function getCurrentEmployeeI18n()
{
if (!isset($this->current_i18n[$this->culture]))
{
$obj = EmployeeI18nPeer::retrieveByPK($this->getId(), $this->culture);
if ($obj)
{
$this->setEmployeeI18nForCulture($obj, $this->culture);
}
else
{
$this->setEmployeeI18nForCulture(new EmployeeI18n(), $this->culture);
$this->current_i18n[$this->culture]->setCulture($this->culture);
}
}
return $this->current_i18n[$this->culture];
}
public function setEmployeeI18nForCulture($object, $culture)
{
$this->current_i18n[$culture] = $object;
$this->addEmployeeI18n($object);
}
}

View File

@@ -0,0 +1,465 @@
<?php
abstract class BaseEmployeeI18n extends BaseObject implements Persistent {
protected static $peer;
protected $biography;
protected $title;
protected $id;
protected $culture;
protected $aEmployee;
protected $alreadyInSave = false;
protected $alreadyInValidation = false;
public function getBiography()
{
return $this->biography;
}
public function getTitle()
{
return $this->title;
}
public function getId()
{
return $this->id;
}
public function getCulture()
{
return $this->culture;
}
public function setBiography($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->biography !== $v) {
$this->biography = $v;
$this->modifiedColumns[] = EmployeeI18nPeer::BIOGRAPHY;
}
}
public function setTitle($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->title !== $v) {
$this->title = $v;
$this->modifiedColumns[] = EmployeeI18nPeer::TITLE;
}
}
public function setId($v)
{
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = EmployeeI18nPeer::ID;
}
if ($this->aEmployee !== null && $this->aEmployee->getId() !== $v) {
$this->aEmployee = null;
}
}
public function setCulture($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->culture !== $v) {
$this->culture = $v;
$this->modifiedColumns[] = EmployeeI18nPeer::CULTURE;
}
}
public function hydrate(ResultSet $rs, $startcol = 1)
{
try {
$this->biography = $rs->getString($startcol + 0);
$this->title = $rs->getString($startcol + 1);
$this->id = $rs->getInt($startcol + 2);
$this->culture = $rs->getString($startcol + 3);
$this->resetModified();
$this->setNew(false);
return $startcol + 4;
} catch (Exception $e) {
throw new PropelException("Error populating EmployeeI18n object", $e);
}
}
public function delete($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(EmployeeI18nPeer::DATABASE_NAME);
}
try {
$con->begin();
EmployeeI18nPeer::doDelete($this, $con);
$this->setDeleted(true);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public function save($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("You cannot save an object that has been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(EmployeeI18nPeer::DATABASE_NAME);
}
try {
$con->begin();
$affectedRows = $this->doSave($con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
protected function doSave($con)
{
$affectedRows = 0; if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
if ($this->aEmployee !== null) {
if ($this->aEmployee->isModified() || $this->aEmployee->getCurrentEmployeeI18n()->isModified()) {
$affectedRows += $this->aEmployee->save($con);
}
$this->setEmployee($this->aEmployee);
}
if ($this->isModified()) {
if ($this->isNew()) {
$pk = EmployeeI18nPeer::doInsert($this, $con);
$affectedRows += 1;
$this->setNew(false);
} else {
$affectedRows += EmployeeI18nPeer::doUpdate($this, $con);
}
$this->resetModified(); }
$this->alreadyInSave = false;
}
return $affectedRows;
}
protected $validationFailures = array();
public function getValidationFailures()
{
return $this->validationFailures;
}
public function validate($columns = null)
{
$res = $this->doValidate($columns);
if ($res === true) {
$this->validationFailures = array();
return true;
} else {
$this->validationFailures = $res;
return false;
}
}
protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
if ($this->aEmployee !== null) {
if (!$this->aEmployee->validate($columns)) {
$failureMap = array_merge($failureMap, $this->aEmployee->getValidationFailures());
}
}
if (($retval = EmployeeI18nPeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
$this->alreadyInValidation = false;
}
return (!empty($failureMap) ? $failureMap : true);
}
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = EmployeeI18nPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->getByPosition($pos);
}
public function getByPosition($pos)
{
switch($pos) {
case 0:
return $this->getBiography();
break;
case 1:
return $this->getTitle();
break;
case 2:
return $this->getId();
break;
case 3:
return $this->getCulture();
break;
default:
return null;
break;
} }
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
{
$keys = EmployeeI18nPeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getBiography(),
$keys[1] => $this->getTitle(),
$keys[2] => $this->getId(),
$keys[3] => $this->getCulture(),
);
return $result;
}
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = EmployeeI18nPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
public function setByPosition($pos, $value)
{
switch($pos) {
case 0:
$this->setBiography($value);
break;
case 1:
$this->setTitle($value);
break;
case 2:
$this->setId($value);
break;
case 3:
$this->setCulture($value);
break;
} }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = EmployeeI18nPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setBiography($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setTitle($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setId($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setCulture($arr[$keys[3]]);
}
public function buildCriteria()
{
$criteria = new Criteria(EmployeeI18nPeer::DATABASE_NAME);
if ($this->isColumnModified(EmployeeI18nPeer::BIOGRAPHY)) $criteria->add(EmployeeI18nPeer::BIOGRAPHY, $this->biography);
if ($this->isColumnModified(EmployeeI18nPeer::TITLE)) $criteria->add(EmployeeI18nPeer::TITLE, $this->title);
if ($this->isColumnModified(EmployeeI18nPeer::ID)) $criteria->add(EmployeeI18nPeer::ID, $this->id);
if ($this->isColumnModified(EmployeeI18nPeer::CULTURE)) $criteria->add(EmployeeI18nPeer::CULTURE, $this->culture);
return $criteria;
}
public function buildPkeyCriteria()
{
$criteria = new Criteria(EmployeeI18nPeer::DATABASE_NAME);
$criteria->add(EmployeeI18nPeer::ID, $this->id);
$criteria->add(EmployeeI18nPeer::CULTURE, $this->culture);
return $criteria;
}
public function getPrimaryKey()
{
$pks = array();
$pks[0] = $this->getId();
$pks[1] = $this->getCulture();
return $pks;
}
public function setPrimaryKey($keys)
{
$this->setId($keys[0]);
$this->setCulture($keys[1]);
}
public function copyInto($copyObj, $deepCopy = false)
{
$copyObj->setBiography($this->biography);
$copyObj->setTitle($this->title);
$copyObj->setNew(true);
$copyObj->setId(NULL);
$copyObj->setCulture(NULL);
}
public function copy($deepCopy = false)
{
$clazz = get_class($this);
$copyObj = new $clazz();
$this->copyInto($copyObj, $deepCopy);
return $copyObj;
}
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new EmployeeI18nPeer();
}
return self::$peer;
}
public function setEmployee($v)
{
if ($v === null) {
$this->setId(NULL);
} else {
$this->setId($v->getId());
}
$this->aEmployee = $v;
}
public function getEmployee($con = null)
{
if ($this->aEmployee === null && ($this->id !== null)) {
include_once 'lib/model/om/BaseEmployeePeer.php';
$this->aEmployee = EmployeePeer::retrieveByPK($this->id, $con);
}
return $this->aEmployee;
}
}

View File

@@ -0,0 +1,531 @@
<?php
abstract class BaseEmployeeI18nPeer {
const DATABASE_NAME = 'propel';
const TABLE_NAME = 'Employee_i18n';
const CLASS_DEFAULT = 'lib.model.EmployeeI18n';
const NUM_COLUMNS = 4;
const NUM_LAZY_LOAD_COLUMNS = 0;
const BIOGRAPHY = 'Employee_i18n.BIOGRAPHY';
const TITLE = 'Employee_i18n.TITLE';
const ID = 'Employee_i18n.ID';
const CULTURE = 'Employee_i18n.CULTURE';
private static $phpNameMap = null;
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Biography', 'Title', 'Id', 'Culture', ),
BasePeer::TYPE_COLNAME => array (EmployeeI18nPeer::BIOGRAPHY, EmployeeI18nPeer::TITLE, EmployeeI18nPeer::ID, EmployeeI18nPeer::CULTURE, ),
BasePeer::TYPE_FIELDNAME => array ('biography', 'title', 'id', 'culture', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Biography' => 0, 'Title' => 1, 'Id' => 2, 'Culture' => 3, ),
BasePeer::TYPE_COLNAME => array (EmployeeI18nPeer::BIOGRAPHY => 0, EmployeeI18nPeer::TITLE => 1, EmployeeI18nPeer::ID => 2, EmployeeI18nPeer::CULTURE => 3, ),
BasePeer::TYPE_FIELDNAME => array ('biography' => 0, 'title' => 1, 'id' => 2, 'culture' => 3, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
public static function getMapBuilder()
{
include_once 'lib/model/map/EmployeeI18nMapBuilder.php';
return BasePeer::getMapBuilder('lib.model.map.EmployeeI18nMapBuilder');
}
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = EmployeeI18nPeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
public static function alias($alias, $column)
{
return str_replace(EmployeeI18nPeer::TABLE_NAME.'.', $alias.'.', $column);
}
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(EmployeeI18nPeer::BIOGRAPHY);
$criteria->addSelectColumn(EmployeeI18nPeer::TITLE);
$criteria->addSelectColumn(EmployeeI18nPeer::ID);
$criteria->addSelectColumn(EmployeeI18nPeer::CULTURE);
}
const COUNT = 'COUNT(Employee_i18n.ID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT Employee_i18n.ID)';
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(EmployeeI18nPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(EmployeeI18nPeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$rs = EmployeeI18nPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = EmployeeI18nPeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
public static function doSelect(Criteria $criteria, $con = null)
{
return EmployeeI18nPeer::populateObjects(EmployeeI18nPeer::doSelectRS($criteria, $con));
}
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
EmployeeI18nPeer::addSelectColumns($criteria);
}
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doSelect($criteria, $con);
}
public static function populateObjects(ResultSet $rs)
{
$results = array();
$cls = EmployeeI18nPeer::getOMClass();
$cls = Propel::import($cls);
while($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
public static function doCountJoinEmployee(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(EmployeeI18nPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(EmployeeI18nPeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(EmployeeI18nPeer::ID, EmployeePeer::ID);
$rs = EmployeeI18nPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectJoinEmployee(Criteria $c, $con = null)
{
$c = clone $c;
if ($c->getDbName() == Propel::getDefaultDB()) {
$c->setDbName(self::DATABASE_NAME);
}
EmployeeI18nPeer::addSelectColumns($c);
$startcol = (EmployeeI18nPeer::NUM_COLUMNS - EmployeeI18nPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
EmployeePeer::addSelectColumns($c);
$c->addJoin(EmployeeI18nPeer::ID, EmployeePeer::ID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = EmployeeI18nPeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$omClass = EmployeePeer::getOMClass();
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol);
$newObject = true;
foreach($results as $temp_obj1) {
$temp_obj2 = $temp_obj1->getEmployee(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
$temp_obj2->addEmployeeI18n($obj1); break;
}
}
if ($newObject) {
$obj2->initEmployeeI18ns();
$obj2->addEmployeeI18n($obj1); }
$results[] = $obj1;
}
return $results;
}
public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(EmployeeI18nPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(EmployeeI18nPeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(EmployeeI18nPeer::ID, EmployeePeer::ID);
$rs = EmployeeI18nPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectJoinAll(Criteria $c, $con = null)
{
$c = clone $c;
if ($c->getDbName() == Propel::getDefaultDB()) {
$c->setDbName(self::DATABASE_NAME);
}
EmployeeI18nPeer::addSelectColumns($c);
$startcol2 = (EmployeeI18nPeer::NUM_COLUMNS - EmployeeI18nPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
EmployeePeer::addSelectColumns($c);
$startcol3 = $startcol2 + EmployeePeer::NUM_COLUMNS;
$c->addJoin(EmployeeI18nPeer::ID, EmployeePeer::ID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = EmployeeI18nPeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$omClass = EmployeePeer::getOMClass();
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol2);
$newObject = true;
for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
$temp_obj1 = $results[$j];
$temp_obj2 = $temp_obj1->getEmployee(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
$temp_obj2->addEmployeeI18n($obj1); break;
}
}
if ($newObject) {
$obj2->initEmployeeI18ns();
$obj2->addEmployeeI18n($obj1);
}
$results[] = $obj1;
}
return $results;
}
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
public static function getOMClass()
{
return EmployeeI18nPeer::CLASS_DEFAULT;
}
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } else {
$criteria = $values->buildCriteria(); }
$criteria->setDbName(self::DATABASE_NAME);
try {
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch(PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values;
$comparison = $criteria->getComparison(EmployeeI18nPeer::ID);
$selectCriteria->add(EmployeeI18nPeer::ID, $criteria->remove(EmployeeI18nPeer::ID), $comparison);
$comparison = $criteria->getComparison(EmployeeI18nPeer::CULTURE);
$selectCriteria->add(EmployeeI18nPeer::CULTURE, $criteria->remove(EmployeeI18nPeer::CULTURE), $comparison);
} else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); }
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; try {
$con->begin();
$affectedRows += BasePeer::doDeleteAll(EmployeeI18nPeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(EmployeeI18nPeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } elseif ($values instanceof EmployeeI18n) {
$criteria = $values->buildPkeyCriteria();
} else {
$criteria = new Criteria(self::DATABASE_NAME);
if(count($values) == count($values, COUNT_RECURSIVE))
{
$values = array($values);
}
$vals = array();
foreach($values as $value)
{
$vals[0][] = $value[0];
$vals[1][] = $value[1];
}
$criteria->add(EmployeeI18nPeer::ID, $vals[0], Criteria::IN);
$criteria->add(EmployeeI18nPeer::CULTURE, $vals[1], Criteria::IN);
}
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0;
try {
$con->begin();
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doValidate(EmployeeI18n $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(EmployeeI18nPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(EmployeeI18nPeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
$res = BasePeer::doValidate(EmployeeI18nPeer::DATABASE_NAME, EmployeeI18nPeer::TABLE_NAME, $columns);
if ($res !== true) {
$request = sfContext::getInstance()->getRequest();
foreach ($res as $failed) {
$col = EmployeeI18nPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
$request->setError($col, $failed->getMessage());
}
}
return $res;
}
public static function retrieveByPK( $id, $culture, $con = null) {
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria();
$criteria->add(EmployeeI18nPeer::ID, $id);
$criteria->add(EmployeeI18nPeer::CULTURE, $culture);
$v = EmployeeI18nPeer::doSelect($criteria, $con);
return !empty($v) ? $v[0] : null;
}
}
if (Propel::isInit()) {
try {
BaseEmployeeI18nPeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
require_once 'lib/model/map/EmployeeI18nMapBuilder.php';
Propel::registerMapBuilder('lib.model.map.EmployeeI18nMapBuilder');
}

View File

@@ -0,0 +1,642 @@
<?php
abstract class BaseEmployeePeer {
const DATABASE_NAME = 'propel';
const TABLE_NAME = 'Employee';
const CLASS_DEFAULT = 'lib.model.Employee';
const NUM_COLUMNS = 11;
const NUM_LAZY_LOAD_COLUMNS = 0;
const ID = 'Employee.ID';
const NAME = 'Employee.NAME';
const DEGREES = 'Employee.DEGREES';
const PHONE = 'Employee.PHONE';
const CELLPHONE = 'Employee.CELLPHONE';
const EMAIL = 'Employee.EMAIL';
const PICTURE = 'Employee.PICTURE';
const ACTIVE = 'Employee.ACTIVE';
const POSITION = 'Employee.POSITION';
const SLUG = 'Employee.SLUG';
const SORT_ORDER = 'Employee.SORT_ORDER';
private static $phpNameMap = null;
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Id', 'Name', 'Degrees', 'Phone', 'Cellphone', 'Email', 'Picture', 'Active', 'Position', 'Slug', 'SortOrder', ),
BasePeer::TYPE_COLNAME => array (EmployeePeer::ID, EmployeePeer::NAME, EmployeePeer::DEGREES, EmployeePeer::PHONE, EmployeePeer::CELLPHONE, EmployeePeer::EMAIL, EmployeePeer::PICTURE, EmployeePeer::ACTIVE, EmployeePeer::POSITION, EmployeePeer::SLUG, EmployeePeer::SORT_ORDER, ),
BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'degrees', 'phone', 'cellphone', 'email', 'picture', 'active', 'position', 'slug', 'sort_order', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
);
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Name' => 1, 'Degrees' => 2, 'Phone' => 3, 'Cellphone' => 4, 'Email' => 5, 'Picture' => 6, 'Active' => 7, 'Position' => 8, 'Slug' => 9, 'SortOrder' => 10, ),
BasePeer::TYPE_COLNAME => array (EmployeePeer::ID => 0, EmployeePeer::NAME => 1, EmployeePeer::DEGREES => 2, EmployeePeer::PHONE => 3, EmployeePeer::CELLPHONE => 4, EmployeePeer::EMAIL => 5, EmployeePeer::PICTURE => 6, EmployeePeer::ACTIVE => 7, EmployeePeer::POSITION => 8, EmployeePeer::SLUG => 9, EmployeePeer::SORT_ORDER => 10, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'degrees' => 2, 'phone' => 3, 'cellphone' => 4, 'email' => 5, 'picture' => 6, 'active' => 7, 'position' => 8, 'slug' => 9, 'sort_order' => 10, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
);
public static function getMapBuilder()
{
include_once 'lib/model/map/EmployeeMapBuilder.php';
return BasePeer::getMapBuilder('lib.model.map.EmployeeMapBuilder');
}
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = EmployeePeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
public static function alias($alias, $column)
{
return str_replace(EmployeePeer::TABLE_NAME.'.', $alias.'.', $column);
}
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(EmployeePeer::ID);
$criteria->addSelectColumn(EmployeePeer::NAME);
$criteria->addSelectColumn(EmployeePeer::DEGREES);
$criteria->addSelectColumn(EmployeePeer::PHONE);
$criteria->addSelectColumn(EmployeePeer::CELLPHONE);
$criteria->addSelectColumn(EmployeePeer::EMAIL);
$criteria->addSelectColumn(EmployeePeer::PICTURE);
$criteria->addSelectColumn(EmployeePeer::ACTIVE);
$criteria->addSelectColumn(EmployeePeer::POSITION);
$criteria->addSelectColumn(EmployeePeer::SLUG);
$criteria->addSelectColumn(EmployeePeer::SORT_ORDER);
}
const COUNT = 'COUNT(Employee.ID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT Employee.ID)';
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(EmployeePeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(EmployeePeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$rs = EmployeePeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = EmployeePeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
public static function doSelect(Criteria $criteria, $con = null)
{
return EmployeePeer::populateObjects(EmployeePeer::doSelectRS($criteria, $con));
}
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
EmployeePeer::addSelectColumns($criteria);
}
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doSelect($criteria, $con);
}
public static function populateObjects(ResultSet $rs)
{
$results = array();
$cls = EmployeePeer::getOMClass();
$cls = Propel::import($cls);
while($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
public static function doCountJoinLuEmployeePosition(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(EmployeePeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(EmployeePeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(EmployeePeer::POSITION, LuEmployeePositionPeer::ID);
$rs = EmployeePeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectJoinLuEmployeePosition(Criteria $c, $con = null)
{
$c = clone $c;
if ($c->getDbName() == Propel::getDefaultDB()) {
$c->setDbName(self::DATABASE_NAME);
}
EmployeePeer::addSelectColumns($c);
$startcol = (EmployeePeer::NUM_COLUMNS - EmployeePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
LuEmployeePositionPeer::addSelectColumns($c);
$c->addJoin(EmployeePeer::POSITION, LuEmployeePositionPeer::ID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = EmployeePeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$omClass = LuEmployeePositionPeer::getOMClass();
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol);
$newObject = true;
foreach($results as $temp_obj1) {
$temp_obj2 = $temp_obj1->getLuEmployeePosition(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
$temp_obj2->addEmployee($obj1); break;
}
}
if ($newObject) {
$obj2->initEmployees();
$obj2->addEmployee($obj1); }
$results[] = $obj1;
}
return $results;
}
public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(EmployeePeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(EmployeePeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(EmployeePeer::POSITION, LuEmployeePositionPeer::ID);
$rs = EmployeePeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectJoinAll(Criteria $c, $con = null)
{
$c = clone $c;
if ($c->getDbName() == Propel::getDefaultDB()) {
$c->setDbName(self::DATABASE_NAME);
}
EmployeePeer::addSelectColumns($c);
$startcol2 = (EmployeePeer::NUM_COLUMNS - EmployeePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
LuEmployeePositionPeer::addSelectColumns($c);
$startcol3 = $startcol2 + LuEmployeePositionPeer::NUM_COLUMNS;
$c->addJoin(EmployeePeer::POSITION, LuEmployeePositionPeer::ID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = EmployeePeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$omClass = LuEmployeePositionPeer::getOMClass();
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol2);
$newObject = true;
for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
$temp_obj1 = $results[$j];
$temp_obj2 = $temp_obj1->getLuEmployeePosition(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
$temp_obj2->addEmployee($obj1); break;
}
}
if ($newObject) {
$obj2->initEmployees();
$obj2->addEmployee($obj1);
}
$results[] = $obj1;
}
return $results;
}
public static function doSelectWithI18n(Criteria $c, $culture = null, $con = null)
{
if ($culture === null)
{
$culture = sfContext::getInstance()->getUser()->getCulture();
}
if ($c->getDbName() == Propel::getDefaultDB())
{
$c->setDbName(self::DATABASE_NAME);
}
EmployeePeer::addSelectColumns($c);
$startcol = (EmployeePeer::NUM_COLUMNS - EmployeePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
EmployeeI18nPeer::addSelectColumns($c);
$c->addJoin(EmployeePeer::ID, EmployeeI18nPeer::ID);
$c->add(EmployeeI18nPeer::CULTURE, $culture);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = EmployeePeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$obj1->setCulture($culture);
$omClass = EmployeeI18nPeer::getOMClass($rs, $startcol);
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol);
$obj1->setEmployeeI18nForCulture($obj2, $culture);
$obj2->setEmployee($obj1);
$results[] = $obj1;
}
return $results;
}
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
public static function getOMClass()
{
return EmployeePeer::CLASS_DEFAULT;
}
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } else {
$criteria = $values->buildCriteria(); }
$criteria->remove(EmployeePeer::ID);
$criteria->setDbName(self::DATABASE_NAME);
try {
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch(PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values;
$comparison = $criteria->getComparison(EmployeePeer::ID);
$selectCriteria->add(EmployeePeer::ID, $criteria->remove(EmployeePeer::ID), $comparison);
} else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); }
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; try {
$con->begin();
$affectedRows += EmployeePeer::doOnDeleteCascade(new Criteria(), $con);
$affectedRows += BasePeer::doDeleteAll(EmployeePeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(EmployeePeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } elseif ($values instanceof Employee) {
$criteria = $values->buildPkeyCriteria();
} else {
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(EmployeePeer::ID, (array) $values, Criteria::IN);
}
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0;
try {
$con->begin();
$affectedRows += EmployeePeer::doOnDeleteCascade($criteria, $con);
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
protected static function doOnDeleteCascade(Criteria $criteria, Connection $con)
{
$affectedRows = 0;
$objects = EmployeePeer::doSelect($criteria, $con);
foreach($objects as $obj) {
include_once 'lib/model/EmployeeI18n.php';
$c = new Criteria();
$c->add(EmployeeI18nPeer::ID, $obj->getId());
$affectedRows += EmployeeI18nPeer::doDelete($c, $con);
}
return $affectedRows;
}
public static function doValidate(Employee $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(EmployeePeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(EmployeePeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
$res = BasePeer::doValidate(EmployeePeer::DATABASE_NAME, EmployeePeer::TABLE_NAME, $columns);
if ($res !== true) {
$request = sfContext::getInstance()->getRequest();
foreach ($res as $failed) {
$col = EmployeePeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
$request->setError($col, $failed->getMessage());
}
}
return $res;
}
public static function retrieveByPK($pk, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria(EmployeePeer::DATABASE_NAME);
$criteria->add(EmployeePeer::ID, $pk);
$v = EmployeePeer::doSelect($criteria, $con);
return !empty($v) > 0 ? $v[0] : null;
}
public static function retrieveByPKs($pks, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria();
$criteria->add(EmployeePeer::ID, $pks, Criteria::IN);
$objs = EmployeePeer::doSelect($criteria, $con);
}
return $objs;
}
}
if (Propel::isInit()) {
try {
BaseEmployeePeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
require_once 'lib/model/map/EmployeeMapBuilder.php';
Propel::registerMapBuilder('lib.model.map.EmployeeMapBuilder');
}

View File

@@ -0,0 +1,544 @@
<?php
abstract class BaseEvent extends BaseObject implements Persistent {
protected static $peer;
protected $id;
protected $picture;
protected $expires_on;
protected $collEventI18ns;
protected $lastEventI18nCriteria = null;
protected $alreadyInSave = false;
protected $alreadyInValidation = false;
protected $culture;
public function getId()
{
return $this->id;
}
public function getPicture()
{
return $this->picture;
}
public function getExpiresOn($format = 'Y-m-d H:i:s')
{
if ($this->expires_on === null || $this->expires_on === '') {
return null;
} elseif (!is_int($this->expires_on)) {
$ts = strtotime($this->expires_on);
if ($ts === -1 || $ts === false) { throw new PropelException("Unable to parse value of [expires_on] as date/time value: " . var_export($this->expires_on, true));
}
} else {
$ts = $this->expires_on;
}
if ($format === null) {
return $ts;
} elseif (strpos($format, '%') !== false) {
return strftime($format, $ts);
} else {
return date($format, $ts);
}
}
public function setId($v)
{
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = EventPeer::ID;
}
}
public function setPicture($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->picture !== $v) {
$this->picture = $v;
$this->modifiedColumns[] = EventPeer::PICTURE;
}
}
public function setExpiresOn($v)
{
if ($v !== null && !is_int($v)) {
$ts = strtotime($v);
if ($ts === -1 || $ts === false) { throw new PropelException("Unable to parse date/time value for [expires_on] from input: " . var_export($v, true));
}
} else {
$ts = $v;
}
if ($this->expires_on !== $ts) {
$this->expires_on = $ts;
$this->modifiedColumns[] = EventPeer::EXPIRES_ON;
}
}
public function hydrate(ResultSet $rs, $startcol = 1)
{
try {
$this->id = $rs->getInt($startcol + 0);
$this->picture = $rs->getString($startcol + 1);
$this->expires_on = $rs->getTimestamp($startcol + 2, null);
$this->resetModified();
$this->setNew(false);
return $startcol + 3;
} catch (Exception $e) {
throw new PropelException("Error populating Event object", $e);
}
}
public function delete($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(EventPeer::DATABASE_NAME);
}
try {
$con->begin();
EventPeer::doDelete($this, $con);
$this->setDeleted(true);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public function save($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("You cannot save an object that has been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(EventPeer::DATABASE_NAME);
}
try {
$con->begin();
$affectedRows = $this->doSave($con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
protected function doSave($con)
{
$affectedRows = 0; if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
if ($this->isModified()) {
if ($this->isNew()) {
$pk = EventPeer::doInsert($this, $con);
$affectedRows += 1;
$this->setId($pk);
$this->setNew(false);
} else {
$affectedRows += EventPeer::doUpdate($this, $con);
}
$this->resetModified(); }
if ($this->collEventI18ns !== null) {
foreach($this->collEventI18ns as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
}
$this->alreadyInSave = false;
}
return $affectedRows;
}
protected $validationFailures = array();
public function getValidationFailures()
{
return $this->validationFailures;
}
public function validate($columns = null)
{
$res = $this->doValidate($columns);
if ($res === true) {
$this->validationFailures = array();
return true;
} else {
$this->validationFailures = $res;
return false;
}
}
protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
if (($retval = EventPeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
if ($this->collEventI18ns !== null) {
foreach($this->collEventI18ns as $referrerFK) {
if (!$referrerFK->validate($columns)) {
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
}
}
}
$this->alreadyInValidation = false;
}
return (!empty($failureMap) ? $failureMap : true);
}
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = EventPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->getByPosition($pos);
}
public function getByPosition($pos)
{
switch($pos) {
case 0:
return $this->getId();
break;
case 1:
return $this->getPicture();
break;
case 2:
return $this->getExpiresOn();
break;
default:
return null;
break;
} }
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
{
$keys = EventPeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getPicture(),
$keys[2] => $this->getExpiresOn(),
);
return $result;
}
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = EventPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
public function setByPosition($pos, $value)
{
switch($pos) {
case 0:
$this->setId($value);
break;
case 1:
$this->setPicture($value);
break;
case 2:
$this->setExpiresOn($value);
break;
} }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = EventPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setPicture($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setExpiresOn($arr[$keys[2]]);
}
public function buildCriteria()
{
$criteria = new Criteria(EventPeer::DATABASE_NAME);
if ($this->isColumnModified(EventPeer::ID)) $criteria->add(EventPeer::ID, $this->id);
if ($this->isColumnModified(EventPeer::PICTURE)) $criteria->add(EventPeer::PICTURE, $this->picture);
if ($this->isColumnModified(EventPeer::EXPIRES_ON)) $criteria->add(EventPeer::EXPIRES_ON, $this->expires_on);
return $criteria;
}
public function buildPkeyCriteria()
{
$criteria = new Criteria(EventPeer::DATABASE_NAME);
$criteria->add(EventPeer::ID, $this->id);
return $criteria;
}
public function getPrimaryKey()
{
return $this->getId();
}
public function setPrimaryKey($key)
{
$this->setId($key);
}
public function copyInto($copyObj, $deepCopy = false)
{
$copyObj->setPicture($this->picture);
$copyObj->setExpiresOn($this->expires_on);
if ($deepCopy) {
$copyObj->setNew(false);
foreach($this->getEventI18ns() as $relObj) {
$copyObj->addEventI18n($relObj->copy($deepCopy));
}
}
$copyObj->setNew(true);
$copyObj->setId(NULL);
}
public function copy($deepCopy = false)
{
$clazz = get_class($this);
$copyObj = new $clazz();
$this->copyInto($copyObj, $deepCopy);
return $copyObj;
}
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new EventPeer();
}
return self::$peer;
}
public function initEventI18ns()
{
if ($this->collEventI18ns === null) {
$this->collEventI18ns = array();
}
}
public function getEventI18ns($criteria = null, $con = null)
{
include_once 'lib/model/om/BaseEventI18nPeer.php';
if ($criteria === null) {
$criteria = new Criteria();
}
elseif ($criteria instanceof Criteria)
{
$criteria = clone $criteria;
}
if ($this->collEventI18ns === null) {
if ($this->isNew()) {
$this->collEventI18ns = array();
} else {
$criteria->add(EventI18nPeer::ID, $this->getId());
EventI18nPeer::addSelectColumns($criteria);
$this->collEventI18ns = EventI18nPeer::doSelect($criteria, $con);
}
} else {
if (!$this->isNew()) {
$criteria->add(EventI18nPeer::ID, $this->getId());
EventI18nPeer::addSelectColumns($criteria);
if (!isset($this->lastEventI18nCriteria) || !$this->lastEventI18nCriteria->equals($criteria)) {
$this->collEventI18ns = EventI18nPeer::doSelect($criteria, $con);
}
}
}
$this->lastEventI18nCriteria = $criteria;
return $this->collEventI18ns;
}
public function countEventI18ns($criteria = null, $distinct = false, $con = null)
{
include_once 'lib/model/om/BaseEventI18nPeer.php';
if ($criteria === null) {
$criteria = new Criteria();
}
elseif ($criteria instanceof Criteria)
{
$criteria = clone $criteria;
}
$criteria->add(EventI18nPeer::ID, $this->getId());
return EventI18nPeer::doCount($criteria, $distinct, $con);
}
public function addEventI18n(EventI18n $l)
{
$this->collEventI18ns[] = $l;
$l->setEvent($this);
}
public function getCulture()
{
return $this->culture;
}
public function setCulture($culture)
{
$this->culture = $culture;
}
public function getTitle()
{
$obj = $this->getCurrentEventI18n();
return ($obj ? $obj->getTitle() : null);
}
public function setTitle($value)
{
$this->getCurrentEventI18n()->setTitle($value);
}
public function getDescription()
{
$obj = $this->getCurrentEventI18n();
return ($obj ? $obj->getDescription() : null);
}
public function setDescription($value)
{
$this->getCurrentEventI18n()->setDescription($value);
}
protected $current_i18n = array();
public function getCurrentEventI18n()
{
if (!isset($this->current_i18n[$this->culture]))
{
$obj = EventI18nPeer::retrieveByPK($this->getId(), $this->culture);
if ($obj)
{
$this->setEventI18nForCulture($obj, $this->culture);
}
else
{
$this->setEventI18nForCulture(new EventI18n(), $this->culture);
$this->current_i18n[$this->culture]->setCulture($this->culture);
}
}
return $this->current_i18n[$this->culture];
}
public function setEventI18nForCulture($object, $culture)
{
$this->current_i18n[$culture] = $object;
$this->addEventI18n($object);
}
}

View File

@@ -0,0 +1,465 @@
<?php
abstract class BaseEventI18n extends BaseObject implements Persistent {
protected static $peer;
protected $title;
protected $description;
protected $id;
protected $culture;
protected $aEvent;
protected $alreadyInSave = false;
protected $alreadyInValidation = false;
public function getTitle()
{
return $this->title;
}
public function getDescription()
{
return $this->description;
}
public function getId()
{
return $this->id;
}
public function getCulture()
{
return $this->culture;
}
public function setTitle($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->title !== $v) {
$this->title = $v;
$this->modifiedColumns[] = EventI18nPeer::TITLE;
}
}
public function setDescription($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->description !== $v) {
$this->description = $v;
$this->modifiedColumns[] = EventI18nPeer::DESCRIPTION;
}
}
public function setId($v)
{
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = EventI18nPeer::ID;
}
if ($this->aEvent !== null && $this->aEvent->getId() !== $v) {
$this->aEvent = null;
}
}
public function setCulture($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->culture !== $v) {
$this->culture = $v;
$this->modifiedColumns[] = EventI18nPeer::CULTURE;
}
}
public function hydrate(ResultSet $rs, $startcol = 1)
{
try {
$this->title = $rs->getString($startcol + 0);
$this->description = $rs->getString($startcol + 1);
$this->id = $rs->getInt($startcol + 2);
$this->culture = $rs->getString($startcol + 3);
$this->resetModified();
$this->setNew(false);
return $startcol + 4;
} catch (Exception $e) {
throw new PropelException("Error populating EventI18n object", $e);
}
}
public function delete($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(EventI18nPeer::DATABASE_NAME);
}
try {
$con->begin();
EventI18nPeer::doDelete($this, $con);
$this->setDeleted(true);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public function save($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("You cannot save an object that has been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(EventI18nPeer::DATABASE_NAME);
}
try {
$con->begin();
$affectedRows = $this->doSave($con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
protected function doSave($con)
{
$affectedRows = 0; if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
if ($this->aEvent !== null) {
if ($this->aEvent->isModified() || $this->aEvent->getCurrentEventI18n()->isModified()) {
$affectedRows += $this->aEvent->save($con);
}
$this->setEvent($this->aEvent);
}
if ($this->isModified()) {
if ($this->isNew()) {
$pk = EventI18nPeer::doInsert($this, $con);
$affectedRows += 1;
$this->setNew(false);
} else {
$affectedRows += EventI18nPeer::doUpdate($this, $con);
}
$this->resetModified(); }
$this->alreadyInSave = false;
}
return $affectedRows;
}
protected $validationFailures = array();
public function getValidationFailures()
{
return $this->validationFailures;
}
public function validate($columns = null)
{
$res = $this->doValidate($columns);
if ($res === true) {
$this->validationFailures = array();
return true;
} else {
$this->validationFailures = $res;
return false;
}
}
protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
if ($this->aEvent !== null) {
if (!$this->aEvent->validate($columns)) {
$failureMap = array_merge($failureMap, $this->aEvent->getValidationFailures());
}
}
if (($retval = EventI18nPeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
$this->alreadyInValidation = false;
}
return (!empty($failureMap) ? $failureMap : true);
}
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = EventI18nPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->getByPosition($pos);
}
public function getByPosition($pos)
{
switch($pos) {
case 0:
return $this->getTitle();
break;
case 1:
return $this->getDescription();
break;
case 2:
return $this->getId();
break;
case 3:
return $this->getCulture();
break;
default:
return null;
break;
} }
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
{
$keys = EventI18nPeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getTitle(),
$keys[1] => $this->getDescription(),
$keys[2] => $this->getId(),
$keys[3] => $this->getCulture(),
);
return $result;
}
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = EventI18nPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
public function setByPosition($pos, $value)
{
switch($pos) {
case 0:
$this->setTitle($value);
break;
case 1:
$this->setDescription($value);
break;
case 2:
$this->setId($value);
break;
case 3:
$this->setCulture($value);
break;
} }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = EventI18nPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setTitle($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setDescription($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setId($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setCulture($arr[$keys[3]]);
}
public function buildCriteria()
{
$criteria = new Criteria(EventI18nPeer::DATABASE_NAME);
if ($this->isColumnModified(EventI18nPeer::TITLE)) $criteria->add(EventI18nPeer::TITLE, $this->title);
if ($this->isColumnModified(EventI18nPeer::DESCRIPTION)) $criteria->add(EventI18nPeer::DESCRIPTION, $this->description);
if ($this->isColumnModified(EventI18nPeer::ID)) $criteria->add(EventI18nPeer::ID, $this->id);
if ($this->isColumnModified(EventI18nPeer::CULTURE)) $criteria->add(EventI18nPeer::CULTURE, $this->culture);
return $criteria;
}
public function buildPkeyCriteria()
{
$criteria = new Criteria(EventI18nPeer::DATABASE_NAME);
$criteria->add(EventI18nPeer::ID, $this->id);
$criteria->add(EventI18nPeer::CULTURE, $this->culture);
return $criteria;
}
public function getPrimaryKey()
{
$pks = array();
$pks[0] = $this->getId();
$pks[1] = $this->getCulture();
return $pks;
}
public function setPrimaryKey($keys)
{
$this->setId($keys[0]);
$this->setCulture($keys[1]);
}
public function copyInto($copyObj, $deepCopy = false)
{
$copyObj->setTitle($this->title);
$copyObj->setDescription($this->description);
$copyObj->setNew(true);
$copyObj->setId(NULL);
$copyObj->setCulture(NULL);
}
public function copy($deepCopy = false)
{
$clazz = get_class($this);
$copyObj = new $clazz();
$this->copyInto($copyObj, $deepCopy);
return $copyObj;
}
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new EventI18nPeer();
}
return self::$peer;
}
public function setEvent($v)
{
if ($v === null) {
$this->setId(NULL);
} else {
$this->setId($v->getId());
}
$this->aEvent = $v;
}
public function getEvent($con = null)
{
if ($this->aEvent === null && ($this->id !== null)) {
include_once 'lib/model/om/BaseEventPeer.php';
$this->aEvent = EventPeer::retrieveByPK($this->id, $con);
}
return $this->aEvent;
}
}

View File

@@ -0,0 +1,531 @@
<?php
abstract class BaseEventI18nPeer {
const DATABASE_NAME = 'propel';
const TABLE_NAME = 'Event_i18n';
const CLASS_DEFAULT = 'lib.model.EventI18n';
const NUM_COLUMNS = 4;
const NUM_LAZY_LOAD_COLUMNS = 0;
const TITLE = 'Event_i18n.TITLE';
const DESCRIPTION = 'Event_i18n.DESCRIPTION';
const ID = 'Event_i18n.ID';
const CULTURE = 'Event_i18n.CULTURE';
private static $phpNameMap = null;
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Title', 'Description', 'Id', 'Culture', ),
BasePeer::TYPE_COLNAME => array (EventI18nPeer::TITLE, EventI18nPeer::DESCRIPTION, EventI18nPeer::ID, EventI18nPeer::CULTURE, ),
BasePeer::TYPE_FIELDNAME => array ('title', 'description', 'id', 'culture', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Title' => 0, 'Description' => 1, 'Id' => 2, 'Culture' => 3, ),
BasePeer::TYPE_COLNAME => array (EventI18nPeer::TITLE => 0, EventI18nPeer::DESCRIPTION => 1, EventI18nPeer::ID => 2, EventI18nPeer::CULTURE => 3, ),
BasePeer::TYPE_FIELDNAME => array ('title' => 0, 'description' => 1, 'id' => 2, 'culture' => 3, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
public static function getMapBuilder()
{
include_once 'lib/model/map/EventI18nMapBuilder.php';
return BasePeer::getMapBuilder('lib.model.map.EventI18nMapBuilder');
}
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = EventI18nPeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
public static function alias($alias, $column)
{
return str_replace(EventI18nPeer::TABLE_NAME.'.', $alias.'.', $column);
}
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(EventI18nPeer::TITLE);
$criteria->addSelectColumn(EventI18nPeer::DESCRIPTION);
$criteria->addSelectColumn(EventI18nPeer::ID);
$criteria->addSelectColumn(EventI18nPeer::CULTURE);
}
const COUNT = 'COUNT(Event_i18n.ID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT Event_i18n.ID)';
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(EventI18nPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(EventI18nPeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$rs = EventI18nPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = EventI18nPeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
public static function doSelect(Criteria $criteria, $con = null)
{
return EventI18nPeer::populateObjects(EventI18nPeer::doSelectRS($criteria, $con));
}
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
EventI18nPeer::addSelectColumns($criteria);
}
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doSelect($criteria, $con);
}
public static function populateObjects(ResultSet $rs)
{
$results = array();
$cls = EventI18nPeer::getOMClass();
$cls = Propel::import($cls);
while($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
public static function doCountJoinEvent(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(EventI18nPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(EventI18nPeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(EventI18nPeer::ID, EventPeer::ID);
$rs = EventI18nPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectJoinEvent(Criteria $c, $con = null)
{
$c = clone $c;
if ($c->getDbName() == Propel::getDefaultDB()) {
$c->setDbName(self::DATABASE_NAME);
}
EventI18nPeer::addSelectColumns($c);
$startcol = (EventI18nPeer::NUM_COLUMNS - EventI18nPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
EventPeer::addSelectColumns($c);
$c->addJoin(EventI18nPeer::ID, EventPeer::ID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = EventI18nPeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$omClass = EventPeer::getOMClass();
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol);
$newObject = true;
foreach($results as $temp_obj1) {
$temp_obj2 = $temp_obj1->getEvent(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
$temp_obj2->addEventI18n($obj1); break;
}
}
if ($newObject) {
$obj2->initEventI18ns();
$obj2->addEventI18n($obj1); }
$results[] = $obj1;
}
return $results;
}
public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(EventI18nPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(EventI18nPeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$criteria->addJoin(EventI18nPeer::ID, EventPeer::ID);
$rs = EventI18nPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectJoinAll(Criteria $c, $con = null)
{
$c = clone $c;
if ($c->getDbName() == Propel::getDefaultDB()) {
$c->setDbName(self::DATABASE_NAME);
}
EventI18nPeer::addSelectColumns($c);
$startcol2 = (EventI18nPeer::NUM_COLUMNS - EventI18nPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
EventPeer::addSelectColumns($c);
$startcol3 = $startcol2 + EventPeer::NUM_COLUMNS;
$c->addJoin(EventI18nPeer::ID, EventPeer::ID);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = EventI18nPeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$omClass = EventPeer::getOMClass();
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol2);
$newObject = true;
for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
$temp_obj1 = $results[$j];
$temp_obj2 = $temp_obj1->getEvent(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
$newObject = false;
$temp_obj2->addEventI18n($obj1); break;
}
}
if ($newObject) {
$obj2->initEventI18ns();
$obj2->addEventI18n($obj1);
}
$results[] = $obj1;
}
return $results;
}
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
public static function getOMClass()
{
return EventI18nPeer::CLASS_DEFAULT;
}
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } else {
$criteria = $values->buildCriteria(); }
$criteria->setDbName(self::DATABASE_NAME);
try {
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch(PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values;
$comparison = $criteria->getComparison(EventI18nPeer::ID);
$selectCriteria->add(EventI18nPeer::ID, $criteria->remove(EventI18nPeer::ID), $comparison);
$comparison = $criteria->getComparison(EventI18nPeer::CULTURE);
$selectCriteria->add(EventI18nPeer::CULTURE, $criteria->remove(EventI18nPeer::CULTURE), $comparison);
} else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); }
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; try {
$con->begin();
$affectedRows += BasePeer::doDeleteAll(EventI18nPeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(EventI18nPeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } elseif ($values instanceof EventI18n) {
$criteria = $values->buildPkeyCriteria();
} else {
$criteria = new Criteria(self::DATABASE_NAME);
if(count($values) == count($values, COUNT_RECURSIVE))
{
$values = array($values);
}
$vals = array();
foreach($values as $value)
{
$vals[0][] = $value[0];
$vals[1][] = $value[1];
}
$criteria->add(EventI18nPeer::ID, $vals[0], Criteria::IN);
$criteria->add(EventI18nPeer::CULTURE, $vals[1], Criteria::IN);
}
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0;
try {
$con->begin();
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doValidate(EventI18n $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(EventI18nPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(EventI18nPeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
$res = BasePeer::doValidate(EventI18nPeer::DATABASE_NAME, EventI18nPeer::TABLE_NAME, $columns);
if ($res !== true) {
$request = sfContext::getInstance()->getRequest();
foreach ($res as $failed) {
$col = EventI18nPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
$request->setError($col, $failed->getMessage());
}
}
return $res;
}
public static function retrieveByPK( $id, $culture, $con = null) {
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria();
$criteria->add(EventI18nPeer::ID, $id);
$criteria->add(EventI18nPeer::CULTURE, $culture);
$v = EventI18nPeer::doSelect($criteria, $con);
return !empty($v) ? $v[0] : null;
}
}
if (Propel::isInit()) {
try {
BaseEventI18nPeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
require_once 'lib/model/map/EventI18nMapBuilder.php';
Propel::registerMapBuilder('lib.model.map.EventI18nMapBuilder');
}

View File

@@ -0,0 +1,441 @@
<?php
abstract class BaseEventPeer {
const DATABASE_NAME = 'propel';
const TABLE_NAME = 'Event';
const CLASS_DEFAULT = 'lib.model.Event';
const NUM_COLUMNS = 3;
const NUM_LAZY_LOAD_COLUMNS = 0;
const ID = 'Event.ID';
const PICTURE = 'Event.PICTURE';
const EXPIRES_ON = 'Event.EXPIRES_ON';
private static $phpNameMap = null;
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Id', 'Picture', 'ExpiresOn', ),
BasePeer::TYPE_COLNAME => array (EventPeer::ID, EventPeer::PICTURE, EventPeer::EXPIRES_ON, ),
BasePeer::TYPE_FIELDNAME => array ('id', 'picture', 'expires_on', ),
BasePeer::TYPE_NUM => array (0, 1, 2, )
);
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Picture' => 1, 'ExpiresOn' => 2, ),
BasePeer::TYPE_COLNAME => array (EventPeer::ID => 0, EventPeer::PICTURE => 1, EventPeer::EXPIRES_ON => 2, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'picture' => 1, 'expires_on' => 2, ),
BasePeer::TYPE_NUM => array (0, 1, 2, )
);
public static function getMapBuilder()
{
include_once 'lib/model/map/EventMapBuilder.php';
return BasePeer::getMapBuilder('lib.model.map.EventMapBuilder');
}
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = EventPeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
public static function alias($alias, $column)
{
return str_replace(EventPeer::TABLE_NAME.'.', $alias.'.', $column);
}
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(EventPeer::ID);
$criteria->addSelectColumn(EventPeer::PICTURE);
$criteria->addSelectColumn(EventPeer::EXPIRES_ON);
}
const COUNT = 'COUNT(Event.ID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT Event.ID)';
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(EventPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(EventPeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$rs = EventPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = EventPeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
public static function doSelect(Criteria $criteria, $con = null)
{
return EventPeer::populateObjects(EventPeer::doSelectRS($criteria, $con));
}
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
EventPeer::addSelectColumns($criteria);
}
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doSelect($criteria, $con);
}
public static function populateObjects(ResultSet $rs)
{
$results = array();
$cls = EventPeer::getOMClass();
$cls = Propel::import($cls);
while($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
public static function doSelectWithI18n(Criteria $c, $culture = null, $con = null)
{
if ($culture === null)
{
$culture = sfContext::getInstance()->getUser()->getCulture();
}
if ($c->getDbName() == Propel::getDefaultDB())
{
$c->setDbName(self::DATABASE_NAME);
}
EventPeer::addSelectColumns($c);
$startcol = (EventPeer::NUM_COLUMNS - EventPeer::NUM_LAZY_LOAD_COLUMNS) + 1;
EventI18nPeer::addSelectColumns($c);
$c->addJoin(EventPeer::ID, EventI18nPeer::ID);
$c->add(EventI18nPeer::CULTURE, $culture);
$rs = BasePeer::doSelect($c, $con);
$results = array();
while($rs->next()) {
$omClass = EventPeer::getOMClass();
$cls = Propel::import($omClass);
$obj1 = new $cls();
$obj1->hydrate($rs);
$obj1->setCulture($culture);
$omClass = EventI18nPeer::getOMClass($rs, $startcol);
$cls = Propel::import($omClass);
$obj2 = new $cls();
$obj2->hydrate($rs, $startcol);
$obj1->setEventI18nForCulture($obj2, $culture);
$obj2->setEvent($obj1);
$results[] = $obj1;
}
return $results;
}
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
public static function getOMClass()
{
return EventPeer::CLASS_DEFAULT;
}
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } else {
$criteria = $values->buildCriteria(); }
$criteria->remove(EventPeer::ID);
$criteria->setDbName(self::DATABASE_NAME);
try {
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch(PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values;
$comparison = $criteria->getComparison(EventPeer::ID);
$selectCriteria->add(EventPeer::ID, $criteria->remove(EventPeer::ID), $comparison);
} else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); }
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; try {
$con->begin();
$affectedRows += EventPeer::doOnDeleteCascade(new Criteria(), $con);
$affectedRows += BasePeer::doDeleteAll(EventPeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(EventPeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } elseif ($values instanceof Event) {
$criteria = $values->buildPkeyCriteria();
} else {
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(EventPeer::ID, (array) $values, Criteria::IN);
}
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0;
try {
$con->begin();
$affectedRows += EventPeer::doOnDeleteCascade($criteria, $con);
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
protected static function doOnDeleteCascade(Criteria $criteria, Connection $con)
{
$affectedRows = 0;
$objects = EventPeer::doSelect($criteria, $con);
foreach($objects as $obj) {
include_once 'lib/model/EventI18n.php';
$c = new Criteria();
$c->add(EventI18nPeer::ID, $obj->getId());
$affectedRows += EventI18nPeer::doDelete($c, $con);
}
return $affectedRows;
}
public static function doValidate(Event $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(EventPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(EventPeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
$res = BasePeer::doValidate(EventPeer::DATABASE_NAME, EventPeer::TABLE_NAME, $columns);
if ($res !== true) {
$request = sfContext::getInstance()->getRequest();
foreach ($res as $failed) {
$col = EventPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
$request->setError($col, $failed->getMessage());
}
}
return $res;
}
public static function retrieveByPK($pk, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria(EventPeer::DATABASE_NAME);
$criteria->add(EventPeer::ID, $pk);
$v = EventPeer::doSelect($criteria, $con);
return !empty($v) > 0 ? $v[0] : null;
}
public static function retrieveByPKs($pks, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria();
$criteria->add(EventPeer::ID, $pks, Criteria::IN);
$objs = EventPeer::doSelect($criteria, $con);
}
return $objs;
}
}
if (Propel::isInit()) {
try {
BaseEventPeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
require_once 'lib/model/map/EventMapBuilder.php';
Propel::registerMapBuilder('lib.model.map.EventMapBuilder');
}

View File

@@ -0,0 +1,424 @@
<?php
abstract class BaseLuEmployeePosition extends BaseObject implements Persistent {
protected static $peer;
protected $id;
protected $position;
protected $collEmployees;
protected $lastEmployeeCriteria = null;
protected $alreadyInSave = false;
protected $alreadyInValidation = false;
public function getId()
{
return $this->id;
}
public function getPosition()
{
return $this->position;
}
public function setId($v)
{
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = LuEmployeePositionPeer::ID;
}
}
public function setPosition($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->position !== $v) {
$this->position = $v;
$this->modifiedColumns[] = LuEmployeePositionPeer::POSITION;
}
}
public function hydrate(ResultSet $rs, $startcol = 1)
{
try {
$this->id = $rs->getInt($startcol + 0);
$this->position = $rs->getString($startcol + 1);
$this->resetModified();
$this->setNew(false);
return $startcol + 2;
} catch (Exception $e) {
throw new PropelException("Error populating LuEmployeePosition object", $e);
}
}
public function delete($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(LuEmployeePositionPeer::DATABASE_NAME);
}
try {
$con->begin();
LuEmployeePositionPeer::doDelete($this, $con);
$this->setDeleted(true);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public function save($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("You cannot save an object that has been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(LuEmployeePositionPeer::DATABASE_NAME);
}
try {
$con->begin();
$affectedRows = $this->doSave($con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
protected function doSave($con)
{
$affectedRows = 0; if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
if ($this->isModified()) {
if ($this->isNew()) {
$pk = LuEmployeePositionPeer::doInsert($this, $con);
$affectedRows += 1;
$this->setId($pk);
$this->setNew(false);
} else {
$affectedRows += LuEmployeePositionPeer::doUpdate($this, $con);
}
$this->resetModified(); }
if ($this->collEmployees !== null) {
foreach($this->collEmployees as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
}
$this->alreadyInSave = false;
}
return $affectedRows;
}
protected $validationFailures = array();
public function getValidationFailures()
{
return $this->validationFailures;
}
public function validate($columns = null)
{
$res = $this->doValidate($columns);
if ($res === true) {
$this->validationFailures = array();
return true;
} else {
$this->validationFailures = $res;
return false;
}
}
protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
if (($retval = LuEmployeePositionPeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
if ($this->collEmployees !== null) {
foreach($this->collEmployees as $referrerFK) {
if (!$referrerFK->validate($columns)) {
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
}
}
}
$this->alreadyInValidation = false;
}
return (!empty($failureMap) ? $failureMap : true);
}
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = LuEmployeePositionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->getByPosition($pos);
}
public function getByPosition($pos)
{
switch($pos) {
case 0:
return $this->getId();
break;
case 1:
return $this->getPosition();
break;
default:
return null;
break;
} }
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
{
$keys = LuEmployeePositionPeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getPosition(),
);
return $result;
}
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = LuEmployeePositionPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
public function setByPosition($pos, $value)
{
switch($pos) {
case 0:
$this->setId($value);
break;
case 1:
$this->setPosition($value);
break;
} }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = LuEmployeePositionPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setPosition($arr[$keys[1]]);
}
public function buildCriteria()
{
$criteria = new Criteria(LuEmployeePositionPeer::DATABASE_NAME);
if ($this->isColumnModified(LuEmployeePositionPeer::ID)) $criteria->add(LuEmployeePositionPeer::ID, $this->id);
if ($this->isColumnModified(LuEmployeePositionPeer::POSITION)) $criteria->add(LuEmployeePositionPeer::POSITION, $this->position);
return $criteria;
}
public function buildPkeyCriteria()
{
$criteria = new Criteria(LuEmployeePositionPeer::DATABASE_NAME);
$criteria->add(LuEmployeePositionPeer::ID, $this->id);
return $criteria;
}
public function getPrimaryKey()
{
return $this->getId();
}
public function setPrimaryKey($key)
{
$this->setId($key);
}
public function copyInto($copyObj, $deepCopy = false)
{
$copyObj->setPosition($this->position);
if ($deepCopy) {
$copyObj->setNew(false);
foreach($this->getEmployees() as $relObj) {
$copyObj->addEmployee($relObj->copy($deepCopy));
}
}
$copyObj->setNew(true);
$copyObj->setId(NULL);
}
public function copy($deepCopy = false)
{
$clazz = get_class($this);
$copyObj = new $clazz();
$this->copyInto($copyObj, $deepCopy);
return $copyObj;
}
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new LuEmployeePositionPeer();
}
return self::$peer;
}
public function initEmployees()
{
if ($this->collEmployees === null) {
$this->collEmployees = array();
}
}
public function getEmployees($criteria = null, $con = null)
{
include_once 'lib/model/om/BaseEmployeePeer.php';
if ($criteria === null) {
$criteria = new Criteria();
}
elseif ($criteria instanceof Criteria)
{
$criteria = clone $criteria;
}
if ($this->collEmployees === null) {
if ($this->isNew()) {
$this->collEmployees = array();
} else {
$criteria->add(EmployeePeer::POSITION, $this->getId());
EmployeePeer::addSelectColumns($criteria);
$this->collEmployees = EmployeePeer::doSelect($criteria, $con);
}
} else {
if (!$this->isNew()) {
$criteria->add(EmployeePeer::POSITION, $this->getId());
EmployeePeer::addSelectColumns($criteria);
if (!isset($this->lastEmployeeCriteria) || !$this->lastEmployeeCriteria->equals($criteria)) {
$this->collEmployees = EmployeePeer::doSelect($criteria, $con);
}
}
}
$this->lastEmployeeCriteria = $criteria;
return $this->collEmployees;
}
public function countEmployees($criteria = null, $distinct = false, $con = null)
{
include_once 'lib/model/om/BaseEmployeePeer.php';
if ($criteria === null) {
$criteria = new Criteria();
}
elseif ($criteria instanceof Criteria)
{
$criteria = clone $criteria;
}
$criteria->add(EmployeePeer::POSITION, $this->getId());
return EmployeePeer::doCount($criteria, $distinct, $con);
}
public function addEmployee(Employee $l)
{
$this->collEmployees[] = $l;
$l->setLuEmployeePosition($this);
}
}

View File

@@ -0,0 +1,368 @@
<?php
abstract class BaseLuEmployeePositionPeer {
const DATABASE_NAME = 'propel';
const TABLE_NAME = 'LU_Employee_Position';
const CLASS_DEFAULT = 'lib.model.LuEmployeePosition';
const NUM_COLUMNS = 2;
const NUM_LAZY_LOAD_COLUMNS = 0;
const ID = 'LU_Employee_Position.ID';
const POSITION = 'LU_Employee_Position.POSITION';
private static $phpNameMap = null;
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Id', 'Position', ),
BasePeer::TYPE_COLNAME => array (LuEmployeePositionPeer::ID, LuEmployeePositionPeer::POSITION, ),
BasePeer::TYPE_FIELDNAME => array ('id', 'position', ),
BasePeer::TYPE_NUM => array (0, 1, )
);
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Position' => 1, ),
BasePeer::TYPE_COLNAME => array (LuEmployeePositionPeer::ID => 0, LuEmployeePositionPeer::POSITION => 1, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'position' => 1, ),
BasePeer::TYPE_NUM => array (0, 1, )
);
public static function getMapBuilder()
{
include_once 'lib/model/map/LuEmployeePositionMapBuilder.php';
return BasePeer::getMapBuilder('lib.model.map.LuEmployeePositionMapBuilder');
}
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = LuEmployeePositionPeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
public static function alias($alias, $column)
{
return str_replace(LuEmployeePositionPeer::TABLE_NAME.'.', $alias.'.', $column);
}
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(LuEmployeePositionPeer::ID);
$criteria->addSelectColumn(LuEmployeePositionPeer::POSITION);
}
const COUNT = 'COUNT(LU_Employee_Position.ID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT LU_Employee_Position.ID)';
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(LuEmployeePositionPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(LuEmployeePositionPeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$rs = LuEmployeePositionPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = LuEmployeePositionPeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
public static function doSelect(Criteria $criteria, $con = null)
{
return LuEmployeePositionPeer::populateObjects(LuEmployeePositionPeer::doSelectRS($criteria, $con));
}
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
LuEmployeePositionPeer::addSelectColumns($criteria);
}
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doSelect($criteria, $con);
}
public static function populateObjects(ResultSet $rs)
{
$results = array();
$cls = LuEmployeePositionPeer::getOMClass();
$cls = Propel::import($cls);
while($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
public static function getOMClass()
{
return LuEmployeePositionPeer::CLASS_DEFAULT;
}
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } else {
$criteria = $values->buildCriteria(); }
$criteria->remove(LuEmployeePositionPeer::ID);
$criteria->setDbName(self::DATABASE_NAME);
try {
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch(PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values;
$comparison = $criteria->getComparison(LuEmployeePositionPeer::ID);
$selectCriteria->add(LuEmployeePositionPeer::ID, $criteria->remove(LuEmployeePositionPeer::ID), $comparison);
} else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); }
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; try {
$con->begin();
$affectedRows += BasePeer::doDeleteAll(LuEmployeePositionPeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(LuEmployeePositionPeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } elseif ($values instanceof LuEmployeePosition) {
$criteria = $values->buildPkeyCriteria();
} else {
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(LuEmployeePositionPeer::ID, (array) $values, Criteria::IN);
}
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0;
try {
$con->begin();
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doValidate(LuEmployeePosition $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(LuEmployeePositionPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(LuEmployeePositionPeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
$res = BasePeer::doValidate(LuEmployeePositionPeer::DATABASE_NAME, LuEmployeePositionPeer::TABLE_NAME, $columns);
if ($res !== true) {
$request = sfContext::getInstance()->getRequest();
foreach ($res as $failed) {
$col = LuEmployeePositionPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
$request->setError($col, $failed->getMessage());
}
}
return $res;
}
public static function retrieveByPK($pk, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria(LuEmployeePositionPeer::DATABASE_NAME);
$criteria->add(LuEmployeePositionPeer::ID, $pk);
$v = LuEmployeePositionPeer::doSelect($criteria, $con);
return !empty($v) > 0 ? $v[0] : null;
}
public static function retrieveByPKs($pks, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria();
$criteria->add(LuEmployeePositionPeer::ID, $pks, Criteria::IN);
$objs = LuEmployeePositionPeer::doSelect($criteria, $con);
}
return $objs;
}
}
if (Propel::isInit()) {
try {
BaseLuEmployeePositionPeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
require_once 'lib/model/map/LuEmployeePositionMapBuilder.php';
Propel::registerMapBuilder('lib.model.map.LuEmployeePositionMapBuilder');
}

View File

@@ -0,0 +1,323 @@
<?php
abstract class BaseReference extends BaseObject implements Persistent {
protected static $peer;
protected $id;
protected $company_name;
protected $alreadyInSave = false;
protected $alreadyInValidation = false;
public function getId()
{
return $this->id;
}
public function getCompanyName()
{
return $this->company_name;
}
public function setId($v)
{
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = ReferencePeer::ID;
}
}
public function setCompanyName($v)
{
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->company_name !== $v) {
$this->company_name = $v;
$this->modifiedColumns[] = ReferencePeer::COMPANY_NAME;
}
}
public function hydrate(ResultSet $rs, $startcol = 1)
{
try {
$this->id = $rs->getInt($startcol + 0);
$this->company_name = $rs->getString($startcol + 1);
$this->resetModified();
$this->setNew(false);
return $startcol + 2;
} catch (Exception $e) {
throw new PropelException("Error populating Reference object", $e);
}
}
public function delete($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(ReferencePeer::DATABASE_NAME);
}
try {
$con->begin();
ReferencePeer::doDelete($this, $con);
$this->setDeleted(true);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public function save($con = null)
{
if ($this->isDeleted()) {
throw new PropelException("You cannot save an object that has been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(ReferencePeer::DATABASE_NAME);
}
try {
$con->begin();
$affectedRows = $this->doSave($con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
protected function doSave($con)
{
$affectedRows = 0; if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
if ($this->isModified()) {
if ($this->isNew()) {
$pk = ReferencePeer::doInsert($this, $con);
$affectedRows += 1;
$this->setId($pk);
$this->setNew(false);
} else {
$affectedRows += ReferencePeer::doUpdate($this, $con);
}
$this->resetModified(); }
$this->alreadyInSave = false;
}
return $affectedRows;
}
protected $validationFailures = array();
public function getValidationFailures()
{
return $this->validationFailures;
}
public function validate($columns = null)
{
$res = $this->doValidate($columns);
if ($res === true) {
$this->validationFailures = array();
return true;
} else {
$this->validationFailures = $res;
return false;
}
}
protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
if (($retval = ReferencePeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
$this->alreadyInValidation = false;
}
return (!empty($failureMap) ? $failureMap : true);
}
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = ReferencePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->getByPosition($pos);
}
public function getByPosition($pos)
{
switch($pos) {
case 0:
return $this->getId();
break;
case 1:
return $this->getCompanyName();
break;
default:
return null;
break;
} }
public function toArray($keyType = BasePeer::TYPE_PHPNAME)
{
$keys = ReferencePeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getCompanyName(),
);
return $result;
}
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = ReferencePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
public function setByPosition($pos, $value)
{
switch($pos) {
case 0:
$this->setId($value);
break;
case 1:
$this->setCompanyName($value);
break;
} }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = ReferencePeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setCompanyName($arr[$keys[1]]);
}
public function buildCriteria()
{
$criteria = new Criteria(ReferencePeer::DATABASE_NAME);
if ($this->isColumnModified(ReferencePeer::ID)) $criteria->add(ReferencePeer::ID, $this->id);
if ($this->isColumnModified(ReferencePeer::COMPANY_NAME)) $criteria->add(ReferencePeer::COMPANY_NAME, $this->company_name);
return $criteria;
}
public function buildPkeyCriteria()
{
$criteria = new Criteria(ReferencePeer::DATABASE_NAME);
$criteria->add(ReferencePeer::ID, $this->id);
return $criteria;
}
public function getPrimaryKey()
{
return $this->getId();
}
public function setPrimaryKey($key)
{
$this->setId($key);
}
public function copyInto($copyObj, $deepCopy = false)
{
$copyObj->setCompanyName($this->company_name);
$copyObj->setNew(true);
$copyObj->setId(NULL);
}
public function copy($deepCopy = false)
{
$clazz = get_class($this);
$copyObj = new $clazz();
$this->copyInto($copyObj, $deepCopy);
return $copyObj;
}
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new ReferencePeer();
}
return self::$peer;
}
}

View File

@@ -0,0 +1,368 @@
<?php
abstract class BaseReferencePeer {
const DATABASE_NAME = 'propel';
const TABLE_NAME = 'Reference';
const CLASS_DEFAULT = 'lib.model.Reference';
const NUM_COLUMNS = 2;
const NUM_LAZY_LOAD_COLUMNS = 0;
const ID = 'Reference.ID';
const COMPANY_NAME = 'Reference.COMPANY_NAME';
private static $phpNameMap = null;
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Id', 'CompanyName', ),
BasePeer::TYPE_COLNAME => array (ReferencePeer::ID, ReferencePeer::COMPANY_NAME, ),
BasePeer::TYPE_FIELDNAME => array ('id', 'company_name', ),
BasePeer::TYPE_NUM => array (0, 1, )
);
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'CompanyName' => 1, ),
BasePeer::TYPE_COLNAME => array (ReferencePeer::ID => 0, ReferencePeer::COMPANY_NAME => 1, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'company_name' => 1, ),
BasePeer::TYPE_NUM => array (0, 1, )
);
public static function getMapBuilder()
{
include_once 'lib/model/map/ReferenceMapBuilder.php';
return BasePeer::getMapBuilder('lib.model.map.ReferenceMapBuilder');
}
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = ReferencePeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
public static function alias($alias, $column)
{
return str_replace(ReferencePeer::TABLE_NAME.'.', $alias.'.', $column);
}
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(ReferencePeer::ID);
$criteria->addSelectColumn(ReferencePeer::COMPANY_NAME);
}
const COUNT = 'COUNT(Reference.ID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT Reference.ID)';
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
$criteria = clone $criteria;
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(ReferencePeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(ReferencePeer::COUNT);
}
foreach($criteria->getGroupByColumns() as $column)
{
$criteria->addSelectColumn($column);
}
$rs = ReferencePeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
return 0;
}
}
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = ReferencePeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
public static function doSelect(Criteria $criteria, $con = null)
{
return ReferencePeer::populateObjects(ReferencePeer::doSelectRS($criteria, $con));
}
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
ReferencePeer::addSelectColumns($criteria);
}
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doSelect($criteria, $con);
}
public static function populateObjects(ResultSet $rs)
{
$results = array();
$cls = ReferencePeer::getOMClass();
$cls = Propel::import($cls);
while($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
public static function getOMClass()
{
return ReferencePeer::CLASS_DEFAULT;
}
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } else {
$criteria = $values->buildCriteria(); }
$criteria->remove(ReferencePeer::ID);
$criteria->setDbName(self::DATABASE_NAME);
try {
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch(PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values;
$comparison = $criteria->getComparison(ReferencePeer::ID);
$selectCriteria->add(ReferencePeer::ID, $criteria->remove(ReferencePeer::ID), $comparison);
} else { $criteria = $values->buildCriteria(); $selectCriteria = $values->buildPkeyCriteria(); }
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; try {
$con->begin();
$affectedRows += BasePeer::doDeleteAll(ReferencePeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(ReferencePeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; } elseif ($values instanceof Reference) {
$criteria = $values->buildPkeyCriteria();
} else {
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(ReferencePeer::ID, (array) $values, Criteria::IN);
}
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0;
try {
$con->begin();
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
public static function doValidate(Reference $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(ReferencePeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(ReferencePeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
$res = BasePeer::doValidate(ReferencePeer::DATABASE_NAME, ReferencePeer::TABLE_NAME, $columns);
if ($res !== true) {
$request = sfContext::getInstance()->getRequest();
foreach ($res as $failed) {
$col = ReferencePeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
$request->setError($col, $failed->getMessage());
}
}
return $res;
}
public static function retrieveByPK($pk, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria(ReferencePeer::DATABASE_NAME);
$criteria->add(ReferencePeer::ID, $pk);
$v = ReferencePeer::doSelect($criteria, $con);
return !empty($v) > 0 ? $v[0] : null;
}
public static function retrieveByPKs($pks, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria();
$criteria->add(ReferencePeer::ID, $pks, Criteria::IN);
$objs = ReferencePeer::doSelect($criteria, $con);
}
return $objs;
}
}
if (Propel::isInit()) {
try {
BaseReferencePeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
require_once 'lib/model/map/ReferenceMapBuilder.php';
Propel::registerMapBuilder('lib.model.map.ReferenceMapBuilder');
}

View File

@@ -0,0 +1,17 @@
K 25
svn:wc:ra_dav:version-url
V 61
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/symfony
END
VERSION
K 25
svn:wc:ra_dav:version-url
V 69
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/symfony/VERSION
END
symfony.php
K 25
svn:wc:ra_dav:version-url
V 73
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/symfony/symfony.php
END

View File

@@ -0,0 +1,162 @@
10
dir
55
http://barnabas/svn/pae.co.at/trunk/proactiveenglish/lib/symfony
http://barnabas/svn
2009-05-28T02:14:48.119086Z
25
ben
5f44b648-3ce2-dc11-a6be-00b0d029fcea
test
dir
helper
dir
i18n
dir
log
dir
controller
dir
validator
dir
addon
dir
filter
dir
VERSION
file
2010-07-31T05:42:27.000000Z
3c44a00c8bf4533e504048bc7e82daf9
2009-05-28T02:14:48.119086Z
25
ben
7
debug
dir
generator
dir
request
dir
symfony.php
file
2010-07-31T05:42:27.000000Z
472c074e2667ed34847542254258aa2e
2009-05-28T02:14:48.119086Z
25
ben
4666
vendor
dir
exception
dir
response
dir
cache
dir
database
dir
storage
dir
config
dir
view
dir
action
dir
util
dir
user
dir

View File

@@ -0,0 +1 @@
1.0.16

View File

@@ -0,0 +1,155 @@
<?php
/*
* This file is part of the symfony package.
* (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
* (c) 2004-2006 Sean Kerr <sean@code-box.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Pre-initialization script.
*
* @package symfony
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
* @author Sean Kerr <sean@code-box.org>
* @version SVN: $Id: symfony.php 7791 2008-03-09 21:57:09Z fabien $
*/
$sf_symfony_lib_dir = sfConfig::get('sf_symfony_lib_dir');
if (!sfConfig::get('sf_in_bootstrap'))
{
// YAML support
require_once($sf_symfony_lib_dir.'/util/sfYaml.class.php');
// cache support
require_once($sf_symfony_lib_dir.'/cache/sfCache.class.php');
require_once($sf_symfony_lib_dir.'/cache/sfFileCache.class.php');
// config support
require_once($sf_symfony_lib_dir.'/config/sfConfigCache.class.php');
require_once($sf_symfony_lib_dir.'/config/sfConfigHandler.class.php');
require_once($sf_symfony_lib_dir.'/config/sfYamlConfigHandler.class.php');
require_once($sf_symfony_lib_dir.'/config/sfAutoloadConfigHandler.class.php');
require_once($sf_symfony_lib_dir.'/config/sfRootConfigHandler.class.php');
require_once($sf_symfony_lib_dir.'/config/sfLoader.class.php');
// basic exception classes
require_once($sf_symfony_lib_dir.'/exception/sfException.class.php');
require_once($sf_symfony_lib_dir.'/exception/sfAutoloadException.class.php');
require_once($sf_symfony_lib_dir.'/exception/sfCacheException.class.php');
require_once($sf_symfony_lib_dir.'/exception/sfConfigurationException.class.php');
require_once($sf_symfony_lib_dir.'/exception/sfParseException.class.php');
// utils
require_once($sf_symfony_lib_dir.'/util/sfParameterHolder.class.php');
}
else
{
require_once($sf_symfony_lib_dir.'/config/sfConfigCache.class.php');
}
// autoloading
sfCore::initAutoload();
try
{
$configCache = sfConfigCache::getInstance();
// force setting default timezone if not set
if (function_exists('date_default_timezone_get'))
{
if ($default_timezone = sfConfig::get('sf_default_timezone'))
{
date_default_timezone_set($default_timezone);
}
else if (sfConfig::get('sf_force_default_timezone', true))
{
date_default_timezone_set(@date_default_timezone_get());
}
}
// get config instance
$sf_app_config_dir_name = sfConfig::get('sf_app_config_dir_name');
$sf_debug = sfConfig::get('sf_debug');
// load timer classes if in debug mode
if ($sf_debug)
{
require_once($sf_symfony_lib_dir.'/debug/sfTimerManager.class.php');
require_once($sf_symfony_lib_dir.'/debug/sfTimer.class.php');
}
// load base settings
include($configCache->checkConfig($sf_app_config_dir_name.'/settings.yml'));
if (sfConfig::get('sf_logging_enabled', true))
{
include($configCache->checkConfig($sf_app_config_dir_name.'/logging.yml'));
}
if ($file = $configCache->checkConfig($sf_app_config_dir_name.'/app.yml', true))
{
include($file);
}
if (sfConfig::get('sf_i18n'))
{
include($configCache->checkConfig($sf_app_config_dir_name.'/i18n.yml'));
}
// add autoloading callables
foreach ((array) sfConfig::get('sf_autoloading_functions', array()) as $callable)
{
sfCore::addAutoloadCallable($callable);
}
// error settings
ini_set('display_errors', $sf_debug ? 'on' : 'off');
error_reporting(sfConfig::get('sf_error_reporting'));
// create bootstrap file for next time
if (!sfConfig::get('sf_in_bootstrap') && !$sf_debug && !sfConfig::get('sf_test'))
{
$configCache->checkConfig($sf_app_config_dir_name.'/bootstrap_compile.yml');
}
// required core classes for the framework
// create a temp var to avoid substitution during compilation
if (!$sf_debug && !sfConfig::get('sf_test'))
{
$core_classes = $sf_app_config_dir_name.'/core_compile.yml';
$configCache->import($core_classes, false);
}
$configCache->import($sf_app_config_dir_name.'/php.yml', false);
$configCache->import($sf_app_config_dir_name.'/routing.yml', false);
// include all config.php from plugins
sfLoader::loadPluginConfig();
// compress output
ob_start(sfConfig::get('sf_compressed') ? 'ob_gzhandler' : '');
}
catch (sfException $e)
{
$e->printStackTrace();
}
catch (Exception $e)
{
if (sfConfig::get('sf_test'))
{
throw $e;
}
try
{
// wrap non symfony exceptions
$sfException = new sfException();
$sfException->printStackTrace($e);
}
catch (Exception $e)
{
header('HTTP/1.0 500 Internal Server Error');
}
}

View File

@@ -0,0 +1 @@
1.0.16

View File

@@ -0,0 +1,41 @@
K 25
svn:wc:ra_dav:version-url
V 68
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/symfony/action
END
sfAction.class.php
K 25
svn:wc:ra_dav:version-url
V 87
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/symfony/action/sfAction.class.php
END
sfActions.class.php
K 25
svn:wc:ra_dav:version-url
V 88
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/symfony/action/sfActions.class.php
END
sfComponent.class.php
K 25
svn:wc:ra_dav:version-url
V 90
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/symfony/action/sfComponent.class.php
END
sfActionStack.class.php
K 25
svn:wc:ra_dav:version-url
V 92
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/symfony/action/sfActionStack.class.php
END
sfActionStackEntry.class.php
K 25
svn:wc:ra_dav:version-url
V 97
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/symfony/action/sfActionStackEntry.class.php
END
sfComponents.class.php
K 25
svn:wc:ra_dav:version-url
V 91
/svn/!svn/ver/25/pae.co.at/trunk/proactiveenglish/lib/symfony/action/sfComponents.class.php
END

Some files were not shown because too many files have changed in this diff Show More