Login immediately after signup - laravel-4

This way I store user information to DB:
$user = new User;
$user->email = $arr['email'];
$user->nick = $arr['display'];
$user->ip = Request::getClientIp();
$user->save();
and it does its work nicely but after save() method I'm going to log in the user this way:
Auth::login($user);
It never result in a true condition. Then I tried to log the user with his ID, when I dump the $user:
object(User)#179 (20) {
["connection":protected]=>
NULL
["table":protected]=>
NULL
["primaryKey":protected]=>
string(2) "id"
["perPage":protected]=>
int(15)
["incrementing"]=>
bool(true)
["timestamps"]=>
bool(true)
["attributes":protected]=>
array(6) {
["email"]=>
string(19) "myemail#gmail.com"
["nick"]=>
string(17) "my_name"
["ip"]=>
string(9) "127.0.0.1"
["updated_at"]=>
string(19) "2014-01-25 09:48:07"
["created_at"]=>
string(19) "2014-01-25 09:48:07"
["id"]=>
int(13)
}
.
.
.
Then I tried this:
Auth::loginUsingId($user->original['id']);
Actually $user->original['id'] doesn return NULL!
Helps are appreciated!

Related

How to store auntheticated username into a database field

I have a clinician field in my treatments table. I want the authenticated user to be stored in the clinician field of the table.
The field in the database migration is as
$table->string('clinician')->nullable();
In my TreatmentController, I have thisFacade
use Illuminate\Support\Facades\Auth;
And this function
public function store (Patient $patient)
{
Treatment::create([
'patient_id'=>$patient->id,
'clinician'=> Auth::user()->username,
'treatmentDetails' => request('treatmentDetails')
]);
return back()->with('success','Treatment saved!.');
}
I
In the Treatment model i have this.
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Treatment extends Model
{
//
protected $guarded = [];
public function patients()
{
return $this->belongsTo('App\Patient');
}
}
var_dump(Auth::user()); returns this
object(App\User)#615 (27) { ["fillable":protected]=> array(3) { [0]=> string(8)
"username" [1]=> string(5) "email" [2]=> string(8) "password" }
["hidden":protected]=> array(2) { [0]=> string(8) "password" [1]=> string(14)
"remember_token" } ["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(9) {
["id"]=> int(1) ["email"]=> string(16) "hans10#gmail.com"
["email_verified_at"]=> NULL ["password"]=> string(60)
"$2y$10$3KfEDTP1Vf014KZyvvH4Nu1thiLQtfKxz6Jo7wFpqAoKMg6SSRb2G" ["username"]=>
string(5) "Karim" ["roleId"]=> int(2) ["remember_token"]=> NULL
["created_at"]=> string(19) "2019-02-16 13:00:59" ["updated_at"]=> string(19)
"2019-02-16 13:00:59" } ["original":protected]=> array(9) { ["id"]=> int(1)
["email"]=> string(16) "hans10#gmail.com" ["email_verified_at"]=> NULL
["password"]=> string(60)
"$2y$10$3KfEDTP1Vf014KZyvvH4Nu1thiLQtfKxz6Jo7wFpqAoKMg6SSRb2G" ["username"]=>
string(5) "Karim" ["roleId"]=> int(2) ["remember_token"]=> NULL
["created_at"]=> string(19) "2019-02-16 13:00:59" ["updated_at"]=> string(19)
"2019-02-16 13:00:59" } ["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) ["visible":protected]=> array(0) { }
["guarded":protected]=> array(1) { [0]=> string(1) "*" }
["rememberTokenName":protected]=> string(14) "remember_token" }
If Karim is the user who is currently logged in, i want the name Karim to be inserted in clinician field. The treatment is stored successfully but with a null value in the clinician field.
Try with $fillable proprty in your model.
https://laravel.com/docs/5.7/eloquent

laravel: query get duplicate records laravel

when i write this query. i have a two records in shown in result
although the table has only one.
$side_messages = Message::orderBy('id' , 'desc')
->where('to_id' , Auth::id())->orWhere('from_id' , Auth::id())->first();
dd($side_messages);
The result:
object(Message)#412 (20) { ["fillable":protected]=> array(4) { [0]=> string(5) "to_id" [1]=> string(7) "from_id" [2]=> string(3) "msg" [3]=> string(4) "seen" } ["guarded":protected]=> array(0) { } ["connection":protected]=> NULL ["table":protected]=> NULL ["primaryKey":protected]=> string(2) "id" ["perPage":protected]=> int(15) ["incrementing"]=> bool(true) ["timestamps"]=> bool(true) ["attributes":protected]=> array(7) { ["id"]=> string(1) "1" ["from_id"]=> string(1) "1" ["to_id"]=> string(1) "2" ["msg"]=> string(18) "test_query" ["seen"]=> string(1) "0" ["created_at"]=> string(19) "0000-00-00 00:00:00" ["updated_at"]=> string(19) "0000-00-00 00:00:00" } ["original":protected]=> array(7) { ["id"]=> string(1) "1" ["from_id"]=> string(1) "1" ["to_id"]=> string(1) "2" ["msg"]=> string(18) "test_query" ["seen"]=> string(1) "0" ["created_at"]=> string(19) "0000-00-00 00:00:00" ["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) { } ["dates":protected]=> array(0) { } ["touches":protected]=> array(0) { } ["observables":protected]=> array(0) { } ["with":protected]=> array(0) { } ["morphClass":protected]=> NULL ["exists"]=> bool(true) }
It's one value not two but it's repeated for some reason one for #attributes:[] and the other for #original:[]
first method return a single model instance (Illuminate\Database\Eloquent\Collection).
If you need to debug how much row is returned, you can use
$count = Message::orderBy('id' , 'desc')->where('to_id' , Auth::id())->orWhere('from_id' , Auth::id())->count();
I think the result your posted is an instance of your Message model. So you can't be sure that it's returning duplicate record.
first method always return single instance of model. Not collection (multiple record) of model instance.
This dump You post is a model object, so it contains all the model settings. The thing that is important is the section
object(Message)#412 (20) { ["fillable":protected]=> array(4) { [0]=> string(5) "to_id" [1]=> string(7) "from_id" [2]=> string(3) "msg" [3]=> string(4) "seen" } ["guarded":protected]=> array(0) { } ["connection":protected]=> NULL ["table":protected]=> NULL ["primaryKey":protected]=> string(2) "id" ["perPage":protected]=> int(15) ["incrementing"]=> bool(true) ["timestamps"]=> bool(true) ["attributes":protected]=> array(7) { ["id"]=> string(1) "1" ["from_id"]=> string(1) "1" ["to_id"]=> string(1) "2" ["msg"]=> string(18) "test_query" ["seen"]=> string(1) "0" ["created_at"]=> string(19) "0000-00-00 00:00:00" ["updated_at"]=> string(19) "0000-00-00 00:00:00" } ["original":protected]=> array(7) { ["id"]=> string(1) "1" ["from_id"]=> string(1) "1" ["to_id"]=> string(1) "2" ["msg"]=> string(18) "test_query" ["seen"]=> string(1) "0" ["created_at"]=> string(19) "0000-00-00 00:00:00" ["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) { } ["dates":protected]=> array(0) { } ["touches":protected]=> array(0) { } ["observables":protected]=> array(0) { } ["with":protected]=> array(0) { } ["morphClass":protected]=> NULL ["exists"]=> bool(true) }
For much cleaner dump execute this:
$side_messages = Message::orderBy('id' , 'desc')->where('to_id' , Auth::id())->orWhere('from_id' , Auth::id())->first();
dd($side_messages->toArray());
And show me where is second object?!

Laravel 4.2 oneToMany relationship issue

Despite having implemented many L4 relationships and them working most of the time. I am struggling and for some reason cannot see where I have gone wrong. It is almost certainly something obvious.
The relationship is that A task has one topic, topics have many tasks.
Task Model
class Task extends Eloquent {
protected $guarded = array();
public static $rules = array(
);
public function resources()
{
return $this->belongsToMany('Resource');
}
public function topic()
{
return $this->belongsTo('Topic', 'topic_id');
}
}
Topic Model
class Topic extends Eloquent {
protected $guarded = array();
public static $rules = array();
public function tasks()
{
return $this->hasMany('Task');
}
}
Task Controller
public function show($id)
{
$task = $this->task->where('number', $id);
return View::make('tasks.show', compact('task'));
}
when I dd ($task) the relations array is empty.
object(Task)#688 (21) { ["guarded":protected]=> array(0) { }
["connection":protected]=> NULL ["table":protected]=> NULL
["primaryKey":protected]=> string(2) "id" ["perPage":protected]=>
int(15) ["incrementing"]=> bool(true) ["timestamps"]=> bool(true)
["attributes":protected]=> array(11) { ["id"]=> string(1) "9"
["number"]=> string(1) "6" ["topic"]=> string(1) "2" ["topic_old"]=>
string(10) "War Effort" ["task"]=> string(28) "You want us to collect
Moss?" ["objective"]=> string(36) "Collecting Information including
Q&A" ["method"]=> string(29) "Supported historical research"
["context"]=> string(0) "" ["level"]=> string(0) "" ["created_at"]=>
string(19) "0000-00-00 00:00:00" ["updated_at"]=> string(19)
"0000-00-00 00:00:00" } ["original":protected]=> array(11) { ["id"]=>
string(1) "9" ["number"]=> string(1) "6" ["topic"]=> string(1) "2"
["topic_old"]=> string(10) "War Effort" ["task"]=> string(28) "You
want us to collect Moss?" ["objective"]=> string(36) "Collecting
Information including Q&A" ["method"]=> string(29) "Supported
historical research" ["context"]=> string(0) "" ["level"]=> string(0)
"" ["created_at"]=> string(19) "0000-00-00 00:00:00" ["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) { }
["fillable":protected]=> array(0) { } ["dates":protected]=> array(0) {
} ["touches":protected]=> array(0) { } ["observables":protected]=>
array(0) { } ["with":protected]=> array(0) { }
["morphClass":protected]=> NULL ["exists"]=> bool(true)
["softDelete":protected]=> bool(false) }
You need to call the relationship that you declare in the model before. In this case I will use Eager Loading, with() function.
$tasks = $this->task->where('number', $id)->with('topic');
source: http://laravel.com/docs/4.2/eloquent#eager-loading
I would like to change the variable to $tasks because using
where(), you will get instant of
Illuminate\Database\Eloquent\Collection (many results)
And you can check the result by.
dd($tasks->get());

How to translate an array of values from DB

I have an array of values that get from DB:
$repairs = DB::table('repair_parts')->orderBy('repair', 'asc')
->where('status_id', '1')->distinct()->lists('repair', 'id');
I want to ttranslate those values in another lang. To display in the view:
{{ Form::select('repair', $repairs, isset($v->repair_id) ? $v->repair_id : '', array(
'class' => 'form-control',
'id'=>'repair_field',
'placeholder' => Lang::get('messages.repair')))
}}
the problem is that I can't translate them with Lang::get('repair'.$repairs). Is there any other way to do it?
EDIT
array(13) { [22]=> string(2) "dd" [23]=> string(3) "fff" [21]=> string(4) "Test" [5]=> string(4) "test" [13]=> string(4) "test" [7]=> string(5) "test3" [14]=> string(5) "test4" [15]=> string(5) "test6" [16]=> string(5) "test6" [18]=> string(5) "test6" [19]=> string(5) "test6" [17]=> string(5) "test6" [20]=> string(5) "Tires" }
Solved. What I did was append to the values of the array
array_walk($repairs, function(&$value, $key) { $value = Lang::get('repair.'.$value); });
and I got translated values.

Cache not delivering?

I recently updated to magento 1.9 but found my categories very slow. I couldn't find the problem so guessed this had to do with magento 1.9 and decided to downgrade to magento 1.8. Everything was working fine then, but after a while magento became slower again. I had made some changes due to some other errors, as I slightly changed /etc/local.xml. Obviously, I undid it again, even though it should not have been the reason in the first place. Unfortunately, this didn't solve my problem.
My current local.xml:
<cache>
<backend>Cm_Cache_Backend_File</backend>
<prefix>SH24_</prefix>
</cache>
Cm Cache Backend is definitely working. Same results when using standard cache.
I turned on the profiler, and how files are delivered looks completely different on a different development page.
http://i.imgur.com/fnLRheX.png
(Slow Page)
This is how it looks like on another test development site:
http://i.imgur.com/5lwHxH2.png
(Fast Page)
Generating difference is 6 seconds.
As you can tell, in the slow site, everything is nested under layout/db_updates, but on the slow site, it's not.
The most time consuming call is
CONFIGURABLE:Mage_Catalog_Model_Product_Type_Configurable::getConfigurableAttributes
which is not called on the fast site. Instead it's just:
__EAV_LOAD_MODEL__
In var/cache files appear. Error Log doesn't log anything.
Does anyone know, how I could solve this?
Thank you very much!
EDIT:
What I have found so far.
/Mage/Core/Model/Layout/update.php
public function fetchDbLayoutUpdates($handle)
{
$_profilerKey = 'layout/db_update: '.$handle;
Varien_Profiler::start($_profilerKey);
Mage::log($_profilerKey, null, 'mylogfile.log');
$updateStr = $this->_getUpdateString($handle);
if (!$updateStr) {
return false;
}
$updateStr = '<update_xml>' . $updateStr . '</update_xml>';
$updateStr = str_replace($this->_subst['from'], $this->_subst['to'], $updateStr);
$updateXml = simplexml_load_string($updateStr, $this->getElementClass());
$this->fetchRecursiveUpdates($updateXml);
$this->addUpdate($updateXml->innerXml());
Varien_Profiler::stop($_profilerKey);
return true;
}
As expected is $updateStr empty and the call returns falls.
So I had a closer look on $this->_getUpdateString($handle):
return Mage::getResourceModel('core/layout')->fetchUpdatesByHandle($handle);
I found fetchUpdatesByHandle($handle); in /Mage/Core/Model/Resource/Layout.php:
public function fetchUpdatesByHandle($handle, $params = array())
{
$bind = array(
'store_id' => Mage::app()->getStore()->getId(),
'area' => Mage::getSingleton('core/design_package')->getArea(),
'package' => Mage::getSingleton('core/design_package')->getPackageName(),
'theme' => Mage::getSingleton('core/design_package')->getTheme('layout')
);
foreach ($params as $key => $value) {
if (isset($bind[$key])) {
$bind[$key] = $value;
}
}
$bind['layout_update_handle'] = $handle;
$result = '';
$readAdapter = $this->_getReadAdapter();
if ($readAdapter) {
$select = $readAdapter->select()
->from(array('layout_update' => $this->getMainTable()), array('xml'))
->join(array('link'=>$this->getTable('core/layout_link')),
'link.layout_update_id=layout_update.layout_update_id',
'')
->where('link.store_id IN (0, :store_id)')
->where('link.area = :area')
->where('link.package = :package')
->where('link.theme = :theme')
->where('layout_update.handle = :layout_update_handle')
->order('layout_update.sort_order ' . Varien_Db_Select::SQL_ASC);
$result = join('', $readAdapter->fetchCol($select, $bind));
}
return $result;
}
$result is expected an empty string.
$select looks like this:
2014-06-22T13:52:12+00:00 DEBUG (7): handle CATEGORY_56
query
object(Varien_Db_Select)#295 (4) {
["_bind":protected]=>
array(0) {
}
["_adapter":protected]=>
object(Magento_Db_Adapter_Pdo_Mysql)#80 (31) {
["_defaultStmtClass":protected]=>
string(29) "Varien_Db_Statement_Pdo_Mysql"
["_transactionLevel":protected]=>
int(0)
["_connectionFlagsSet":protected]=>
bool(true)
["_ddlCache":protected]=>
array(1) {
[1]=>
array(2) {
["catalog_product_flat_1"]=>
array(56) {
["entity_id"]=>
array(14) {
["SCHEMA_NAME"]=>
NULL
["TABLE_NAME"]=>
string(22) "catalog_product_flat_1"
["COLUMN_NAME"]=>
string(9) "entity_id"
["COLUMN_POSITION"]=>
int(1)
["DATA_TYPE"]=>
string(3) "int"
["DEFAULT"]=>
NULL
["NULLABLE"]=>
bool(false)
["LENGTH"]=>
NULL
["SCALE"]=>
NULL
["PRECISION"]=>
NULL
["UNSIGNED"]=>
bool(true)
["PRIMARY"]=>
bool(true)
["PRIMARY_POSITION"]=>
int(1)
["IDENTITY"]=>
bool(false)
}
["attribute_set_id"]=>
array(14) {
["SCHEMA_NAME"]=>
NULL
["TABLE_NAME"]=>
string(22) "catalog_product_flat_1"
["COLUMN_NAME"]=>
string(16) "attribute_set_id"
["COLUMN_POSITION"]=>
int(2)
["DATA_TYPE"]=>
string(8) "smallint"
["DEFAULT"]=>
string(1) "0"
["NULLABLE"]=>
bool(false)
["LENGTH"]=>
NULL
["SCALE"]=>
NULL
["PRECISION"]=>
NULL
["UNSIGNED"]=>
bool(true)
["PRIMARY"]=>
bool(false)
["PRIMARY_POSITION"]=>
NULL
["IDENTITY"]=>
bool(false)
}
["type_id"]=>
array(14) {
["SCHEMA_NAME"]=>
NULL
["TABLE_NAME"]=>
string(22) "catalog_product_flat_1"
["COLUMN_NAME"]=>
string(7) "type_id"
["COLUMN_POSITION"]=>
int(3)
["DATA_TYPE"]=>
string(7) "varchar"
["DEFAULT"]=>
string(6) "simple"
["NULLABLE"]=>
bool(false)
["LENGTH"]=>
string(2) "32"
["SCALE"]=>
NULL
["PRECISION"]=>
NULL
["UNSIGNED"]=>
NULL
["PRIMARY"]=>
bool(false)
["PRIMARY_POSITION"]=>
NULL
["IDENTITY"]=>
bool(false)
}
["cost"]=>
array(14) {
["SCHEMA_NAME"]=>
NULL
["TABLE_NAME"]=>
string(22) "catalog_product_flat_1"
["COLUMN_NAME"]=>
string(4) "cost"
["COLUMN_POSITION"]=>
int(4)
["DATA_TYPE"]=>
string(7) "decimal"
["DEFAULT"]=>
NULL
["NULLABLE"]=>
bool(true)
["LENGTH"]=>
NULL
["SCALE"]=>
string(1) "4"
["PRECISION"]=>
string(2) "12"
["UNSIGNED"]=>
NULL
["PRIMARY"]=>
bool(false)
["PRIMARY_POSITION"]=>
NULL
["IDENTITY"]=>
bool(false)
}
["created_at"]=>
array(14) {
["SCHEMA_NAME"]=>
NULL
["TABLE_NAME"]=>
string(22) "catalog_product_flat_1"
["COLUMN_NAME"]=>
string(10) "created_at"
["COLUMN_POSITION"]=>
int(5)
["DATA_TYPE"]=>
string(9) "timestamp"
["DEFAULT"]=>
NULL
["NULLABLE"]=>
bool(true)
["LENGTH"]=>
NULL
["SCALE"]=>
NULL
["PRECISION"]=>
NULL
["UNSIGNED"]=>
NULL
["PRIMARY"]=>
bool(false)
["PRIMARY_POSITION"]=>
NULL
["IDENTITY"]=>
bool(false)
}
[MORE ATTRIBUTES]
}
}
}
["_bindParams":protected]=>
array(0) {
}
["_bindIncrement":protected]=>
int(0)
["_debug":protected]=>
bool(false)
["_logQueryTime":protected]=>
float(0.05)
["_logAllQueries":protected]=>
bool(false)
["_logCallStack":protected]=>
bool(false)
["_debugFile":protected]=>
string(23) "var/debug/pdo_mysql.log"
["_debugIoAdapter":protected]=>
NULL
["_debugTimer":protected]=>
int(0)
["_cacheAdapter":protected]=>
object(Varien_Cache_Core)#18 (6) {
["_specificOptions":protected]=>
array(1) {
["slab_size"]=>
int(0)
}
["_backend":protected]=>
object(Cm_Cache_Backend_File)#10 (4) {
["_options":protected]=>
array(11) {
["cache_dir"]=>
string(41) "/home/www/xxxx/magento/var/cache/"
["file_name_prefix"]=>
string(2) "cm"
["file_locking"]=>
bool(true)
["read_control"]=>
bool(false)
["read_control_type"]=>
string(5) "crc32"
["hashed_directory_level"]=>
int(2)
["use_chmod"]=>
bool(false)
["directory_mode"]=>
int(504)
["file_mode"]=>
int(432)
["hashed_directory_umask"]=>
int(504)
["cache_file_umask"]=>
int(432)
}
["_isTagDirChecked":protected]=>
NULL
["_metadatasArray":protected]=>
array(0) {
}
["_directives":protected]=>
array(3) {
["lifetime"]=>
int(7200)
["logging"]=>
bool(false)
["logger"]=>
NULL
}
}
["_options":protected]=>
array(9) {
["write_control"]=>
bool(true)
["caching"]=>
bool(true)
["cache_id_prefix"]=>
string(5) "xxx"
["automatic_serialization"]=>
bool(false)
["automatic_cleaning_factor"]=>
int(0)
["lifetime"]=>
int(7200)
["logging"]=>
bool(false)
["logger"]=>
NULL
["ignore_user_abort"]=>
bool(false)
}
["_lastId":"Zend_Cache_Core":private]=>
string(37) "XX_DB_PDO_MYSQL_DDL_eav_attribute_1"
["_extendedBackend":protected]=>
bool(true)
["_backendCapabilities":protected]=>
array(6) {
["automatic_cleaning"]=>
bool(true)
["tags"]=>
bool(true)
["expired_read"]=>
bool(true)
["priority"]=>
bool(false)
["infinite_lifetime"]=>
bool(true)
["get_list"]=>
bool(true)
}
}
["_isDdlCacheAllowed":protected]=>
bool(true)
["_ddlColumnTypes":protected]=>
array(13) {
["boolean"]=>
string(4) "bool"
["smallint"]=>
string(8) "smallint"
["integer"]=>
string(3) "int"
["bigint"]=>
string(6) "bigint"
["float"]=>
string(5) "float"
["decimal"]=>
string(7) "decimal"
["numeric"]=>
string(7) "decimal"
["date"]=>
string(4) "date"
["timestamp"]=>
string(9) "timestamp"
["datetime"]=>
string(8) "datetime"
["text"]=>
string(4) "text"
["blob"]=>
string(4) "blob"
["varbinary"]=>
string(4) "blob"
}
["_ddlRoutines":protected]=>
array(5) {
[0]=>
string(3) "alt"
[1]=>
string(3) "cre"
[2]=>
string(3) "ren"
[3]=>
string(3) "dro"
[4]=>
string(3) "tru"
}
["_tempRoutines":protected]=>
string(22) "#^\w+\s+temporary\s#im"
["_intervalUnits":protected]=>
array(6) {
["YEARS"]=>
string(4) "YEAR"
["MONTHS"]=>
string(5) "MONTH"
["DAYS"]=>
string(3) "DAY"
["HOURS"]=>
string(4) "HOUR"
["MINUTES"]=>
string(6) "MINUTE"
["SECOND"]=>
string(6) "SECOND"
}
["_queryHook":protected]=>
array(2) {
["object"]=>
object(Mage_Core_Model_Resource_Setup)#77 (9) {
["_resourceName":protected]=>
string(14) "livechat_setup"
["_resourceConfig":protected]=>
object(Mage_Core_Model_Config_Element)#124 (2) {
["setup"]=>
object(Mage_Core_Model_Config_Element)#401 (1) {
["module"]=>
string(14) "Zopim_Livechat"
}
["connection"]=>
object(Mage_Core_Model_Config_Element)#580 (1) {
["use"]=>
string(10) "core_setup"
}
}
["_connectionConfig":protected]=>
object(Mage_Core_Model_Config_Element)#35 (9) {
["host"]=>
string
["username"]=>
string
["password"]=>
string
["dbname"]=>
string(13)
["initStatements"]=>
string(14) "SET NAMES utf8"
["model"]=>
string(6) "mysql4"
["type"]=>
string(9) "pdo_mysql"
["pdoType"]=>
object(Mage_Core_Model_Config_Element)#580 (0) {
}
["active"]=>
string(1) "1"
}
["_moduleConfig":protected]=>
object(Mage_Core_Model_Config_Element)#70 (3) {
["active"]=>
string(4) "true"
["codePool"]=>
string(5) "local"
["version"]=>
string(5) "0.5.0"
}
["_callAfterApplyAllUpdates":protected]=>
bool(false)
["_conn":protected]=>
*RECURSION*
["_tables":protected]=>
array(0) {
}
["_setupCache":protected]=>
array(0) {
}
["_queriesHooked":protected]=>
bool(true)
}
["method"]=>
string(17) "callbackQueryHook"
}
["_pdoType":protected]=>
string(5) "mysql"
["_numericDataTypes":protected]=>
array(16) {
[0]=>
int(0)
[1]=>
int(1)
[2]=>
int(2)
["INT"]=>
int(0)
["INTEGER"]=>
int(0)
["MEDIUMINT"]=>
int(0)
["SMALLINT"]=>
int(0)
["TINYINT"]=>
int(0)
["BIGINT"]=>
int(1)
["SERIAL"]=>
int(1)
["DEC"]=>
int(2)
["DECIMAL"]=>
int(2)
["DOUBLE"]=>
int(2)
["DOUBLE PRECISION"]=>
int(2)
["FIXED"]=>
int(2)
["FLOAT"]=>
int(2)
}
["_config":protected]=>
array(13) {
["host"]=>
string
["username"]=>
string
["password"]=>
string
["dbname"]=>
string
["initStatements"]=>
string(14) "SET NAMES utf8"
["model"]=>
string(6) "mysql4"
["type"]=>
string(9) "pdo_mysql"
["pdoType"]=>
string(0) ""
["active"]=>
string(1) "1"
["charset"]=>
NULL
["persistent"]=>
bool(false)
["options"]=>
array(3) {
["caseFolding"]=>
int(0)
["autoQuoteIdentifiers"]=>
bool(true)
["fetchMode"]=>
int(2)
}
["driver_options"]=>
array(0) {
}
}
["_fetchMode":protected]=>
int(2)
["_profiler":protected]=>
object(Zend_Db_Profiler)#52 (4) {
["_queryProfiles":protected]=>
array(0) {
}
["_enabled":protected]=>
bool(false)
["_filterElapsedSecs":protected]=>
NULL
["_filterTypes":protected]=>
NULL
}
["_defaultProfilerClass":protected]=>
string(16) "Zend_Db_Profiler"
["_connection":protected]=>
object(PDO)#94 (0) {
}
["_caseFolding":protected]=>
int(0)
["_autoQuoteIdentifiers":protected]=>
bool(true)
["_allowSerialization":protected]=>
bool(true)
["_autoReconnectOnUnserialize":protected]=>
bool(false)
}
["_parts":protected]=>
array(12) {
["straightjoin"]=>
bool(false)
["distinct"]=>
bool(false)
["columns"]=>
array(1) {
[0]=>
array(3) {
[0]=>
string(13) "layout_update"
[1]=>
string(3) "xml"
[2]=>
NULL
}
}
["union"]=>
array(0) {
}
["from"]=>
array(2) {
["layout_update"]=>
array(4) {
["joinType"]=>
string(4) "from"
["schema"]=>
NULL
["tableName"]=>
string(18) "core_layout_update"
["joinCondition"]=>
NULL
}
["link"]=>
array(4) {
["joinType"]=>
string(10) "inner join"
["schema"]=>
NULL
["tableName"]=>
string(16) "core_layout_link"
["joinCondition"]=>
string(52) "link.layout_update_id=layout_update.layout_update_id"
}
}
["where"]=>
array(5) {
[0]=>
string(33) "(link.store_id IN (0, :store_id))"
[1]=>
string(23) "AND (link.area = :area)"
[2]=>
string(29) "AND (link.package = :package)"
[3]=>
string(25) "AND (link.theme = :theme)"
[4]=>
string(50) "AND (layout_update.handle = :layout_update_handle)"
}
["group"]=>
array(0) {
}
["having"]=>
array(0) {
}
["order"]=>
array(1) {
[0]=>
array(2) {
[0]=>
string(24) "layout_update.sort_order"
[1]=>
string(3) "ASC"
}
}
["limitcount"]=>
NULL
["limitoffset"]=>
NULL
["forupdate"]=>
bool(false)
}
["_tableCols":protected]=>
array(0) {
}
}
Result
string(0) ""
The weird thing is, that in my fast test development, $result is also empty?
Really don't know what this all means!
EDIT2:
I noticed this when looking at the instantiated models using Magneto Debug:
MODELS
Resource Name Model Class Times Instantiated
catalog/category_flat Mage_Catalog_Model_Category 32
cms/page Mage_Cms_Model_Page 18
cms/block Mage_Cms_Model_Block 5
catalog/attribute Mage_Catalog_Model_Resource_Eav_Attribute 2
eav/entity_type Mage_Eav_Model_Entity_Type 2
core/url_rewrite Mage_Core_Model_Url_Rewrite 2
index/process Mage_Index_Model_Process 2
core/flag Mage_Catalog_Model_Product_Flat_Flag 1
customer/group Mage_Customer_Model_Group 1
But: catalog/product Mage_Catalog_Model_Product 9 is not shwon, even though there are displayed products, and which is instantiated in the fast shop.

Resources