[Solar-talk] Confused, JustALittle!

Kilbride, James P. James.Kilbride at gd-ais.com
Wed May 7 12:41:50 CDT 2008


And never mind some further. I've flipped the record into array and now
i've got a handy little adapter that is essentially the SQL adapter but
uses a model instead of a table.
 
James Kilbride

________________________________

From: solar-talk-bounces at lists.solarphp.com
[mailto:solar-talk-bounces at lists.solarphp.com] On Behalf Of Kilbride,
James P.
Sent: Wednesday, May 07, 2008 1:21 PM
To: solar-talk at lists.solarphp.com
Subject: RE: [Solar-talk] Confused, JustALittle!


Bah, 
 
Never mind. I finally figured out what the problem is. It actually isn't
that it's returning the value twice it's that the adaptor is calling
_processLogin twice which made the print_r look like it had 2 values
when it was simply printing out twice.
 
Anyway, it fails(which is what started me down this path) because at
this point i'm returning the Record which is returned. I want to keep
that. I'm assuming I have to override the Adapter's processLogin()
function in order for this to work since it's looking at the returned
value and assuming failure if it returns something that isn't an array.
 
Suggestions anybody?

James Kilbride

________________________________

From: solar-talk-bounces at lists.solarphp.com
[mailto:solar-talk-bounces at lists.solarphp.com] On Behalf Of Kilbride,
James P.
Sent: Wednesday, May 07, 2008 12:30 PM
To: solar-talk at lists.solarphp.com
Subject: [Solar-talk] Confused, JustALittle!



        // get the dependency object of class Solar_Sql 
        $obj = Solar::dependency('Solar_Sql', $this->_config['sql']); 
        
        // get a selection tool using the dependency object 
        $select = Solar::factory($this->_config['model'],$obj); 

        // salt and hash the password 
        $hash = hash( 
            $this->_config['hash_algo'], 
            $this->_config['salt'] . $this->_passwd 
        ); 
        //needs to add the where information from the config to this. 
        $selectConfiguration = array('where' =>
array("{$this->_config['handle_col']} = ?" => $this->_handle, 
 
"{$this->_config['passwd_col']} = ?" => $hash,

 
), 
                                                                    ); 
        $rows = $select->fetchAll($selectConfiguration); 
        // if we get back exactly 1 row, the user is authenticated; 
        // otherwise, it's more or less than exactly 1 row. 
        print_r($rows); 

Here's my tasty code. There is only a single row in the database.. only
1.. yet i'm getting two rows. 

What I'm doing is adapting an auth controller that instead of a table
uses a model for the user table. I just kind of like it as a neat way to
handle things. But it's not behaving. The fetchAll is returning 2
records back. There is nothing different between them so I'm just
baffled. What am I missing that is patently obvious?

James Kilbride 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman-mail3.webfaction.com/pipermail/solar-talk/attachments/20080507/8576c8c1/attachment.html


More information about the Solar-talk mailing list