Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6766843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:52:48+00:00 2026-05-26T14:52:48+00:00

I have a question about symfony. I’m working on a website and everything was

  • 0

I have a question about symfony. I’m working on a website and everything was going great, when suddently, without even touching, it all stoped. I narrow it down to a problem in my “getClient” function. Here’s the code: (im using doAuthPlugin if that matters)

in: app/client/lib/myUser.class.php:

public function getClient()
{

    $uTemp = $this->getAccount()->getClients()->getFirst();

    $userId = $uTemp['_data']['userid'];

    $q = Doctrine_Query::create()
        ->from('Client c')
        ->where('c.id  = ?', $userId);

    $result = $q->fetchArray();

    if(sizeof($result) > 0){

        return $this->getAccount()->getClients()->getFirst();
    }else{

        return false;
    }
}

On the first line, $uTemp == false. Although there is something in $this->getAccount()->getClients().

If someone could shed some light on this, I really suck with Symfony! :p

Thanks!

EDIT:

Here’s get Account:

public function getAccount()
{
   if (!$this->user && $id = $this->getAttribute('user_id', null, 'doUser'))
   {
      $this->user = Doctrine::getTable('User')->find($id);

      if (!$this->user)
      {
        // the user does not exist anymore in the database
        $this->signOut();

        throw new sfException('The user does not exist anymore in the database.');
      }
    }

   return $this->user;
 }

I cannot find getClients, it’s automatically generated by symfony (and since I don’t know symfony that much…)

EDIT 2:

if I do a var_dump on $this->getAccount->getClients(), it’s empty:

object(Client)#123 (18) {
  ["_node":protected]=>
  NULL
  ["_id":protected]=>
  array(0) {
  }
  ["_data":protected]=>
  array(14) {
    ["id"]=>
    object(Doctrine_Null)#12 (0) {
    }
    ["userid"]=>
    object(Doctrine_Null)#12 (0) {
    }
    ["name"]=>
    object(Doctrine_Null)#12 (0) {
    }
    ["firstname"]=>
    object(Doctrine_Null)#12 (0) {
    }
    ["phone"]=>
    object(Doctrine_Null)#12 (0) {
    }
    ["cellphone"]=>
    object(Doctrine_Null)#12 (0) {
    }
    ["postalcode"]=>
    object(Doctrine_Null)#12 (0) {
    }
    ["experience"]=>
    object(Doctrine_Null)#12 (0) {
    }
    ["connexe"]=>
    object(Doctrine_Null)#12 (0) {
    }
    ["formation"]=>
    object(Doctrine_Null)#12 (0) {
    }
    ["cv_file"]=>
    object(Doctrine_Null)#12 (0) {
    }
    ["is_active"]=>
    int(0)
    ["created_at"]=>
    object(Doctrine_Null)#12 (0) {
    }
    ["updated_at"]=>
    object(Doctrine_Null)#12 (0) {
    }
}

But $this->getAccount does return something

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:52:48+00:00Added an answer on May 26, 2026 at 2:52 pm

    maybe getFirst() doesnt work with fetchArray().
    change this for:

    $result = $q->execute();
    

    maybe this also working with fetchArray():

    if(sizeof($result) > 0){
    
        return $result['Account']['Clients'][0];
    }else{
    
        return false;
    }
    

    Sorry, my mistake.

    if you use $this->getAccount()->getClients() then also is NULL ? maybe $this->getAccount()->getClients() return NULL ?

    UPDATE:

    $uTemp = $this->getAccountId(); // (i dont know your schema.yml)

    in ClientsTable.class.php:

    public function getClientsAccount($id) 
        {        
            $q = $this->createQuery('u')
                ->where('u.client_id = ?', $id);
    
            return $q->execute();        
        } 
    

    and next in myUser.class.php you can use:

    $clients = $this->getAccountId(); // (i dont know your schema.yml)
    
    $uTemp = Doctrine_Core::getTable('Clients')->getClientsAccount($uTemp);
    

    maybe this also working:

    $uTemp = Doctrine_Core::getTable('Clients')->getClientsAccount($uTemp)->getFirst();
    

    good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question about how to deploy WPF application into a PC without
I have a question about tables in MySQL. I'm currently making a website where
A quick question about saving data in symfony 2. I have this method (just
A question about symfony form validators. For example I have an url field. If
I read about Symfony forms and i have simple question : i Make 2
https://stackoverflow.com/a/64983/468251 - Hello, I have question about this code, how made that working with
I have question about NSView: Imagine a Custom View where the mouseDown, mouseDrag and
I have question about normalization. Suppose I have an applications dealing with songs. First
I have a question about using streams in .NET to load files from disk.
I have a question about best practices regarding how one should approach storing complex

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.