$result = User::where('email_add', '=', $username)->first();
Here's what shows up when I use var_dump on $result
object(User)#22 (30) { ["user_id"]=> int(0) ["fname"]=> string(0) "" ["lname"]=> string(0) "" ["mname"]=> string(0) "" ["bdate"]=> string(0) "" ["contact"]=> string(0) "" ["email_add"]=> string(0) "" ["fillable":protected]=> array(6) { [0]=> string(5) "fname" [1]=> string(5) "mname" [2]=> string(5) "lname" [3]=> string(5) "bdate" [4]=> string(7) "contact" [5]=> string(9) "email_add" } ["connection":protected]=> NULL ["table":protected]=> NULL ["primaryKey":protected]=> string(2) "id" ["keyType":protected]=> string(3) "int" ["perPage":protected]=> int(15) ["incrementing"]=> bool(true) ["timestamps"]=> bool(true) ["attributes":protected]=> array(10) { ["user_id"]=> int(33) ["fname"]=> string(6) "Robert" ["lname"]=> string(6) "Marley" ["mname"]=> string(5) "Nesta" ["bdate"]=> string(10) "0000-00-00" ["contact"]=> string(11) "09123847599" ["email_add"]=> string(40) "7c9ac9ca8543dd84f71aa541d422e2a95d3e7450" ["photo"]=> NULL ["created_at"]=> string(19) "2017-01-25 01:03:06" ["updated_at"]=> string(19) "0000-00-00 00:00:00" } ["original":protected]=> array(10) { ["user_id"]=> int(33) ["fname"]=> string(6) "Robert" ["lname"]=> string(6) "Marley" ["mname"]=> string(5) "Nesta" ["bdate"]=> string(10) "0000-00-00" ["contact"]=> string(11) "09123847599" ["email_add"]=> string(40) "7c9ac9ca8543dd84f71aa541d422e2a95d3e7450" ["photo"]=> NULL ["created_at"]=> string(19) "2017-01-25 01:03:06" ["updated_at"]=> string(19) "0000-00-00 00:00:00" } ["relations":protected]=> array(0) { } ["hidden":protected]=> array(0) { } ["visible":protected]=> array(0) { } ["appends":protected]=> array(0) { } ["guarded":protected]=> array(1) { [0]=> string(1) "*" } ["dates":protected]=> array(0) { } ["dateFormat":protected]=> NULL ["casts":protected]=> array(0) { } ["touches":protected]=> array(0) { } ["observables":protected]=> array(0) { } ["with":protected]=> array(0) { } ["exists"]=> bool(true) ["wasRecentlyCreated"]=> bool(false) }
Here's what happens when I use foreach to var_dump each $user on the $result
int(0) string(0) "" string(0) "" string(0) "" string(0) "" string(0) "" string(0) "" bool(true) bool(true) bool(true) bool(false)
I've been looking for a solution to this but I don't seem to find one, I was using get() at first but I read somewhere that if I'm expecting only 1 result, I should be using first() but it doesn't change anything. I can't access the Collection..
I've found a solution
This one helped me.
adding ->toArray on my ->first() was the magic, it only returns an array with the exact attributes without the unnecessary object properties.
Related
The below line returns all record from two tables, because I added a relationship for these two tables.
$allmarketers = ProductStock::whereRaw('MONTH(created_at) = ?',[$currentMonth])->get();
Now I want to loop through the records in the view and display the records from two tables for each user. I forgot how to achieve this.
I tried
#foreach($allmarketers as $item)
But how can I get the values of both tables inside this loop?
Var_dump
n)#601 (1) { ["items":protected]=> array(3) { [0]=> object(App\ProductStock)#602 (26) { ["table":protected]=> string(14) "product_stocks" ["fillable":protected]=> array(5) { [0]=> string(8) "marketer" [1]=> string(6) "target" [2]=> string(6) "_token" [3]=> string(10) "updated_at" [4]=> string(10) "created_at" } ["connection":protected]=> string(5) "mysql" ["primaryKey":protected]=> string(2) "id" ["keyType":protected]=> string(3) "int" ["incrementing"]=> bool(true) ["with":protected]=> array(0) { } ["withCount":protected]=> array(0) { } ["perPage":protected]=> int(15) ["exists"]=> bool(true) ["wasRecentlyCreated"]=> bool(false) ["attributes":protected]=> array(9) { ["id"]=> int(97) ["user_id"]=> int(70) ["marketer"]=> string(18) "Samson Samson | 70" ["target"]=> string(3) "100" ["_token"]=> NULL ["status"]=> int(1) ["vehicle"]=> string(10) "Unassigned" ["created_at"]=> string(19) "2020-01-07 13:11:47" ["updated_at"]=> string(19) "2020-01-07 13:11:47" } ["original":protected]=> array(9) { ["id"]=> int(97) ["user_id"]=> int(70) ["marketer"]=> string(18) "Samson Samson | 70" ["target"]=> string(3) "100" ["_token"]=> NULL ["status"]=> int(1) ["vehicle"]=> string(10) "Unassigned" ["created_at"]=> string(19) "2020-01-07 13:11:47" ["updated_at"]=> string(19) "2020-01-07 13:11:47" } ["changes":protected]=> array(0) { } ["casts":protected]=> array(0) { } ["dates":protected]=> array(0) { } ["dateFormat":protected]=> NULL ["appends":protected]=> array(0) { } ["dispatchesEvents":protected]=> array(0) { } ["observables":protected]=> array(0) { } ["relations":protected]=> array(0) { } ["touches":protected]=> array(0) { } ["timestamps"]=> bool(true) ["hidden":protected]=> array(0) { } ["visible":protected]=> array(0) { } ["guarded":protected]=> array(1) { [0]=> string(1) "*" } } [1]=> object(App\ProductStock)#603 (26) { ["table":protected]=> string(14) "product_stocks" ["fillable":protected]=> array(5) { [0]=> string(8) "marketer" [1]=> string(6) "target" [2]=> string(6) "_token" [3]=> string(10) "updated_at" [4]=> string(10) "created_at" } ["connection":protected]=> string(5) "mysql" ["primaryKey":protected]=> string(2) "id" ["keyType":protected]=> string(3) "int" ["incrementing"]=> bool(true) ["with":protected]=> array(0) { } ["withCount":protected]=> array(0) { } ["perPage":protected]=> int(15) ["exists"]=> bool(true) ["wasRecentlyCreated"]=> bool(false) ["attributes":protected]=> array(9) { ["id"]=> int(98) ["user_id"]=> int(72) ["marketer"]=> string(22) "Emmanuel Increase | 72" ["target"]=> string(3) "150" ["_token"]=> NULL ["status"]=> int(1) ["vehicle"]=> string(10) "Unassigned" ["created_at"]=> string(19) "2020-01-07 13:11:47" ["updated_at"]=> string(19) "2020-01-07 13:11:47" } ["original":protected]=> array(9) { ["id"]=> int(98) ["user_id"]=> int(72) ["marketer"]=> string(22) "Emmanuel Increase | 72" ["target"]=> string(3) "150" ["_token"]=> NULL ["status"]=> int(1) ["vehicle"]=> string(10) "Unassigned" ["created_at"]=> string(19) "2020-01-07 13:11:47" ["updated_at"]=> string(19) "2020-01-07 13:11:47" } ["changes":protected]=> array(0) { } ["casts":protected]=> array(0) { } ["dates":protected]=> array(0) { } ["dateFormat":protected]=> NULL ["appends":protected]=> array(0) { } ["dispatchesEvents":protected]=> array(0) { } ["observables":protected]=> array(0) { } ["relations":protected]=> array(0) { } ["touches":protected]=> array(0) { } ["timestamps"]=> bool(true) ["hidden":protected]=> array(0) { } ["visible":protected]=> array(0) { } ["guarded":protected]=> array(1) { [0]=> string(1) "*" } } [2]=> object(App\ProductStock)#604 (26) { ["table":protected]=> string(14) "product_stocks" ["fillable":protected]=> array(5) { [0]=> string(8) "marketer" [1]=> string(6) "target" [2]=> string(6) "_token" [3]=> string(10) "updated_at" [4]=> string(10) "created_at" } ["connection":protected]=> string(5) "mysql" ["primaryKey":protected]=> string(2) "id" ["keyType":protected]=> string(3) "int" ["incrementing"]=> bool(true) ["with":protected]=> array(0) { } ["withCount":protected]=> array(0) { } ["perPage":protected]=> int(15) ["exists"]=> bool(true) ["wasRecentlyCreated"]=> bool(false) ["attributes":protected]=> array(9) { ["id"]=> int(99) ["user_id"]=> int(73) ["marketer"]=> string(18) "Timothy Kukah | 73" ["target"]=> string(3) "200" ["_token"]=> NULL ["status"]=> int(1) ["vehicle"]=> string(10) "Unassigned" ["created_at"]=> string(19) "2020-01-07 13:11:47" ["updated_at"]=> string(19) "2020-01-07 13:11:47" } ["original":protected]=> array(9) { ["id"]=> int(99) ["user_id"]=> int(73) ["marketer"]=> string(18) "Timothy Kukah | 73" ["target"]=> string(3) "200" ["_token"]=> NULL ["status"]=> int(1) ["vehicle"]=> string(10) "Unassigned" ["created_at"]=> string(19) "2020-01-07 13:11:47" ["updated_at"]=> string(19) "2020-01-07 13:11:47" } ["changes":protected]=> array(0) { } ["casts":protected]=> array(0) { } ["dates":protected]=> array(0) { } ["dateFormat":protected]=> NULL ["appends":protected]=> array(0) { } ["dispatchesEvents":protected]=> array(0) { } ["observables":protected]=> array(0) { } ["relations":protected]=> array(0) { } ["touches":protected]=> array(0) { } ["timestamps"]=> bool(true) ["hidden":protected]=> array(0) { } ["visible":protected]=> array(0) { } ["guarded":protected]=> array(1) { [0]=> string(1) "*" } } } }
you can use this below. hope it might help you. it's a simple code. I presume you have id column in your DB.
<table class="table is-striped">
#if(count($allmarketers) > 0)
<thead>
<tr>
<th>id</th>
<th>date</th>
</tr>
</thead>
#endif
<tbody>
#foreach ($allmarketers as $item)
<tr>
<td>{{$item->id}}</td>
<td>{{$item->created_at}}</td>
</tr>
#endforeach
</tbody>
</table>
I'd like to get a specific array data from an array I've get from this code :
$user = $request->instance()->query('user');
var_dump($user);exit;
And the result is :
array(1) { ["user"]=> object(App\Models\User)#332 (27) {
["fillable":protected]=> array(5) { [0]=> string(4) "name" [1]=>
string(8) "username" [2]=> string(5) "email" [3]=> string(8)
"password" [4]=> string(5) "token" } ["hidden":protected]=> array(2) {
[0]=> string(8) "password" [1]=> string(14) "remember_token" }
["casts":protected]=> array(1) { ["email_verified_at"]=> string(8)
"datetime" } ["connection":protected]=> string(5) "mysql"
["table":protected]=> string(5) "users" ["primaryKey":protected]=>
string(2) "id" ["keyType":protected]=> string(3) "int"
["incrementing"]=> bool(true) ["with":protected]=> array(0) { }
["withCount":protected]=> array(0) { } ["perPage":protected]=> int(15)
["exists"]=> bool(true) ["wasRecentlyCreated"]=> bool(false)
["attributes":protected]=> array(15) { ["id"]=> int(3) ["name"]=>
string(14) "Manchesteriyah" ["username"]=> string(14) "manchesteriyah"
["email"]=> string(24) "manchesteriyah#gmail.com" ["facebook"]=>
string(37) "https://web.facebook.com/xkionna" ["phone"]=> NULL
["email_verified_at"]=> NULL ["password"]=> string(60)
"$2y$10$IrqHE1JfyH0bJ0XD/Hjy.efLg95y/buTIir0PuXcOqDb1yCSS69Oe"
["image"]=> NULL ["description"]=> NULL ["role"]=> string(1) "1"
["token"]=> string(20) "ymsJxEtFnxdPBWYwlYFw" ["member_expiration"]=>
string(19) "2019-07-08 20:33:29" ["created_at"]=> string(19)
"2019-06-08 20:30:25" ["updated_at"]=> string(19) "2019-06-08
20:33:29" } ["original":protected]=> array(15) { ["id"]=> int(3)
["name"]=> string(14) "Manchesteriyah" ["username"]=> string(14)
"manchesteriyah" ["email"]=> string(24) "manchesteriyah#gmail.com"
["facebook"]=> string(37) "https://web.facebook.com/xkionna"
["phone"]=> NULL ["email_verified_at"]=> NULL ["password"]=>
string(60)
"$2y$10$IrqHE1JfyH0bJ0XD/Hjy.efLg95y/buTIir0PuXcOqDb1yCSS69Oe"
["image"]=> NULL ["description"]=> NULL ["role"]=> string(1) "1"
["token"]=> string(20) "ymsJxEtFnxdPBWYwlYFw" ["member_expiration"]=>
string(19) "2019-07-08 20:33:29" ["created_at"]=> string(19)
"2019-06-08 20:30:25" ["updated_at"]=> string(19) "2019-06-08
20:33:29" } ["changes":protected]=> array(0) { } ["dates":protected]=>
array(0) { } ["dateFormat":protected]=> NULL ["appends":protected]=>
array(0) { } ["dispatchesEvents":protected]=> array(0) { }
["observables":protected]=> array(0) { } ["relations":protected]=>
array(0) { } ["touches":protected]=> array(0) { } ["timestamps"]=>
bool(true) ["visible":protected]=> array(0) { }
["guarded":protected]=> array(1) { [0]=> string(1) "*" }
["rememberTokenName":protected]=> string(14) "remember_token" } }
What I'd like to get is the username value, I've tried some solution like this :
$user->username
but it give me error like this :
Trying to get property 'username' of non-object
How to fix this? Thanks for attention.
The $user variable seems to be holding an array containing 1 element, not the User itself. You must first retrieve the User object from the array and then access the username attribute.
$user = $request->instance()->query('user')['user'];
var_dump($user->username); exit;
I have this array, that is dumped from WooCommerce using these lines:
$items = $woocommerce->cart->get_cart();
foreach($items as $item => $values) {
// some code here…
}
If I make a raw output of my cart ($items) I get this:
array(1) {
["f584d8671586d336d84e8cf9ed43303c"]=>
array(11) {
["booking"]=>
array(15) {
["_year"]=>
int(2016)
["_month"]=>
int(8)
["_day"]=>
int(28)
["_persons"]=>
array(1) {
[0]=>
int(1)
}
["_date"]=>
string(9) "2016-8-28"
["date"]=>
string(13) "28 août 2016"
["_time"]=>
string(5) "21:30"
["time"]=>
string(11) "21 h 30 min"
["_qty"]=>
int(1)
["Personnes"]=>
int(1)
["_start_date"]=>
int(1472419800)
["_end_date"]=>
int(1472421600)
["_all_day"]=>
int(0)
["_cost"]=>
int(0)
["_booking_id"]=>
int(13013)
}
["product_id"]=>
int(12856)
["variation_id"]=>
int(0)
["variation"]=>
array(0) {
}
["quantity"]=>
int(1)
["line_total"]=>
float(0)
["line_tax"]=>
int(0)
["line_subtotal"]=>
int(0)
["line_subtotal_tax"]=>
int(0)
["line_tax_data"]=>
array(2) {
["total"]=>
array(0) {
}
["subtotal"]=>
array(0) {
}
}
["data"]=>
object(WC_Product_Booking)#11131 (20) {
["availability_rules":"WC_Product_Booking":private]=>
array(0) {
}
["id"]=>
int(12856)
["post"]=>
object(WP_Post)#11132 (24) {
["ID"]=>
int(12856)
["post_author"]=>
string(2) "14"
["post_date"]=>
string(19) "2016-08-16 22:04:09"
["post_date_gmt"]=>
string(19) "2016-08-16 20:04:09"
["post_content"]=>
string(0) ""
["post_title"]=>
string(10) "La Cuchara"
["post_excerpt"]=>
string(0) ""
["post_status"]=>
string(7) "publish"
["comment_status"]=>
string(4) "open"
["ping_status"]=>
string(6) "closed"
["post_password"]=>
string(0) ""
["post_name"]=>
string(12) "la-cuchara-2"
["to_ping"]=>
string(0) ""
["pinged"]=>
string(0) ""
["post_modified"]=>
string(19) "2016-08-16 22:13:52"
["post_modified_gmt"]=>
string(19) "2016-08-16 20:13:52"
["post_content_filtered"]=>
string(0) ""
["post_parent"]=>
int(0)
["guid"]=>
string(59) ""
["menu_order"]=>
int(0)
["post_type"]=>
string(7) "product"
["post_mime_type"]=>
string(0) ""
["comment_count"]=>
string(1) "0"
["filter"]=>
string(3) "raw"
}
["product_type"]=>
string(7) "booking"
["shipping_class":protected]=>
string(0) ""
["shipping_class_id":protected]=>
int(0)
["total_stock"]=>
NULL
["supports":protected]=>
array(0) {
}
["price"]=>
string(1) "0"
["wc_display_cost"]=>
string(0) ""
["wc_booking_base_cost"]=>
string(0) ""
["wc_booking_min_duration"]=>
string(1) "1"
["wc_booking_cost"]=>
string(0) ""
["wc_booking_has_resources"]=>
string(2) "no"
["wc_booking_has_persons"]=>
string(3) "yes"
["wc_booking_has_person_types"]=>
string(2) "no"
["wc_booking_min_persons_group"]=>
string(1) "1"
["tax_status"]=>
string(7) "taxable"
["stock_status"]=>
string(7) "instock"
["manage_stock"]=>
string(2) "no"
}
}
}
I would like to use specific data values in php variables (the booking date, the time and the person):
["date"]=> string(13) "28 août 2016"
["_persons"]=> array(1) { [0]=> int(1) }
["time"]=> string(11) "21 h 30 min"
How can I do to get this specific values from WooCommerce cart object?
Thanks
You could try first this (but I am unsure as I think it can be an object, so may be it will not work):
echo $items[0]['booking']['date'] . '<br>';
echo $items[0]['booking']['_persons'] . '<br>';
echo $items[0]['booking']['time'] . '<br>';
If not working with a foreach loop it will:
$items = WC()->cart->get_cart();
foreach($items as $item) {
$date = $item['booking']['date'];
$person = $item['booking']['_persons'];
$time = $item['booking']['time'];
}
// displaying values for test
echo 'Booking - Date: ' . $date . '/ Person: ' . $person . '/ Time: ' . $time;
One of these will work, for sure…
That's is a kind of what I'm used to see in laravel when I use dd($var); function to see whats in the variable:
{
id: "1",
username: "Muzikman",
email: "matt.paolini#gmail.com",
password: "$2y$10$Sp7k9Fs0DwFSYHTpWrTWquFmXJpkiKfRIHsjYtdEXTvbdOJwv9AtG",
password_confirmation: "",
confirmation_code: "91f0583ed76c95ebf378648d65d0eac7",
remember_token: "bGmdTchXtilBj41FIazkFS3PDZzr1tVKmTFnMkeeSoD7wpW6hoQ07A42plle",
confirmed: "1",
created_at: "2014-10-19 12:17:55",
updated_at: "2014-10-20 15:07:01",
but in my app I have no idea why now I see like this when I dd($var);
object(OrdemServico)#728 (23) { ["guarded":protected]=> array(4) { [0]=> string(10) "updated_at" [1]=> string(10) "created_at" [2]=> string(10) "deleted_at" [3]=> string(2) "id" } ["fillable":protected]=> array(13) { [0]=> string(7) "tipo_id" [1]=> string(10) "cliente_id" [2]=> string(11) "contrato_id" [3]=> string(10) "tecnico_id" [4]=> string(10) "created_by" [5]=> string(10) "updated_by" [6]=> string(13) "data_execucao" [7]=> string(13) "tempo_servico" [8]=> string(18) "tempo_deslocamento" [9]=> string(5) "ativo" [10]=> string(10) "finalizada" [11]=> string(5) "os_id" [12]=> string(6) "visita" } ["dates":protected]=> array(1) { [0]=> string(10) "deleted_at" } ["errors"]=> NULL ["originalAttributes":protected]=> array(0) { } ["autoHydrateEntityFromInput"]=> bool(true) ["connection":protected]=> NULL ["table":protected]=> NULL ["primaryKey":protected]=> string(2) "id" ["perPage":protected]=> int(15) ["incrementing"]=> bool(true) ["timestamps"]=> bool(true) ["attributes":protected]=> array(0) { } ["original":protected]=> array(0) { } ["relations":protected]=> array(0) { } ["hidden":protected]=> array(0) { } ["visible":protected]=> array(0) { } ["appends":protected]=> array(0) { } ["touches":protected]=> array(0) { } ["observables":protected]=> array(0) { } ["with":protected]=> array(0) { } ["morphClass":protected]=> NULL ["exists"]=> bool(false) }
its all in the same line and hard to read and identify the attributes, how could fix this?
obs that's isnt the same object, I just got any from google in the first one, the second is my actual dd(); and how show the attributes
thx for help!
I have retrieve a view programmaticly in my module with PHP. How can retrieve the values of this view? I'm using drupal 6.
That's the view result in my PHP code:
enter code hereobject(view)#48 (22) {
["db_table"]=>
string(10) "views_view"
["base_table"]=>
string(4) "node"
["args"]=>
array(0) {
}
["use_ajax"]=>
bool(false)
["result"]=>
array(0) {
}
["pager"]=>
array(5) {
["use_pager"]=>
bool(false)
["items_per_page"]=>
int(10)
["element"]=>
int(0)
["offset"]=>
int(0)
["current_page"]=>
int(0)
}
["old_view"]=>
array(0) {
}
["vid"]=>
string(2) "48"
["name"]=>
string(7) "student"
["description"]=>
string(7) "Student"
["tag"]=>
string(0) ""
["view_php"]=>
string(0) ""
["is_cacheable"]=>
string(1) "0"
["display"]=>
array(2) {
["default"]=>
object(views_display)#11 (7) {
["db_table"]=>
string(13) "views_display"
["vid"]=>
string(2) "48"
["id"]=>
string(7) "default"
["display_title"]=>
string(8) "Defaults"
["display_plugin"]=>
string(7) "default"
["position"]=>
string(1) "1"
["display_options"]=>
array(2) {
["fields"]=>
array(5) {
["field_locatie_student_lid"]=>
array(14) {
["label"]=>
string(7) "Locatie"
["alter"]=>
array(16) {
["alter_text"]=>
int(0)
["text"]=>
string(0) ""
["make_link"]=>
int(0)
["path"]=>
string(0) ""
["link_class"]=>
string(0) ""
["alt"]=>
string(0) ""
["prefix"]=>
string(0) ""
["suffix"]=>
string(0) ""
["target"]=>
string(0) ""
["help"]=>
string(0) ""
["trim"]=>
int(0)
["max_length"]=>
string(0) ""
["word_boundary"]=>
int(1)
["ellipsis"]=>
int(1)
["html"]=>
int(0)
["strip_tags"]=>
int(0)
}
["empty"]=>
string(41) "geen overeenkomstige resultaten gevonden."
["hide_empty"]=>
int(0)
["empty_zero"]=>
int(0)
["link_to_node"]=>
int(0)
["label_type"]=>
string(6) "widget"
["format"]=>
string(7) "default"
["multiple"]=>
array(4) {
["group"]=>
bool(true)
["multiple_number"]=>
string(0) ""
["multiple_from"]=>
string(0) ""
["multiple_reversed"]=>
bool(false)
}
["exclude"]=>
int(0)
["id"]=>
string(25) "field_locatie_student_lid"
["table"]=>
string(31) "node_data_field_locatie_student"
["field"]=>
string(25) "field_locatie_student_lid"
["relationship"]=>
string(4) "none"
}
["field_naam_student_value"]=>
array(14) {
["label"]=>
string(4) "Naam"
["alter"]=>
array(16) {
["alter_text"]=>
int(0)
["text"]=>
string(0) ""
["make_link"]=>
int(0)
["path"]=>
string(0) ""
["link_class"]=>
string(0) ""
["alt"]=>
string(0) ""
["prefix"]=>
string(0) ""
["suffix"]=>
string(0) ""
["target"]=>
string(0) ""
["help"]=>
string(0) ""
["trim"]=>
int(0)
["max_length"]=>
string(0) ""
["word_boundary"]=>
int(1)
["ellipsis"]=>
int(1)
["html"]=>
int(0)
["strip_tags"]=>
int(0)
}
["empty"]=>
string(41) "geen overeenkomstige resultaten gevonden."
["hide_empty"]=>
int(0)
["empty_zero"]=>
int(0)
["link_to_node"]=>
int(0)
["label_type"]=>
string(6) "widget"
["format"]=>
string(7) "default"
["multiple"]=>
array(4) {
["group"]=>
bool(true)
["multiple_number"]=>
string(0) ""
["multiple_from"]=>
string(0) ""
["multiple_reversed"]=>
bool(false)
}
["exclude"]=>
int(0)
["id"]=>
string(24) "field_naam_student_value"
["table"]=>
string(28) "node_data_field_naam_student"
["field"]=>
string(24) "field_naam_student_value"
["relationship"]=>
string(4) "none"
}
["field_ugentid_student_value"]=>
array(14) {
["label"]=>
string(7) "UGentID"
["alter"]=>
array(16) {
["alter_text"]=>
int(0)
["text"]=>
string(0) ""
["make_link"]=>
int(0)
["path"]=>
string(0) ""
["link_class"]=>
string(0) ""
["alt"]=>
string(0) ""
["prefix"]=>
string(0) ""
["suffix"]=>
string(0) ""
["target"]=>
string(0) ""
["help"]=>
string(0) ""
["trim"]=>
int(0)
["max_length"]=>
string(0) ""
["word_boundary"]=>
int(1)
["ellipsis"]=>
int(1)
["html"]=>
int(0)
["strip_tags"]=>
int(0)
}
["empty"]=>
string(41) "geen overeenkomstige resultaten gevonden."
["hide_empty"]=>
int(0)
["empty_zero"]=>
int(0)
["link_to_node"]=>
int(0)
["label_type"]=>
string(6) "widget"
["format"]=>
string(7) "default"
["multiple"]=>
array(4) {
["group"]=>
bool(true)
["multiple_number"]=>
string(0) ""
["multiple_from"]=>
string(0) ""
["multiple_reversed"]=>
bool(false)
}
["exclude"]=>
int(0)
["id"]=>
string(27) "field_ugentid_student_value"
["table"]=>
string(31) "node_data_field_ugentid_student"
["field"]=>
string(27) "field_ugentid_student_value"
["relationship"]=>
string(4) "none"
}
["field_voornaam_student_value"]=>
array(14) {
["label"]=>
string(8) "Voornaam"
["alter"]=>
array(16) {
["alter_text"]=>
int(0)
["text"]=>
string(0) ""
["make_link"]=>
int(0)
["path"]=>
string(0) ""
["link_class"]=>
string(0) ""
["alt"]=>
string(0) ""
["prefix"]=>
string(0) ""
["suffix"]=>
string(0) ""
["target"]=>
string(0) ""
["help"]=>
string(0) ""
["trim"]=>
int(0)
["max_length"]=>
string(0) ""
["word_boundary"]=>
int(1)
["ellipsis"]=>
int(1)
["html"]=>
int(0)
["strip_tags"]=>
int(0)
}
["empty"]=>
string(41) "geen overeenkomstige resultaten gevonden."
["hide_empty"]=>
int(0)
["empty_zero"]=>
int(0)
["link_to_node"]=>
int(0)
["label_type"]=>
string(6) "widget"
["format"]=>
string(7) "default"
["multiple"]=>
array(4) {
["group"]=>
bool(true)
["multiple_number"]=>
string(0) ""
["multiple_from"]=>
string(0) ""
["multiple_reversed"]=>
bool(false)
}
["exclude"]=>
int(0)
["id"]=>
string(28) "field_voornaam_student_value"
["table"]=>
string(32) "node_data_field_voornaam_student"
["field"]=>
string(28) "field_voornaam_student_value"
["relationship"]=>
string(4) "none"
}
["field_voorkeur_student_value"]=>
array(14) {
["label"]=>
string(19) "Voorkeurstageplaats"
["alter"]=>
array(16) {
["alter_text"]=>
int(0)
["text"]=>
string(0) ""
["make_link"]=>
int(0)
["path"]=>
string(0) ""
["link_class"]=>
string(0) ""
["alt"]=>
string(0) ""
["prefix"]=>
string(0) ""
["suffix"]=>
string(0) ""
["target"]=>
string(0) ""
["help"]=>
string(0) ""
["trim"]=>
int(0)
["max_length"]=>
string(0) ""
["word_boundary"]=>
int(1)
["ellipsis"]=>
int(1)
["html"]=>
int(0)
["strip_tags"]=>
int(0)
}
["empty"]=>
string(41) "geen overeenkomstige resultaten gevonden."
["hide_empty"]=>
int(0)
["empty_zero"]=>
int(0)
["link_to_node"]=>
int(0)
["label_type"]=>
string(6) "widget"
["format"]=>
string(7) "default"
["multiple"]=>
array(4) {
["group"]=>
bool(true)
["multiple_number"]=>
string(0) ""
["multiple_from"]=>
string(0) ""
["multiple_reversed"]=>
bool(false)
}
["exclude"]=>
int(0)
["id"]=>
string(28) "field_voorkeur_student_value"
["table"]=>
string(32) "node_data_field_voorkeur_student"
["field"]=>
string(28) "field_voorkeur_student_value"
["relationship"]=>
string(4) "none"
}
}
["filters"]=>
array(2) {
["type"]=>
array(9) {
["operator"]=>
string(2) "in"
["value"]=>
array(1) {
["student"]=>
string(7) "student"
}
["group"]=>
string(1) "0"
["exposed"]=>
bool(false)
["expose"]=>
array(2) {
["operator"]=>
bool(false)
["label"]=>
string(0) ""
}
["id"]=>
string(4) "type"
["table"]=>
string(4) "node"
["field"]=>
string(4) "type"
["relationship"]=>
string(4) "none"
}
["field_ugentid_student_value"]=>
array(9) {
["operator"]=>
string(9) "not empty"
["value"]=>
array(3) {
["value"]=>
string(0) ""
["min"]=>
string(0) ""
["max"]=>
string(0) ""
}
["group"]=>
string(1) "0"
["exposed"]=>
bool(false)
["expose"]=>
array(2) {
["operator"]=>
bool(false)
["label"]=>
string(0) ""
}
["id"]=>
string(27) "field_ugentid_student_value"
["table"]=>
string(31) "node_data_field_ugentid_student"
["field"]=>
string(27) "field_ugentid_student_value"
["relationship"]=>
string(4) "none"
}
}
}
}
["page_1"]=>
object(views_display)#43 (7) {
["db_table"]=>
string(13) "views_display"
["vid"]=>
string(2) "48"
["id"]=>
string(6) "page_1"
["display_title"]=>
string(6) "Pagina"
["display_plugin"]=>
string(4) "page"
["position"]=>
string(1) "2"
["display_options"]=>
array(1) {
["path"]=>
string(17) "studentenLijstCSV"
}
}
}
["type"]=>
string(6) "Normal"
["loaded"]=>
bool(true)
["executed"]=>
bool(false)
["built"]=>
bool(false)
["build_info"]=>
array(0) {
}
["attachment_before"]=>
string(0) ""
["attachment_after"]=>
string(0) ""
["get_total_rows"]=>
bool(true)
}
<div style="display: none" id="drupalforfirebug_general"><fieldset><legend>Drupal for Firebug General Messages</legend>There were no messages sent to the general log. Please use "firep($item, $optional_title)" to output messages to this console.</div><div style="display: none" id="drupalforfirebug_sql"><fieldset><legend>Devel Module is Not Installed</legend>Please install and enable the Devel Module to display the SQL queries.</fieldset></div><div style="display: none" id="drupalforfirebug_hook_form_alter">There was no form altering.</div><div style="display: none" id="drupalforfirebug_hook_user">There was no user processing.</div><div style="display: none" id="drupalforfirebug_hook_nodeapi">There was no node processing.</div><div style="display: none" id="drupalforfirebug_hook_views">There was no views processing.</div><div style="display: none" id="drupalforfirebug_php"><object style="width:100%;frameborder=0;height=100%;margin-bottom:-3px;" type="text/html" data="http://localhost/testplanning/?q=admin/firebug/exec"></object></div><div style="display: none" id="drupalforfirebug_hook_page_alter">This feature is only available in Drupal 7.</div>
why you not using just views?
$view = view_get_view('MY_VIEW_NAME');
$view->set_display('MY_DISPLAY'); // page_1 or block_1 ... block_n, ...page_n
$view->set_items_per_page(0);
$view->execute();
$result = $view->result;
$result will contains array of values of each row
I haven't actually tried this myself. First thing to do would be to execute the views query. This can be done with the execute function.
So doing something like this:
$view->execute('display_id');
Should populate the $view object with at least some data. The data available differs through the different layers of theme functions, so you might not get what you want. But this is the best method I can think of.