public function save(User $user)
    {
        if ($user->getId() != null) {
            return $this->update($user);
        }
        return $this->create($user);
    }
public function save(User $user)
    {
        if ($user->getId() != null) {
            return $this->update($user);
        }
        return $this->create($user);
    }
public function save ( User $ user ) { if ( $ user -> getId ( ) != null ) { return $ this -> update ( $ user ) ; } return $ this -> create ( $ user ) ; }
Create or update user

@param User $user
@return User
Create or update user