Looking at the code style used in the current code may well be a bit confused.
I'm trying to find the best style to copy to the future code.
I'm aware that Joomla4 should still be able to execute Joomla 3.x code. (more or less)
We must remember that this style will be copied for the next 5 years or more.
You need to select the code style you want.
Example 1:
administrator\components\com_newsfeeds\Helper\AssociationsHelper.php(127):
$table = Table::getInstance('NewsfeedTable', 'Joomla\\Component\\Newsfeeds\\Administrator\\Table\\');
administrator\components\com_newsfeeds\Table\NewsfeedTable.php(185):
$table = Table::getInstance('NewsfeedTable', __NAMESPACE__ . '\\', array('dbo' => $this->_db));
Here you can see two different code styles
Comment to
1)
I prefer not to use __NAMESPACE__, given the use of the JPATH_COMPONENT discussion. It does not take long before this style are copied.
Question to 2)
Usually you use the active database driver object ($db) or not?
Example 2:
plugins\sampledata\multilong\ multilang.php (1031):
$ category = Table :: getInstance ('CategoryTable', '\\ Joomla \\ Component \\ Categories \\ Administrator \\ Table \\');
administrator \ components \ com_associations \ Model \ AssociationsModel.php (393):
$ categoryTable = Table :: getInstance ('Category', 'JTable');
administrator \ components \ com_banners \ Model \ BannerModel.php (128):
$ categoryTable = Table :: getInstance ('Category');
Comment to Example 2:
Everything else et is a table "class" obejct that we need to have an instance of.
Personally, I personally like it from sample data, as it will look like the one that our components need
$ table = Table :: getInstance ('{name} Table', '\\ {vendor} \\ Component \\ {componenNeme} \\ Administrator \\ Table \\');
Example 3:
installation\src\Model\LanguagesModel.php(1333):
libraries\src\Installer\Adapter\ComponentAdapter.php(1087):
Comment to Example 3:
I think this code are not done or it's a mistake.
Since my English
is not a strong side, I would like to apologize in advance if my writing style
strikes someone. It has nothing proven, but an error on my part
Yours sincerely
Karsten F.
--
You received this message because you are subscribed to the Google Groups "Joomla! CMS Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-cm...@googlegroups.com.
To post to this group, send email to joomla-...@googlegroups.com.
Visit this group at https://groups.google.com/group/joomla-dev-cms.
For more options, visit https://groups.google.com/d/optout.