Beispiel #1
0
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     $keys = UserTableMap::getFieldNames(TableMap::TYPE_FIELDNAME);
     $register_data = array();
     foreach ($data as $key => $value) {
         if (in_array($key, $keys)) {
             $register_data[$key] = $value;
         }
     }
     $register_data["user_pass"] = bcrypt($data['password']);
     $register_data["role_id"] = RoleQuery::getClient();
     $register_data["user_is_validated"] = ConfigQuery::getRegisterMustBeValidated();
     $user = new User();
     $user->fromArray($register_data, TableMap::TYPE_FIELDNAME);
     $user->save();
     return $user;
 }
Beispiel #2
0
 /**
  * Filter the query by a related \App\Propel\User object
  *
  * @param \App\Propel\User|ObjectCollection $user the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildResourceQuery The current query, for fluid interface
  */
 public function filterByUser($user, $comparison = null)
 {
     if ($user instanceof \App\Propel\User) {
         return $this->addUsingAlias(ResourceTableMap::COL_RESOURCE_ID, $user->getResourceId(), $comparison);
     } elseif ($user instanceof ObjectCollection) {
         return $this->useUserQuery()->filterByPrimaryKeys($user->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByUser() only accepts arguments of type \\App\\Propel\\User or Collection');
     }
 }
Beispiel #3
0
 /**
  * @param ChildUser $user The ChildUser object to add.
  */
 protected function doAddUser(ChildUser $user)
 {
     $this->collUsers[] = $user;
     $user->setFile($this);
 }
Beispiel #4
0
 /**
  * Filter the query by a related \App\Propel\User object
  *
  * @param \App\Propel\User|ObjectCollection $user The related object(s) to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @throws \Propel\Runtime\Exception\PropelException
  *
  * @return ChildWishlistQuery The current query, for fluid interface
  */
 public function filterByUser($user, $comparison = null)
 {
     if ($user instanceof \App\Propel\User) {
         return $this->addUsingAlias(WishlistTableMap::COL_USER_ID, $user->getUserId(), $comparison);
     } elseif ($user instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(WishlistTableMap::COL_USER_ID, $user->toKeyValue('PrimaryKey', 'UserId'), $comparison);
     } else {
         throw new PropelException('filterByUser() only accepts arguments of type \\App\\Propel\\User or Collection');
     }
 }
 /**
  * Filter the query by a related \App\Propel\User object
  *
  * @param \App\Propel\User|ObjectCollection $user The related object(s) to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @throws \Propel\Runtime\Exception\PropelException
  *
  * @return ChildSocialRecommendationQuery The current query, for fluid interface
  */
 public function filterByUserRelatedBySocialRecommendationTo($user, $comparison = null)
 {
     if ($user instanceof \App\Propel\User) {
         return $this->addUsingAlias(SocialRecommendationTableMap::COL_SOCIAL_RECOMMENDATION_TO, $user->getUserId(), $comparison);
     } elseif ($user instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(SocialRecommendationTableMap::COL_SOCIAL_RECOMMENDATION_TO, $user->toKeyValue('PrimaryKey', 'UserId'), $comparison);
     } else {
         throw new PropelException('filterByUserRelatedBySocialRecommendationTo() only accepts arguments of type \\App\\Propel\\User or Collection');
     }
 }
Beispiel #6
0
 /**
  * Clears the current object, sets all attributes to their default values and removes
  * outgoing references as well as back-references (from other objects to this one. Results probably in a database
  * change of those foreign objects when you call `save` there).
  */
 public function clear()
 {
     if (null !== $this->aUser) {
         $this->aUser->removeSocialComment($this);
     }
     if (null !== $this->aResource) {
         $this->aResource->removeSocialComment($this);
     }
     $this->social_comment_id = null;
     $this->user_id = null;
     $this->social_comment_for = null;
     $this->social_comment_body = null;
     $this->created_at = null;
     $this->updated_at = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }
Beispiel #7
0
 /**
  * Clears the current object, sets all attributes to their default values and removes
  * outgoing references as well as back-references (from other objects to this one. Results probably in a database
  * change of those foreign objects when you call `save` there).
  */
 public function clear()
 {
     if (null !== $this->aUser) {
         $this->aUser->removeUserPeriodicPlan($this);
     }
     if (null !== $this->aPeriodicPlan) {
         $this->aPeriodicPlan->removeUserPeriodicPlan($this);
     }
     $this->user_periodic_plan_id = null;
     $this->user_id = null;
     $this->periodic_plan_id = null;
     $this->created_at = null;
     $this->updated_at = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }
Beispiel #8
0
 /**
  * Clears the current object, sets all attributes to their default values and removes
  * outgoing references as well as back-references (from other objects to this one. Results probably in a database
  * change of those foreign objects when you call `save` there).
  */
 public function clear()
 {
     if (null !== $this->aUser) {
         $this->aUser->removeSocialLike($this);
     }
     if (null !== $this->aResource) {
         $this->aResource->removeSocialLike($this);
     }
     $this->social_like_id = null;
     $this->user_id = null;
     $this->social_like_for = null;
     $this->social_like_direction = null;
     $this->created_at = null;
     $this->updated_at = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->applyDefaultValues();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }
 /**
  * Clears the current object, sets all attributes to their default values and removes
  * outgoing references as well as back-references (from other objects to this one. Results probably in a database
  * change of those foreign objects when you call `save` there).
  */
 public function clear()
 {
     if (null !== $this->aUserRelatedByUserId) {
         $this->aUserRelatedByUserId->removeSocialRecommendationRelatedByUserId($this);
     }
     if (null !== $this->aResource) {
         $this->aResource->removeSocialRecommendation($this);
     }
     if (null !== $this->aUserRelatedBySocialRecommendationTo) {
         $this->aUserRelatedBySocialRecommendationTo->removeSocialRecommendationRelatedBySocialRecommendationTo($this);
     }
     $this->social_recommendation_id = null;
     $this->user_id = null;
     $this->social_recommendation_for = null;
     $this->social_recommendation_to = null;
     $this->created_at = null;
     $this->updated_at = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }
Beispiel #10
0
 /**
  * Clears the current object, sets all attributes to their default values and removes
  * outgoing references as well as back-references (from other objects to this one. Results probably in a database
  * change of those foreign objects when you call `save` there).
  */
 public function clear()
 {
     if (null !== $this->aUser) {
         $this->aUser->removeWishlist($this);
     }
     $this->wishlist_id = null;
     $this->user_id = null;
     $this->wishlist_name = null;
     $this->wishlist_comment = null;
     $this->wishlist_is_public = null;
     $this->created_at = null;
     $this->updated_at = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }
Beispiel #11
0
 /**
  * Clears the current object, sets all attributes to their default values and removes
  * outgoing references as well as back-references (from other objects to this one. Results probably in a database
  * change of those foreign objects when you call `save` there).
  */
 public function clear()
 {
     if (null !== $this->aUser) {
         $this->aUser->removeOrder($this);
     }
     if (null !== $this->aDelivery) {
         $this->aDelivery->removeOrder($this);
     }
     $this->order_id = null;
     $this->user_id = null;
     $this->delivery_id = null;
     $this->order_comment = null;
     $this->created_at = null;
     $this->updated_at = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }
Beispiel #12
0
 /**
  * Exclude object from result
  *
  * @param   ChildUser $user Object to remove from the list of results
  *
  * @return $this|ChildUserQuery The current query, for fluid interface
  */
 public function prune($user = null)
 {
     if ($user) {
         $this->addUsingAlias(UserTableMap::COL_USER_ID, $user->getUserId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }