Permalink
Browse files

One way to access the object is enough

  • Loading branch information...
flack committed Dec 6, 2018
1 parent f2cedad commit 00fa8b9d4294a622cda32b493573eca273561cea
@@ -62,17 +62,15 @@
* @property integer $approved The time of approval of the object, or 0 if not approved. Set automatically through approve/unapprove.
* @property string $approver The person that approved/unapproved the object. Set automatically through approve/unapprove.
* @property integer $score The object's score for sorting.
* @property midcom_core_dbaobject $object Object to which we are attached.
* @package midcom.helper
*/
class midcom_helper_metadata
{
/**
* Object to which we are attached to. This object can be accessed from
* the outside, where necessary.
*
* @var midcom_core_dbaobject
*/
public $__object;
private $__object;
/**
* Metadata object of the current object
@@ -99,7 +99,7 @@ public static function get_object_fieldnames($object)
$classname = $object->__mgdschema_class_name__;
} elseif ($object instanceof midcom_helper_metadata) {
$metadata = true;
$classname = $object->__object->__mgdschema_class_name__;
$classname = $object->object->__mgdschema_class_name__;
}
if (is_subclass_of($classname, 'midgard_object')) {
@@ -64,7 +64,7 @@ public function __construct($object)
}
}
$this->source = $this->_metadata->__object->guid;
$this->source = $this->_metadata->object->guid;
$this->lang = midcom::get()->i18n->get_content_language();
// Add language code to RI as well so that different language versions of the object have unique identifiers
$this->RI = "{$this->source}_{$this->lang}";
@@ -78,7 +78,7 @@ public function __construct($object)
*/
private function _process_metadata()
{
$this->read_metadata_from_object($this->_metadata->__object);
$this->read_metadata_from_object($this->_metadata->object);
$metadata = $this->_metadata->get_datamanager()->get_content_html();
foreach ($metadata as $key => $value) {
switch ($key) {

0 comments on commit 00fa8b9

Please sign in to comment.