Hi, I want to know if I can set an array with PDO objects, thus:
$foo = array(new PDO(...), new PDO(...));
$oSt = $foo[0]-prepare(...);
and so on... I tried that aproach and PHP is always complaining about
using prepare() in a non-object...
---
Is there a reason why you can't do method chaining off of constructors?
Consider the following class:
class bob
{
public function __construct()
{
echo 'Constructor()';
}
public function one()
{
echo '-one()';
return $this;
}
public function
-Original Message-
From: Christoph Boget [mailto:[EMAIL PROTECTED]
Sent: Friday, June 06, 2008 9:45 AM
To: PHP General
Subject: [PHP] Method chaining off constructors
Is there a reason why you can't do method chaining off of
constructors?
Consider the following class:
class
Why? I thought constructors returned the object?
It's been a while since I've played with objects in PHP, but couldn't
you just add the line:
return $this;
...to the end of your __construct() function? Sorry if this is obtuse of
me to say, I just thought maybe the answer was that simple
On Fri, Jun 6, 2008 at 11:00 AM, Christoph Boget [EMAIL PROTECTED] wrote:
Why? I thought constructors returned the object?
It's been a while since I've played with objects in PHP, but couldn't
you just add the line:
return $this;
...to the end of your __construct() function? Sorry if this
The 'new' keyword has to apply to the object created in the constructor (and
not the return value of any of the follow-up calls.) To establish this
precedence, chaining wasn't allowed on constructors.
On Fri, Jun 6, 2008 at 11:04 AM, Eric Butera [EMAIL PROTECTED] wrote:
On Fri, Jun 6, 2008
The 'new' keyword has to apply to the object created in the constructor (and
not the return value of any of the follow-up calls.) To establish this
precedence, chaining wasn't allowed on constructors.
If precedence was the issue, why doesn't this work, either:
(new bob())-one()-two()
?
On Fri, 2008-06-06 at 11:35 -0400, Christoph Boget wrote:
The 'new' keyword has to apply to the object created in the constructor (and
not the return value of any of the follow-up calls.) To establish this
precedence, chaining wasn't allowed on constructors.
If precedence was the
I'm working on a script to look for a UUEncoded attachment in an NNTP
message. I'm running into problems with spaces in the filename of the
attachment.
UUEncoded files in the body of a message will start with the word begin,
then the size of the file, then the name of the file. Then the encoded
2008/6/6 Miguel J. Jiménez [EMAIL PROTECTED]:
Hi, I want to know if I can set an array with PDO objects, thus:
$foo = array(new PDO(...), new PDO(...));
$oSt = $foo[0]-prepare(...);
and so on... I tried that aproach and PHP is always complaining about
using prepare() in a
On Thu, Jun 5, 2008 at 12:15 PM, Tyson Vanover [EMAIL PROTECTED] wrote:
I have a class that has a list of valid keys, and an array of values. When
a value is added to the array it's key is first checked against the list of
valid keys (this is to prevent injection issues we have been having
DeadTOm wrote:
I'm working on a script to look for a UUEncoded attachment in an NNTP
message. I'm running into problems with spaces in the filename of the
attachment.
UUEncoded files in the body of a message will start with the word begin,
then the size of the file, then the name of the file.
Sorry, I probably should have included the add()
function from the parent. As well as all of the parent
constructor.
Basically the object takes an array of key=value pairs
and parses them into a string for output. When it
takes in the array of pairs it needs to check the keys
against a
Hello,
I have an immediate opportunity available for a Senior Software Engineer in
Denver, CO (relocation assistance is available). This is a great opportunity
to join a dynamic and growing Internet-based company. The individual will
be responsible for the development, implementation, and
Hi Everyone,
I'm struggling with a WSDL trying to make it work right. I don't even know
what to really ask.
Basically I've created a WSDL and made a web service in PHP5. It doesn't
seem to validate properly when a .NET client tries to hit
Is there something that can be used to generate the
On Fri, Jun 6, 2008 at 2:53 PM, Dan Joseph [EMAIL PROTECTED] wrote:
Hi Everyone,
I'm struggling with a WSDL trying to make it work right. I don't even know
what to really ask.
Basically I've created a WSDL and made a web service in PHP5. It doesn't
seem to validate properly when a .NET
On Fri, Jun 6, 2008 at 6:33 PM, Nathan Nobbe [EMAIL PROTECTED] wrote:
On Fri, Jun 6, 2008 at 2:53 PM, Dan Joseph [EMAIL PROTECTED] wrote:
Hi Everyone,
I'm struggling with a WSDL trying to make it work right. I don't even know
what to really ask.
Basically I've created a WSDL and made a
On Fri, Jun 6, 2008 at 2:09 PM, Tyson Vanover [EMAIL PROTECTED] wrote:
Sorry, I probably should have included the add() function from the parent.
As well as all of the parent constructor.
Basically the object takes an array of key=value pairs and parses them
into a string for output. When
18 matches
Mail list logo