Questions tagged [stdclass]

`stdClass` is php's generic empty class, kind of like Object in Java or object in Python.But not actually used as universal base class. Useful for anonymous objects, dynamic properties. It is used when casting other types to objects.

stdClass is php's generic empty class, kind of like Object in Java or object in Python.But not actually used as universal base class. Useful for anonymous objects, dynamic properties. It is used when casting other types to objects.

490 questions
-1
votes
2 answers

Can I populate an object from a db but still have access to its methods?

This is my second post today because I'm very new at OOP in PHP, so bear with me if it's a silly question... I've created a beautiful class that I want to be able to use with my "JOB" objects that includes being able to use this single object to…
DevlshOne
  • 7,960
  • 1
  • 25
  • 33
-1
votes
1 answer

Call to undefined method stdClass::onDisplay() error

I have a joomla 2.5 installation. I just installed community builder component. when I tried to add a field, I got the error message: Fatal error: Call to undefined method stdClass::onDisplay() in…
Souleye
  • 11
  • 1
  • 2
-2
votes
1 answer

How to set a namespace to the instance of stdClass?

I need to change the type of object from stdClass to "myClass", so like does PDO::fetch_object("myClass"); $inc = new stdClass; $inc = funct_for_set_type_of_object("myClass"); // here the function to do …
Ax.
  • 310
  • 3
  • 4
  • 11
-2
votes
1 answer

Python equivalent of the PHP stdClass

Coming from PHP, I love the pythonic syntax. Is there a Python equivalent of the PHP stdClass? Edit: I want to point out I'm looking for a specific data type in Python to store data like the stdClass in PHP. So not in a dict, list, array, .. but in…
-2
votes
2 answers

Undefined property: stdClass::$ecompany in C:\wamp64\www\try\insert.php on line 7

'; //Printing Array print_r($data); echo ''; //Getting values in…
Rohit Gautam
  • 179
  • 13
-2
votes
1 answer

Converting a stdClass intro an array

stdClass Object ( [CountyId] => 3 [Name] => Alba [Abbreviation] => AB ) stdClass Object ( [CountyId] => 4 [Name] => Arad [Abbreviation] => AR ) stdClass Object ( [CountyId] => 5 [Name] => Arges [Abbreviation] =>…
Soptareanu Alex
  • 3,339
  • 3
  • 13
  • 13
-2
votes
2 answers

Extract complete array from std class multi dimensional array php

I am working on an exam system and I have run into a problem for getting the right result. I want this result from answers array which match question ID 466 ( [id] => 234 [firstChoice] => 2 [choice] => 2 [marked] => [strikethrough] =>…
Nasirsom
  • 11
  • 2
-2
votes
2 answers

sorting three dimensional array of stdclass objects in php

i'm having a problem sorting that array, i've tried few different methods of usort but nothing seems to be working. i want to order it by "vieworder". to print it i used the array_values() function this is the array: Array ( [0] => Array …
Shahaf Antwarg
  • 453
  • 3
  • 10
-2
votes
2 answers

Searching for values in JSON array w/ stdClass subarray

This JSON snippet is part of a WooCommerce order, extracted from the APIv2 get_order() function. The [meta] holds product variation data chosen by the customer. [meta] => Array ( [0] => stdClass Object ( [key] => pa_size [label] => Size [value]…
D. Simpson
  • 1,862
  • 17
  • 32
-2
votes
2 answers

stdClass Cannot use [] fatal error

I am attempting to iterate the img data held in the array within the stdClass object. I've been able to get the stdClass to do everything else I hoped, trying to get the images to sequence/iterate out has eluded me. I have looked at php.net and read…
Chezshire
  • 673
  • 5
  • 12
  • 29
-2
votes
3 answers

How to extract these values in PHP and show it in a table format?

How to display above values as page wise, sorting and searching options? stdClass Object ( [totalcdrcount] => 11 [cdrs] => Array ( [0] => stdClass Object ( …
Malli
  • 15
  • 4
-2
votes
1 answer

get all objects key value from nested array

hi i have an array of objects like as follow: stdClass Object ( [row_1_node_1] => stdClass Object ( [probality] => Array ( [0] => 0.6 [1] => 0.4 ) …
user2640758
  • 75
  • 1
  • 3
  • 11
-2
votes
1 answer

How can i access stdClass Object as a string

How can I access these lines like a string ? Its a get response from twitter, and im tring to use it. stdClass Object ( [relationship] => stdClass Object ( [source] => stdClass Object ( …
Emre Y
  • 51
  • 1
  • 7
-3
votes
1 answer

How extract @attributes from stdClass Object?

How i can extract the attributes from a stdClass Object? I have the variable $data. Doing a print_r to it i get: stdClass Object ( [@attributes] => stdClass Object ( [id] => cover [title] => Cover ) …
Marcello Impastato
  • 2,185
  • 4
  • 24
  • 47
-3
votes
2 answers

How can i read this stdClass object in php?

stdClass Object ( [api] => stdClass Object ( [results] => 1 [leagues] => stdClass Object ( [1] => stdClass Object ( [league_id] => 1 [name] => World Cup [country]…
1 2 3
32
33