On Tue, Dec 2, 2008 at 7:48 PM, Micah Gersten <[EMAIL PROTECTED]> wrote:
> VamVan wrote:
> > Hello All,
> >
> > I was stuck with this issue. So just felt the need to reach out to other
> > strugglers.
> > May be people might enjoy this:
> >
> > Here is the code for object to array and array to obj
VamVan wrote:
> Hello All,
>
> I was stuck with this issue. So just felt the need to reach out to other
> strugglers.
> May be people might enjoy this:
>
> Here is the code for object to array and array to object conversion:
>
> function object_2_array($data)
> {
> if(is_array($data) || is_obje
VamVan wrote:
Hello Guys,
Here is the object. How can I get access to the [Name] = access. People who
help me with this can you please tell me what is the logic behind traversing
the objects and how do you gather the values. Thanks. I am looking for an
answer like this $queryResult->f->dsfsd
You should be able to access the "Name" field using this syntax:
QueryResult->records[0]->sobjects[0]->fields->Name
Reading from left-to-right:
1. accessing index 0 (zero) of the "records" array.
2. accessing index 0 (zero) of the "objects" array.
3. accessing the "Name" property of the "fields
Just a customer of mine who said that he'll be running PHP 4 and 5 on the
same server, and that he would share session data ;-)
Bye.
Julien.P
2008/4/7 Richard Heyes <[EMAIL PROTECTED]>:
> Have you seen how PHP makes difference between private, protected and
> > public
> > attributes of an object
Have you seen how PHP makes difference between private, protected and public
attributes of an object, into the session file ?
There are special caracters before them to recognize them.
So the question is : is PHP4 able to read such a session file ?
And how will it interpret them when we ask him t
Have you seen how PHP makes difference between private, protected and public
attributes of an object, into the session file ?
There are special caracters before them to recognize them.
So the question is : is PHP4 able to read such a session file ?
And how will it interpret them when we ask him to
On Sun, 2008-04-06 at 11:02 -0400, Mark Weaver wrote:
> So, if I create a user object, set the properties of said user object
> and store that object in the user session will that object be available
> throughout the application from the session?
http://phpro.org/tutorials/Introduction-To-PHP-
Richard Heyes wrote:
So, if I create a user object, set the properties of said user object
and store that object in the user session will that object be
available throughout the application from the session?
Yes. Just remember to include the class definition before you start the
session on su
So, if I create a user object, set the properties of said user object
and store that object in the user session will that object be available
throughout the application from the session?
Yes. Just remember to include the class definition before you start the
session on subsequent pages, otherw
On Wed, Mar 19, 2008 at 10:37 AM, Jim Lucas <[EMAIL PROTECTED]> wrote:
> I would be interested in your examples. From what you described, I can't
> see in
> my head how it all goes together.
>
there was one caveat; i had to introduce a keyVal() instance method so
client code can get the object t
Nathan Nobbe wrote:
another developer brought to my attention the spl method spl_object_hash()
method which afforded a mod in the previously posted class whereby foreach
could be used properly. also, it allows a more efficient internal
implementation. however, to my dismay, it appears that impl
another developer brought to my attention the spl method spl_object_hash()
method which afforded a mod in the previously posted class whereby foreach
could be used properly. also, it allows a more efficient internal
implementation. however, to my dismay, it appears that implementing
ArrayAccess d
Sorry for the long post, but I thought it would explain much of my
thinking... Anyway, here we go...
Jeremy Mcentire wrote:
You may have meant the while loop to iterate over $row =
fetch_object($res) ...
You are correct, I was simply trying to get the concept across. But you
are correct,
Robert Cummings wrote:
On Sun, 2008-03-16 at 11:42 -0700, Jim Lucas wrote:
Robert Cummings wrote:
Imagine 200 customers in your example... your example will hit the DB
201 times. The above hits the DB twice.
My code was intended to get the concept across. Thanks for the
suggestions though.
On Sun, 2008-03-16 at 11:42 -0700, Jim Lucas wrote:
> Robert Cummings wrote:
> > Imagine 200 customers in your example... your example will hit the DB
> > 201 times. The above hits the DB twice.
>
> My code was intended to get the concept across. Thanks for the
> suggestions though.
Ah, ok. I'
Richard Heyes wrote:
Hi,
Going off the subject alone, you might want to investigate the
__tostring() magic method that you can define to handle objects being
cast to a string. Also, there's a whole bunch of magic methods that you
can use to handle PHP operations on user defined objects:
htt
Robert Cummings wrote:
Imagine 200 customers in your example... your example will hit the DB
201 times. The above hits the DB twice.
My code was intended to get the concept across. Thanks for the
suggestions though.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
after talking w/ marcus it sounds like theyve explicitly decided not to
support objects in the aforementioned context.
-nathan
On Sat, Mar 15, 2008 at 6:02 PM, Jim Lucas <[EMAIL PROTECTED]> wrote:
> It has been brought to my attention that with Perl and Ruby, you can use
> Objects as the value of the key within an array. The examples that were
> shown to me make me think that this would be an awesome ability to have
> wi
Hi,
Going off the subject alone, you might want to investigate the
__tostring() magic method that you can define to handle objects being
cast to a string. Also, there's a whole bunch of magic methods that you
can use to handle PHP operations on user defined objects:
http://uk.php.net/manual/
On Sat, 2008-03-15 at 15:02 -0700, Jim Lucas wrote:
> This question should probably be directed at the PHP Internals list, but
> I thought I would start by asking here first if anybody would even use
> this feature.
>
> It has been brought to my attention that with Perl and Ruby, you can use
>
On Mar 15, 2008, at 7:16 PM, Ray Hauge wrote:
Jim Lucas wrote:
It has been brought to my attention that with Perl and Ruby, you
can use Objects as the value of the key within an array. The
examples that were shown to me make me think that this would be an
awesome ability to have within PHP
Jim Lucas wrote:
This question should probably be directed at the PHP Internals list, but
I thought I would start by asking here first if anybody would even use
this feature.
It has been brought to my attention that with Perl and Ruby, you can use
Objects as the value of the key within an arr
On 8/8/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
>
> On Tue, July 31, 2007 8:40 am, Eric Butera wrote:
> > On 7/31/07, Nathan Nobbe <[EMAIL PROTECTED]> wrote:
> >> i
> >> feel sorry for Richard; if youd ever seen a successful
> >> implementation of
> >> design patterns in the wild
> >> well you
On Tue, 2007-08-07 at 23:44 -0500, Richard Lynch wrote:
>
> I'm not trying to be a jerk or pick a fight here, but am suggesting
> list members think about this before they post. Especially that whole
> PHP-Editors thread, which always consists of one person from each camp
> posting their favorite
On Tue, July 31, 2007 8:40 am, Eric Butera wrote:
> On 7/31/07, Nathan Nobbe <[EMAIL PROTECTED]> wrote:
>> i
>> feel sorry for Richard; if youd ever seen a successful
>> implementation of
>> design patterns in the wild
>> well you would probly feel like i do... gotta have em :)
This post is a res
well im not trying to convince everyone to start doing oop, just because i
dont have time. maybe if i get rich and have time
ill go on a dedicated mission or something.
anyway i think its obvious that objects are powerful. look at the big php
projects out there; wikipedia, facebook, many of the
n
At 1:25 AM -0500 7/31/07, Richard Lynch wrote:
On Sun, July 29, 2007 12:45 pm, Nathan Nobbe wrote:
one of the hardest parts about using design patterns in reality is you
have
to be able to recognize a certain
problem and then you can begin to understand how to apply a particular
pattern or
On 7/31/07, Nathan Nobbe <[EMAIL PROTECTED]> wrote:
> > On 7/31/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
> > Or, in my experience with pattern zealots, mis-recognize a problem as
> > a pattern it isn't, mis-apply the "solution" and then spend years
> > dealing with a square peg in a round hole.
> On 7/31/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
> Or, in my experience with pattern zealots, mis-recognize a problem as
> a pattern it isn't, mis-apply the "solution" and then spend years
> dealing with a square peg in a round hole...
The funny thing about that is w/ OOP and design patterns
On Sun, July 29, 2007 12:45 pm, Nathan Nobbe wrote:
> one of the hardest parts about using design patterns in reality is you
> have
> to be able to recognize a certain
> problem and then you can begin to understand how to apply a particular
> pattern or set of patterns to your
> solution.
Or, in m
tedd,
have you looked at the book we're talking about?
also, there are several other books on design patterns available, but the
Heads First book
is one ive heard mentioned a lot.
you can check out a really sweet site online phppatterns.com; in particular
follow the design
link on the right hand n
At 2:00 PM -0400 7/25/07, Nathan Nobbe wrote:
yes well at the beginning of the design patterns book they basically explain
the same thing.
if you dont understand the basic oo priciples, then design patterns arent
going to make any sense.
these basic concepts are (not looking in the book [testing
> On 7/27/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
> And the practical issues, well, few OOP courses really dive into that,
> to tell you the truth...
This is why the study of design patterns is so important, imho.
-nathan
On 7/27/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
>
> On Wed, July
On Wed, July 25, 2007 6:33 am, Suporte - DPRJ Sistemas wrote:
> Is there anyone here interested in teaching (lond distance, off
> course) OOP?
>
> I would like to learn how to use objects (I have been working all my
> life using structured language). All the books I have tried just
> "talk" about t
On 7/25/07, Nathan Nobbe <[EMAIL PROTECTED]> wrote:
Eric,
i was referring to the exact book you mentioned. here is an excerpt from
page 32
of the book:
' we assume you know the oo basics of using classes polymorphically,
how inheritance is like design by contract, and how encapsulation works.
Eric,
i was referring to the exact book you mentioned. here is an excerpt from
page 32
of the book:
' we assume you know the oo basics of using classes polymorphically,
how inheritance is like design by contract, and how encapsulation works. if
you are a little rusty on these, pull out your hea
On 7/25/07, Tony Marston <[EMAIL PROTECTED]> wrote:
Design patterns will just confuse the issue. If you come from a non-OO
background (just like me) and want to know what all this OO stuff is about
you might want to take a look at the following:
http://www.tonymarston.net/php-mysql/good-bad-oop.h
yes well at the beginning of the design patterns book they basically explain
the same thing.
if you dont understand the basic oo priciples, then design patterns arent
going to make any sense.
these basic concepts are (not looking in the book [testing myself]..)
encapsulation
abstraction
polymorphi
Design patterns will just confuse the issue. If you come from a non-OO
background (just like me) and want to know what all this OO stuff is about
you might want to take a look at the following:
http://www.tonymarston.net/php-mysql/good-bad-oop.html
http://www.tonymarston.net/php-mysql/hero-or-her
eric is exactly right; design patterns are key; and so is that book ;)
-nathan
On 7/25/07, Eric Butera <[EMAIL PROTECTED]> wrote:
On 7/25/07, Suporte - DPRJ Sistemas <[EMAIL PROTECTED]> wrote:
> Hello!
>
> Is there anyone here interested in teaching (lond distance, off course)
OOP?
>
> I would
On 7/25/07, Suporte - DPRJ Sistemas <[EMAIL PROTECTED]> wrote:
Hello!
Is there anyone here interested in teaching (lond distance, off course) OOP?
I would like to learn how to use objects (I have been working all my life using
structured language). All the books I have tried just "talk" about
[snip]
Is there anyone here interested in teaching (lond distance, off course)
OOP?
I would like to learn how to use objects (I have been working all my
life using structured language). All the books I have tried just "talk"
about theory not practical issues.
I intend to pay for the classes.
[/sn
Shaw, Chris - Accenture wrote:
Jasper,
I would have thought php would have called the destructors on each of the
classes in a LIFO fashion, but if it doesn't, just use unset() as a
workaround, where you can remove the classes in the order you want.
I should add that this behaviour seems to hav
Jasper,
I would have thought php would have called the destructors on each of the
classes in a LIFO fashion, but if it doesn't, just use unset() as a
workaround, where you can remove the classes in the order you want.
C.
-Original Message-
From: Jasper Bryant-Greene [mailto:[EMAIL PROTE
On 6/9/05, Matthew Weier O'Phinney <[EMAIL PROTECTED]> wrote:
> Actually, that is the point.
If I decide the write a script, and it is my idea, then the point of
the script is my own. It's a simple benchmark. I doubt a client
would ever come to me and say "Can you write me a script to add two
ra
* Greg Donald <[EMAIL PROTECTED]> :
> On 6/8/05, Greg Beaver <[EMAIL PROTECTED]> wrote:
> > If you want to compare object methods versus functions, you should
> > compare identical code inside a method to code inside a function.
> > Greg's benchmarks compare two different ideological code structure
On 6/8/05, Greg Beaver <[EMAIL PROTECTED]> wrote:
> If you want to compare object methods versus functions, you should
> compare identical code inside a method to code inside a function.
> Greg's benchmarks compare two different ideological code structures.
> Quite honestly, the wrapping of mt_sran
Greg Donald wrote:
> On 6/8/05, NSK <[EMAIL PROTECTED]> wrote:
>
>>Hi, I am creating a small API in PHP, i.e. a collection of reusable functions
>>for other programmers. As it is now, it is just many functions together in
>>the same file. Do you think I should make it object-oriented? What are the
On 6/8/05, NSK <[EMAIL PROTECTED]> wrote:
> Hi, I am creating a small API in PHP, i.e. a collection of reusable functions
> for other programmers. As it is now, it is just many functions together in
> the same file. Do you think I should make it object-oriented? What are the
> pros and cons of this
Hi,
I think you need to serialize your objects.
http://us3.php.net/manual/en/language.oop.serialization.php
Jason
On 5/5/05, Stuart Nielson <[EMAIL PROTECTED]> wrote:
> Sorry to everyone about the stupid READ notification on the posting. I
> completely forgot that it was enabled. This one s
I think, its not possible to init an Objeect on a session. Session will be
rebuild on each reload of the site based on the session id, i think...
Maybe here the object can't be rebuild anymore...
> Following code:
>
>
> class SessionTestC {
> protected $value;
>
> function __construct (
Thomas Munz wrote:
I think, its not possible to init an Objeect on a session.
Yes, it can.
The problem was with serialization. With session.auto_start set to 1 on
php.ini, seems like session's objects are unserialized before loading
the script, so the class is not loaded when the session unseri
Alawi Albaity wrote:
I want to create and defined variables of an object in runtime , is
that possible ?
I can do that with arrays but I want the access it as variable from
obbject it self and not like member of an array are defined on object
before I load it !
What about trying it before asking?
-
This didn't work. Apparently from[] returns an array of objects, however
I have no idea how to access the object within the array.
print_r gives this:
Array ( [0] => stdClass Object ( [personal] => Beth Gore [mailbox] =>
bethanoia [host] => habitformer.co.uk ) )
I've tried this:
echo $header-
Big guess but I think maybe:
$header[0]->from['mailbox'];
Also I suggest you turn your PHP Error Level up to E_ALL in your php.ini
file (or temporarly at the top of your scripts with error_reporting
(E_ALL);, this will help debug programs like this :))
Andrew
- Original Message -
From: "
ðÒÉ×ÅÔ!
Alexander Ross wrote:
> I have an array filled with objects. Each object has a method called
> "display".
>
> I have
>
> $var = $arr[0];
> $var->display();
>
> but I keep getting an error. What am I doing wrong?
> (I do a print_r of the array immediately before this code and there is
Dear Mirek,
This is how we use the handler for our XML class.
Hope it helps!
class XML
{
function parseXML()
{
/
Parse string XML data.
**
Doh, typo:
// this next line would generate a parse error
// print("c:a1: " . $c->echo($a)->method1() . "\n");
should read
// this next line would generate a parse error
// print("c:a1: " . $c->echoMethod($a)->method1() . "\n");
On Thursday, April 4, 2002, at 05:25 PM, Steve Cayford wrote:
On Thursday, April 4, 2002, at 04:21 PM, Erik Price wrote:
> I looked in the manual, but didn't see anything about this. I've read
> that PHP isn't a true object-oriented language, but rather simulates
> elements of object-oriented programming. Can I write a class that
> performs operation
On Monday 26 November 2001 23:37, Christopher William Wesley wrote:
> On Mon, 26 Nov 2001, Greg Sidelinger wrote:
> > Can someone tell me how to store a class in a session var. I
> > want to
>
> There are several things you need to do.
>
> 1) include the class definition before you do anything
>
On Mon, 26 Nov 2001, Greg Sidelinger wrote:
> Can someone tell me how to store a class in a session var. I want to
There are several things you need to do.
1) include the class definition before you do anything
2) start the session shortly thereafter
3) register a session variable
4) create y
> later on I get errors about the class functions being undefined.
> Can anyone please point me in the right direction on how to
> register my objects as session vars.
Class definition *must* be before any session_start() or
sessgion_register() if there are previously stored objects in the
se
On Tue, 3 Jul 2001 11:47, Ethan Schroeder wrote:
> If what you mean is if PHP sessions can register objects, that is true and
> quite effective.
Can you elaborate on this Ethan so I'm sure I understand what you're saying.
Cheers,
Brad
--
PHP General Mailing List (http://www.php.net/)
To unsub
If what you mean is if PHP sessions can register objects, that is true and
quite effective.
Ethan Schroeder
- Original Message -
From: "Brandon Orther" <[EMAIL PROTECTED]>
To: "PHP User Group" <[EMAIL PROTECTED]>
Sent: Monday, July 02, 2001 4:36 PM
Subject: [PHP] Objects and sessions
From: "Jørg Vidar Bryne" <[EMAIL PROTECTED]>
Sent: Saturday, March 10, 2001 11:52 PM
> What do you mean by it fails? Any particular error, or does it just time
> out?
>
> I've made a different recursive function to print a tree-menu, you can
have
> a look at it if you want but it might not be wh
> Hi,
> I want to make a recursive function generating a hierarchy using a class.
>
> The following code works fine when I don't wrap the function around it,
> but when I do it fails. I can't figure out why...
> I'm thinking I may need to make some vars global, or maybe you can't use
> objects ins
What do you mean by it fails? Any particular error, or does it just time
out?
I've made a different recursive function to print a tree-menu, you can have
a look at it if you want but it might not be what you're after. It prints a
tree-menu, and reqires the table to have at least a field named id
69 matches
Mail list logo