I have often seen tables are retrieved in SocialEngine using Engine_Api::_()->getDbTable()
.
For example:
$usersTbl = Engine_Api::_()->getDbTable('users','user');
$row = $usersTbl->createRow();
$row->user_id = $user->getIdentity();
$row->phone_number = $phoneNumber;
$row->save();
However, I also see that SocialEngine has used Engine_Api::_()->getItemTable
in many places. For example:
$table = Engine_Api::_()->getItemTable($type);
$row = $table->createRow();
foreach($params as $key=>$value) {
if(isset($row->$key)) {
$row->key = $value;
}
}
$row->save();
What is the main difference between these two types of accesses, if any, and when is each one used?