for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace XoopsModules\Smartobject;
/**
* Contains the classes responsible for displaying a simple table filled with records of SmartObjects
*
* @license GNU
* @author marcan <[email protected]>
* @link http://smartfactory.ca The SmartFactory
* @package SmartObject
* @subpackage SmartObjectTable
*/
use XoopsModules\Smartobject;
* SmartObjectColumn class
* Class representing a single column of a SmartObjectTable
class ObjectColumn
{
public $_keyname;
public $_align;
public $_width;
public $_customMethodForValue;
public $_extraParams;
public $_sortable;
public $_customCaption;
* SmartObjectColumn constructor.
* @param $keyname
* @param string $align
* @param bool $width
* @param bool $customMethodForValue
* @param bool $param
* @param bool $customCaption
* @param bool $sortable
public function __construct(
$keyname,
$align = 'left',
$width = false,
$customMethodForValue = false,
$param = false,
$customCaption = false,
$sortable = true
) {
$this->_keyname = $keyname;
$this->_align = $align;
$this->_width = $width;
$this->_customMethodForValue = $customMethodForValue;
$this->_sortable = $sortable;
$this->_param = $param;
_param
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
$this->_customCaption = $customCaption;
}
public function getKeyName()
return $this->_keyname;
* @return string
public function getAlign()
return $this->_align;
* @return bool
public function isSortable()
return $this->_sortable;
* @return bool|string
public function getWidth()
if ($this->_width) {
$ret = $this->_width;
} else {
$ret = '';
return $ret;
public function getCustomCaption()
return $this->_customCaption;
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: