src/Charcoal/Admin/Widget/MapWidget.php
public function obj()
    {
        if ($this->obj === null) {
            $objId   = filter_input(INPUT_GET, 'obj_id', FILTER_SANITIZE_STRING);
            $objType = filter_input(INPUT_GET, 'obj_type', FILTER_SANITIZE_STRING);
            if ($objId && $objType) {
                $obj = $this->modelFactory()->create($objType);
                $obj->load($objId);

                $this->obj = $obj;
            } else {
                throw new InvalidArgumentException('Missing Object Type or ID');
            }
        }

        return $this->obj;
    }
public function obj()
    {
        if ($this->obj === null) {
            $objId   = filter_input(INPUT_GET, 'obj_id', FILTER_SANITIZE_STRING);
            $objType = filter_input(INPUT_GET, 'obj_type', FILTER_SANITIZE_STRING);
            if ($objId && $objType) {
                $obj = $this->modelFactory()->create($objType);
                $obj->load($objId);

                $this->obj = $obj;
            } else {
                throw new InvalidArgumentException('Missing Object Type or ID');
            }
        }

        return $this->obj;
    }
public function obj ( ) { if ( $ this -> obj === null ) { $ objId = filter_input ( INPUT_GET , 'obj_id' , FILTER_SANITIZE_STRING ) ; $ objType = filter_input ( INPUT_GET , 'obj_type' , FILTER_SANITIZE_STRING ) ; if ( $ objId && $ objType ) { $ obj = $ this -> modelFactory ( ) -> create ( $ objType ) ; $ obj -> load ( $ objId ) ; $ this -> obj = $ obj ; } else { throw new InvalidArgumentException ( 'Missing Object Type or ID' ) ; } } return $ this -> obj ; }
Retrieve the widget's related object.

@throws InvalidArgumentException If the object type or ID are invalid or missing.
@return ModelInterface
Retrieve the widget s related object .