summaryrefslogtreecommitdiffstats
path: root/lib/model/om/BaseUser.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/model/om/BaseUser.php')
-rw-r--r--lib/model/om/BaseUser.php1261
1 files changed, 1261 insertions, 0 deletions
diff --git a/lib/model/om/BaseUser.php b/lib/model/om/BaseUser.php
new file mode 100644
index 0000000..c9588be
--- /dev/null
+++ b/lib/model/om/BaseUser.php
@@ -0,0 +1,1261 @@
+<?php
+
+
+abstract class BaseUser extends BaseObject implements Persistent {
+
+
+
+ protected static $peer;
+
+
+
+ protected $id;
+
+
+
+ protected $parent_user_id = -1;
+
+
+
+ protected $nickname;
+
+
+
+ protected $first_name;
+
+
+
+ protected $last_name;
+
+
+
+ protected $email;
+
+
+
+ protected $sha1_password;
+
+
+
+ protected $salt;
+
+
+
+ protected $role_id;
+
+
+
+ protected $last_login;
+
+
+
+ protected $created_at;
+
+
+ protected $aUserRelatedByParentUserId;
+
+
+ protected $aRole;
+
+
+ protected $collUsersRelatedByParentUserId;
+
+
+ protected $lastUserRelatedByParentUserIdCriteria = null;
+
+
+ protected $collDomainPermissions;
+
+
+ protected $lastDomainPermissionCriteria = null;
+
+
+ protected $collDomains;
+
+
+ protected $lastDomainCriteria = null;
+
+
+ protected $collLogEntrys;
+
+
+ protected $lastLogEntryCriteria = null;
+
+
+ protected $alreadyInSave = false;
+
+
+ protected $alreadyInValidation = false;
+
+
+ public function getId()
+ {
+
+ return $this->id;
+ }
+
+
+ public function getParentUserId()
+ {
+
+ return $this->parent_user_id;
+ }
+
+
+ public function getNickname()
+ {
+
+ return $this->nickname;
+ }
+
+
+ public function getFirstName()
+ {
+
+ return $this->first_name;
+ }
+
+
+ public function getLastName()
+ {
+
+ return $this->last_name;
+ }
+
+
+ public function getEmail()
+ {
+
+ return $this->email;
+ }
+
+
+ public function getSha1Password()
+ {
+
+ return $this->sha1_password;
+ }
+
+
+ public function getSalt()
+ {
+
+ return $this->salt;
+ }
+
+
+ public function getRoleId()
+ {
+
+ return $this->role_id;
+ }
+
+
+ public function getLastLogin($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->last_login === null || $this->last_login === '') {
+ return null;
+ } elseif (!is_int($this->last_login)) {
+ $ts = strtotime($this->last_login);
+ if ($ts === -1 || $ts === false) { throw new PropelException("Unable to parse value of [last_login] as date/time value: " . var_export($this->last_login, true));
+ }
+ } else {
+ $ts = $this->last_login;
+ }
+ if ($format === null) {
+ return $ts;
+ } elseif (strpos($format, '%') !== false) {
+ return strftime($format, $ts);
+ } else {
+ return date($format, $ts);
+ }
+ }
+
+
+ public function getCreatedAt($format = 'Y-m-d H:i:s')
+ {
+
+ if ($this->created_at === null || $this->created_at === '') {
+ return null;
+ } elseif (!is_int($this->created_at)) {
+ $ts = strtotime($this->created_at);
+ if ($ts === -1 || $ts === false) { throw new PropelException("Unable to parse value of [created_at] as date/time value: " . var_export($this->created_at, true));
+ }
+ } else {
+ $ts = $this->created_at;
+ }
+ 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[] = UserPeer::ID;
+ }
+
+ }
+
+ public function setParentUserId($v)
+ {
+
+ if ($v !== null && !is_int($v) && is_numeric($v)) {
+ $v = (int) $v;
+ }
+
+ if ($this->parent_user_id !== $v || $v === -1) {
+ $this->parent_user_id = $v;
+ $this->modifiedColumns[] = UserPeer::PARENT_USER_ID;
+ }
+
+ if ($this->aUserRelatedByParentUserId !== null && $this->aUserRelatedByParentUserId->getId() !== $v) {
+ $this->aUserRelatedByParentUserId = null;
+ }
+
+ }
+
+ public function setNickname($v)
+ {
+
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->nickname !== $v) {
+ $this->nickname = $v;
+ $this->modifiedColumns[] = UserPeer::NICKNAME;
+ }
+
+ }
+
+ public function setFirstName($v)
+ {
+
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->first_name !== $v) {
+ $this->first_name = $v;
+ $this->modifiedColumns[] = UserPeer::FIRST_NAME;
+ }
+
+ }
+
+ public function setLastName($v)
+ {
+
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->last_name !== $v) {
+ $this->last_name = $v;
+ $this->modifiedColumns[] = UserPeer::LAST_NAME;
+ }
+
+ }
+
+ public function setEmail($v)
+ {
+
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->email !== $v) {
+ $this->email = $v;
+ $this->modifiedColumns[] = UserPeer::EMAIL;
+ }
+
+ }
+
+ public function setSha1Password($v)
+ {
+
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->sha1_password !== $v) {
+ $this->sha1_password = $v;
+ $this->modifiedColumns[] = UserPeer::SHA1_PASSWORD;
+ }
+
+ }
+
+ public function setSalt($v)
+ {
+
+ if ($v !== null && !is_string($v)) {
+ $v = (string) $v;
+ }
+
+ if ($this->salt !== $v) {
+ $this->salt = $v;
+ $this->modifiedColumns[] = UserPeer::SALT;
+ }
+
+ }
+
+ public function setRoleId($v)
+ {
+
+ if ($v !== null && !is_int($v) && is_numeric($v)) {
+ $v = (int) $v;
+ }
+
+ if ($this->role_id !== $v) {
+ $this->role_id = $v;
+ $this->modifiedColumns[] = UserPeer::ROLE_ID;
+ }
+
+ if ($this->aRole !== null && $this->aRole->getId() !== $v) {
+ $this->aRole = null;
+ }
+
+ }
+
+ public function setLastLogin($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 [last_login] from input: " . var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->last_login !== $ts) {
+ $this->last_login = $ts;
+ $this->modifiedColumns[] = UserPeer::LAST_LOGIN;
+ }
+
+ }
+
+ public function setCreatedAt($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 [created_at] from input: " . var_export($v, true));
+ }
+ } else {
+ $ts = $v;
+ }
+ if ($this->created_at !== $ts) {
+ $this->created_at = $ts;
+ $this->modifiedColumns[] = UserPeer::CREATED_AT;
+ }
+
+ }
+
+ public function hydrate(ResultSet $rs, $startcol = 1)
+ {
+ try {
+
+ $this->id = $rs->getInt($startcol + 0);
+
+ $this->parent_user_id = $rs->getInt($startcol + 1);
+
+ $this->nickname = $rs->getString($startcol + 2);
+
+ $this->first_name = $rs->getString($startcol + 3);
+
+ $this->last_name = $rs->getString($startcol + 4);
+
+ $this->email = $rs->getString($startcol + 5);
+
+ $this->sha1_password = $rs->getString($startcol + 6);
+
+ $this->salt = $rs->getString($startcol + 7);
+
+ $this->role_id = $rs->getInt($startcol + 8);
+
+ $this->last_login = $rs->getTimestamp($startcol + 9, null);
+
+ $this->created_at = $rs->getTimestamp($startcol + 10, null);
+
+ $this->resetModified();
+
+ $this->setNew(false);
+
+ return $startcol + 11;
+ } catch (Exception $e) {
+ throw new PropelException("Error populating User 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(UserPeer::DATABASE_NAME);
+ }
+
+ try {
+ $con->begin();
+ UserPeer::doDelete($this, $con);
+ $this->setDeleted(true);
+ $con->commit();
+ } catch (PropelException $e) {
+ $con->rollback();
+ throw $e;
+ }
+ }
+
+
+ public function save($con = null)
+ {
+ if ($this->isNew() && !$this->isColumnModified(UserPeer::CREATED_AT))
+ {
+ $this->setCreatedAt(time());
+ }
+
+ if ($this->isDeleted()) {
+ throw new PropelException("You cannot save an object that has been deleted.");
+ }
+
+ if ($con === null) {
+ $con = Propel::getConnection(UserPeer::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->aUserRelatedByParentUserId !== null) {
+ if ($this->aUserRelatedByParentUserId->isModified()) {
+ $affectedRows += $this->aUserRelatedByParentUserId->save($con);
+ }
+ $this->setUserRelatedByParentUserId($this->aUserRelatedByParentUserId);
+ }
+
+ if ($this->aRole !== null) {
+ if ($this->aRole->isModified()) {
+ $affectedRows += $this->aRole->save($con);
+ }
+ $this->setRole($this->aRole);
+ }
+
+
+ if ($this->isModified()) {
+ if ($this->isNew()) {
+ $pk = UserPeer::doInsert($this, $con);
+ $affectedRows += 1;
+ $this->setId($pk);
+ $this->setNew(false);
+ } else {
+ $affectedRows += UserPeer::doUpdate($this, $con);
+ }
+ $this->resetModified(); }
+
+ if ($this->collUsersRelatedByParentUserId !== null) {
+ foreach($this->collUsersRelatedByParentUserId as $referrerFK) {
+ if (!$referrerFK->isDeleted()) {
+ $affectedRows += $referrerFK->save($con);
+ }
+ }
+ }
+
+ if ($this->collDomainPermissions !== null) {
+ foreach($this->collDomainPermissions as $referrerFK) {
+ if (!$referrerFK->isDeleted()) {
+ $affectedRows += $referrerFK->save($con);
+ }
+ }
+ }
+
+ if ($this->collDomains !== null) {
+ foreach($this->collDomains as $referrerFK) {
+ if (!$referrerFK->isDeleted()) {
+ $affectedRows += $referrerFK->save($con);
+ }
+ }
+ }
+
+ if ($this->collLogEntrys !== null) {
+ foreach($this->collLogEntrys 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->aUserRelatedByParentUserId !== null) {
+ if (!$this->aUserRelatedByParentUserId->validate($columns)) {
+ $failureMap = array_merge($failureMap, $this->aUserRelatedByParentUserId->getValidationFailures());
+ }
+ }
+
+ if ($this->aRole !== null) {
+ if (!$this->aRole->validate($columns)) {
+ $failureMap = array_merge($failureMap, $this->aRole->getValidationFailures());
+ }
+ }
+
+
+ if (($retval = UserPeer::doValidate($this, $columns)) !== true) {
+ $failureMap = array_merge($failureMap, $retval);
+ }
+
+
+ if ($this->collDomainPermissions !== null) {
+ foreach($this->collDomainPermissions as $referrerFK) {
+ if (!$referrerFK->validate($columns)) {
+ $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
+ }
+ }
+ }
+
+ if ($this->collDomains !== null) {
+ foreach($this->collDomains as $referrerFK) {
+ if (!$referrerFK->validate($columns)) {
+ $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
+ }
+ }
+ }
+
+ if ($this->collLogEntrys !== null) {
+ foreach($this->collLogEntrys 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 = UserPeer::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->getParentUserId();
+ break;
+ case 2:
+ return $this->getNickname();
+ break;
+ case 3:
+ return $this->getFirstName();
+ break;
+ case 4:
+ return $this->getLastName();
+ break;
+ case 5:
+ return $this->getEmail();
+ break;
+ case 6:
+ return $this->getSha1Password();
+ break;
+ case 7:
+ return $this->getSalt();
+ break;
+ case 8:
+ return $this->getRoleId();
+ break;
+ case 9:
+ return $this->getLastLogin();
+ break;
+ case 10:
+ return $this->getCreatedAt();
+ break;
+ default:
+ return null;
+ break;
+ } }
+
+
+ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = UserPeer::getFieldNames($keyType);
+ $result = array(
+ $keys[0] => $this->getId(),
+ $keys[1] => $this->getParentUserId(),
+ $keys[2] => $this->getNickname(),
+ $keys[3] => $this->getFirstName(),
+ $keys[4] => $this->getLastName(),
+ $keys[5] => $this->getEmail(),
+ $keys[6] => $this->getSha1Password(),
+ $keys[7] => $this->getSalt(),
+ $keys[8] => $this->getRoleId(),
+ $keys[9] => $this->getLastLogin(),
+ $keys[10] => $this->getCreatedAt(),
+ );
+ return $result;
+ }
+
+
+ public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
+ {
+ $pos = UserPeer::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->setParentUserId($value);
+ break;
+ case 2:
+ $this->setNickname($value);
+ break;
+ case 3:
+ $this->setFirstName($value);
+ break;
+ case 4:
+ $this->setLastName($value);
+ break;
+ case 5:
+ $this->setEmail($value);
+ break;
+ case 6:
+ $this->setSha1Password($value);
+ break;
+ case 7:
+ $this->setSalt($value);
+ break;
+ case 8:
+ $this->setRoleId($value);
+ break;
+ case 9:
+ $this->setLastLogin($value);
+ break;
+ case 10:
+ $this->setCreatedAt($value);
+ break;
+ } }
+
+
+ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
+ {
+ $keys = UserPeer::getFieldNames($keyType);
+
+ if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
+ if (array_key_exists($keys[1], $arr)) $this->setParentUserId($arr[$keys[1]]);
+ if (array_key_exists($keys[2], $arr)) $this->setNickname($arr[$keys[2]]);
+ if (array_key_exists($keys[3], $arr)) $this->setFirstName($arr[$keys[3]]);
+ if (array_key_exists($keys[4], $arr)) $this->setLastName($arr[$keys[4]]);
+ if (array_key_exists($keys[5], $arr)) $this->setEmail($arr[$keys[5]]);
+ if (array_key_exists($keys[6], $arr)) $this->setSha1Password($arr[$keys[6]]);
+ if (array_key_exists($keys[7], $arr)) $this->setSalt($arr[$keys[7]]);
+ if (array_key_exists($keys[8], $arr)) $this->setRoleId($arr[$keys[8]]);
+ if (array_key_exists($keys[9], $arr)) $this->setLastLogin($arr[$keys[9]]);
+ if (array_key_exists($keys[10], $arr)) $this->setCreatedAt($arr[$keys[10]]);
+ }
+
+
+ public function buildCriteria()
+ {
+ $criteria = new Criteria(UserPeer::DATABASE_NAME);
+
+ if ($this->isColumnModified(UserPeer::ID)) $criteria->add(UserPeer::ID, $this->id);
+ if ($this->isColumnModified(UserPeer::PARENT_USER_ID)) $criteria->add(UserPeer::PARENT_USER_ID, $this->parent_user_id);
+ if ($this->isColumnModified(UserPeer::NICKNAME)) $criteria->add(UserPeer::NICKNAME, $this->nickname);
+ if ($this->isColumnModified(UserPeer::FIRST_NAME)) $criteria->add(UserPeer::FIRST_NAME, $this->first_name);
+ if ($this->isColumnModified(UserPeer::LAST_NAME)) $criteria->add(UserPeer::LAST_NAME, $this->last_name);
+ if ($this->isColumnModified(UserPeer::EMAIL)) $criteria->add(UserPeer::EMAIL, $this->email);
+ if ($this->isColumnModified(UserPeer::SHA1_PASSWORD)) $criteria->add(UserPeer::SHA1_PASSWORD, $this->sha1_password);
+ if ($this->isColumnModified(UserPeer::SALT)) $criteria->add(UserPeer::SALT, $this->salt);
+ if ($this->isColumnModified(UserPeer::ROLE_ID)) $criteria->add(UserPeer::ROLE_ID, $this->role_id);
+ if ($this->isColumnModified(UserPeer::LAST_LOGIN)) $criteria->add(UserPeer::LAST_LOGIN, $this->last_login);
+ if ($this->isColumnModified(UserPeer::CREATED_AT)) $criteria->add(UserPeer::CREATED_AT, $this->created_at);
+
+ return $criteria;
+ }
+
+
+ public function buildPkeyCriteria()
+ {
+ $criteria = new Criteria(UserPeer::DATABASE_NAME);
+
+ $criteria->add(UserPeer::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->setParentUserId($this->parent_user_id);
+
+ $copyObj->setNickname($this->nickname);
+
+ $copyObj->setFirstName($this->first_name);
+
+ $copyObj->setLastName($this->last_name);
+
+ $copyObj->setEmail($this->email);
+
+ $copyObj->setSha1Password($this->sha1_password);
+
+ $copyObj->setSalt($this->salt);
+
+ $copyObj->setRoleId($this->role_id);
+
+ $copyObj->setLastLogin($this->last_login);
+
+ $copyObj->setCreatedAt($this->created_at);
+
+
+ if ($deepCopy) {
+ $copyObj->setNew(false);
+
+ foreach($this->getUsersRelatedByParentUserId() as $relObj) {
+ if($this->getPrimaryKey() === $relObj->getPrimaryKey()) {
+ continue;
+ }
+
+ $copyObj->addUserRelatedByParentUserId($relObj->copy($deepCopy));
+ }
+
+ foreach($this->getDomainPermissions() as $relObj) {
+ $copyObj->addDomainPermission($relObj->copy($deepCopy));
+ }
+
+ foreach($this->getDomains() as $relObj) {
+ $copyObj->addDomain($relObj->copy($deepCopy));
+ }
+
+ foreach($this->getLogEntrys() as $relObj) {
+ $copyObj->addLogEntry($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 UserPeer();
+ }
+ return self::$peer;
+ }
+
+
+ public function setUserRelatedByParentUserId($v)
+ {
+
+
+ if ($v === null) {
+ $this->setParentUserId('-1');
+ } else {
+ $this->setParentUserId($v->getId());
+ }
+
+
+ $this->aUserRelatedByParentUserId = $v;
+ }
+
+
+
+ public function getUserRelatedByParentUserId($con = null)
+ {
+ include_once 'lib/model/om/BaseUserPeer.php';
+
+ if ($this->aUserRelatedByParentUserId === null && ($this->parent_user_id !== null)) {
+
+ $this->aUserRelatedByParentUserId = UserPeer::retrieveByPK($this->parent_user_id, $con);
+
+
+ }
+ return $this->aUserRelatedByParentUserId;
+ }
+
+
+ public function setRole($v)
+ {
+
+
+ if ($v === null) {
+ $this->setRoleId(NULL);
+ } else {
+ $this->setRoleId($v->getId());
+ }
+
+
+ $this->aRole = $v;
+ }
+
+
+
+ public function getRole($con = null)
+ {
+ include_once 'lib/model/om/BaseRolePeer.php';
+
+ if ($this->aRole === null && ($this->role_id !== null)) {
+
+ $this->aRole = RolePeer::retrieveByPK($this->role_id, $con);
+
+
+ }
+ return $this->aRole;
+ }
+
+
+ public function initUsersRelatedByParentUserId()
+ {
+ if ($this->collUsersRelatedByParentUserId === null) {
+ $this->collUsersRelatedByParentUserId = array();
+ }
+ }
+
+
+ public function getUsersRelatedByParentUserId($criteria = null, $con = null)
+ {
+ include_once 'lib/model/om/BaseUserPeer.php';
+ if ($criteria === null) {
+ $criteria = new Criteria();
+ }
+ elseif ($criteria instanceof Criteria)
+ {
+ $criteria = clone $criteria;
+ }
+
+ if ($this->collUsersRelatedByParentUserId === null) {
+ if ($this->isNew()) {
+ $this->collUsersRelatedByParentUserId = array();
+ } else {
+
+ $criteria->add(UserPeer::PARENT_USER_ID, $this->getId());
+
+ UserPeer::addSelectColumns($criteria);
+ $this->collUsersRelatedByParentUserId = UserPeer::doSelect($criteria, $con);
+ }
+ } else {
+ if (!$this->isNew()) {
+
+
+ $criteria->add(UserPeer::PARENT_USER_ID, $this->getId());
+
+ UserPeer::addSelectColumns($criteria);
+ if (!isset($this->lastUserRelatedByParentUserIdCriteria) || !$this->lastUserRelatedByParentUserIdCriteria->equals($criteria)) {
+ $this->collUsersRelatedByParentUserId = UserPeer::doSelect($criteria, $con);
+ }
+ }
+ }
+ $this->lastUserRelatedByParentUserIdCriteria = $criteria;
+ return $this->collUsersRelatedByParentUserId;
+ }
+
+
+ public function countUsersRelatedByParentUserId($criteria = null, $distinct = false, $con = null)
+ {
+ include_once 'lib/model/om/BaseUserPeer.php';
+ if ($criteria === null) {
+ $criteria = new Criteria();
+ }
+ elseif ($criteria instanceof Criteria)
+ {
+ $criteria = clone $criteria;
+ }
+
+ $criteria->add(UserPeer::PARENT_USER_ID, $this->getId());
+
+ return UserPeer::doCount($criteria, $distinct, $con);
+ }
+
+
+ public function addUserRelatedByParentUserId(User $l)
+ {
+ $this->collUsersRelatedByParentUserId[] = $l;
+ $l->setUserRelatedByParentUserId($this);
+ }
+
+
+
+ public function getUsersRelatedByParentUserIdJoinRole($criteria = null, $con = null)
+ {
+ include_once 'lib/model/om/BaseUserPeer.php';
+ if ($criteria === null) {
+ $criteria = new Criteria();
+ }
+ elseif ($criteria instanceof Criteria)
+ {
+ $criteria = clone $criteria;
+ }
+
+ if ($this->collUsersRelatedByParentUserId === null) {
+ if ($this->isNew()) {
+ $this->collUsersRelatedByParentUserId = array();
+ } else {
+
+ $criteria->add(UserPeer::PARENT_USER_ID, $this->getId());
+
+ $this->collUsersRelatedByParentUserId = UserPeer::doSelectJoinRole($criteria, $con);
+ }
+ } else {
+
+ $criteria->add(UserPeer::PARENT_USER_ID, $this->getId());
+
+ if (!isset($this->lastUserRelatedByParentUserIdCriteria) || !$this->lastUserRelatedByParentUserIdCriteria->equals($criteria)) {
+ $this->collUsersRelatedByParentUserId = UserPeer::doSelectJoinRole($criteria, $con);
+ }
+ }
+ $this->lastUserRelatedByParentUserIdCriteria = $criteria;
+
+ return $this->collUsersRelatedByParentUserId;
+ }
+
+
+ public function initDomainPermissions()
+ {
+ if ($this->collDomainPermissions === null) {
+ $this->collDomainPermissions = array();
+ }
+ }
+
+
+ public function getDomainPermissions($criteria = null, $con = null)
+ {
+ include_once 'lib/model/om/BaseDomainPermissionPeer.php';
+ if ($criteria === null) {
+ $criteria = new Criteria();
+ }
+ elseif ($criteria instanceof Criteria)
+ {
+ $criteria = clone $criteria;
+ }
+
+ if ($this->collDomainPermissions === null) {
+ if ($this->isNew()) {
+ $this->collDomainPermissions = array();
+ } else {
+
+ $criteria->add(DomainPermissionPeer::USER_ID, $this->getId());
+
+ DomainPermissionPeer::addSelectColumns($criteria);
+ $this->collDomainPermissions = DomainPermissionPeer::doSelect($criteria, $con);
+ }
+ } else {
+ if (!$this->isNew()) {
+
+
+ $criteria->add(DomainPermissionPeer::USER_ID, $this->getId());
+
+ DomainPermissionPeer::addSelectColumns($criteria);
+ if (!isset($this->lastDomainPermissionCriteria) || !$this->lastDomainPermissionCriteria->equals($criteria)) {
+ $this->collDomainPermissions = DomainPermissionPeer::doSelect($criteria, $con);
+ }
+ }
+ }
+ $this->lastDomainPermissionCriteria = $criteria;
+ return $this->collDomainPermissions;
+ }
+
+
+ public function countDomainPermissions($criteria = null, $distinct = false, $con = null)
+ {
+ include_once 'lib/model/om/BaseDomainPermissionPeer.php';
+ if ($criteria === null) {
+ $criteria = new Criteria();
+ }
+ elseif ($criteria instanceof Criteria)
+ {
+ $criteria = clone $criteria;
+ }
+
+ $criteria->add(DomainPermissionPeer::USER_ID, $this->getId());
+
+ return DomainPermissionPeer::doCount($criteria, $distinct, $con);
+ }
+
+
+ public function addDomainPermission(DomainPermission $l)
+ {
+ $this->collDomainPermissions[] = $l;
+ $l->setUser($this);
+ }
+
+
+
+ public function getDomainPermissionsJoinDomain($criteria = null, $con = null)
+ {
+ include_once 'lib/model/om/BaseDomainPermissionPeer.php';
+ if ($criteria === null) {
+ $criteria = new Criteria();
+ }
+ elseif ($criteria instanceof Criteria)
+ {
+ $criteria = clone $criteria;
+ }
+
+ if ($this->collDomainPermissions === null) {
+ if ($this->isNew()) {
+ $this->collDomainPermissions = array();
+ } else {
+
+ $criteria->add(DomainPermissionPeer::USER_ID, $this->getId());
+
+ $this->collDomainPermissions = DomainPermissionPeer::doSelectJoinDomain($criteria, $con);
+ }
+ } else {
+
+ $criteria->add(DomainPermissionPeer::USER_ID, $this->getId());
+
+ if (!isset($this->lastDomainPermissionCriteria) || !$this->lastDomainPermissionCriteria->equals($criteria)) {
+ $this->collDomainPermissions = DomainPermissionPeer::doSelectJoinDomain($criteria, $con);
+ }
+ }
+ $this->lastDomainPermissionCriteria = $criteria;
+
+ return $this->collDomainPermissions;
+ }
+
+
+ public function initDomains()
+ {
+ if ($this->collDomains === null) {
+ $this->collDomains = array();
+ }
+ }
+
+
+ public function getDomains($criteria = null, $con = null)
+ {
+ include_once 'lib/model/om/BaseDomainPeer.php';
+ if ($criteria === null) {
+ $criteria = new Criteria();
+ }
+ elseif ($criteria instanceof Criteria)
+ {
+ $criteria = clone $criteria;
+ }
+
+ if ($this->collDomains === null) {
+ if ($this->isNew()) {
+ $this->collDomains = array();
+ } else {
+
+ $criteria->add(DomainPeer::CREATOR_ID, $this->getId());
+
+ DomainPeer::addSelectColumns($criteria);
+ $this->collDomains = DomainPeer::doSelect($criteria, $con);
+ }
+ } else {
+ if (!$this->isNew()) {
+
+
+ $criteria->add(DomainPeer::CREATOR_ID, $this->getId());
+
+ DomainPeer::addSelectColumns($criteria);
+ if (!isset($this->lastDomainCriteria) || !$this->lastDomainCriteria->equals($criteria)) {
+ $this->collDomains = DomainPeer::doSelect($criteria, $con);
+ }
+ }
+ }
+ $this->lastDomainCriteria = $criteria;
+ return $this->collDomains;
+ }
+
+
+ public function countDomains($criteria = null, $distinct = false, $con = null)
+ {
+ include_once 'lib/model/om/BaseDomainPeer.php';
+ if ($criteria === null) {
+ $criteria = new Criteria();
+ }
+ elseif ($criteria instanceof Criteria)
+ {
+ $criteria = clone $criteria;
+ }
+
+ $criteria->add(DomainPeer::CREATOR_ID, $this->getId());
+
+ return DomainPeer::doCount($criteria, $distinct, $con);
+ }
+
+
+ public function addDomain(Domain $l)
+ {
+ $this->collDomains[] = $l;
+ $l->setUser($this);
+ }
+
+
+ public function initLogEntrys()
+ {
+ if ($this->collLogEntrys === null) {
+ $this->collLogEntrys = array();
+ }
+ }
+
+
+ public function getLogEntrys($criteria = null, $con = null)
+ {
+ include_once 'lib/model/om/BaseLogEntryPeer.php';
+ if ($criteria === null) {
+ $criteria = new Criteria();
+ }
+ elseif ($criteria instanceof Criteria)
+ {
+ $criteria = clone $criteria;
+ }
+
+ if ($this->collLogEntrys === null) {
+ if ($this->isNew()) {
+ $this->collLogEntrys = array();
+ } else {
+
+ $criteria->add(LogEntryPeer::USER_ID, $this->getId());
+
+ LogEntryPeer::addSelectColumns($criteria);
+ $this->collLogEntrys = LogEntryPeer::doSelect($criteria, $con);
+ }
+ } else {
+ if (!$this->isNew()) {
+
+
+ $criteria->add(LogEntryPeer::USER_ID, $this->getId());
+
+ LogEntryPeer::addSelectColumns($criteria);
+ if (!isset($this->lastLogEntryCriteria) || !$this->lastLogEntryCriteria->equals($criteria)) {
+ $this->collLogEntrys = LogEntryPeer::doSelect($criteria, $con);
+ }
+ }
+ }
+ $this->lastLogEntryCriteria = $criteria;
+ return $this->collLogEntrys;
+ }
+
+
+ public function countLogEntrys($criteria = null, $distinct = false, $con = null)
+ {
+ include_once 'lib/model/om/BaseLogEntryPeer.php';
+ if ($criteria === null) {
+ $criteria = new Criteria();
+ }
+ elseif ($criteria instanceof Criteria)
+ {
+ $criteria = clone $criteria;
+ }
+
+ $criteria->add(LogEntryPeer::USER_ID, $this->getId());
+
+ return LogEntryPeer::doCount($criteria, $distinct, $con);
+ }
+
+
+ public function addLogEntry(LogEntry $l)
+ {
+ $this->collLogEntrys[] = $l;
+ $l->setUser($this);
+ }
+
+} \ No newline at end of file