Things that must be done before the Tag will be created.

@param mixed &$Obj the current Tag or Module

@return mixed the object if it is in justGetObject mode or null.
324017
private static function _applyPreGenerationFilters(&$Obj)
    {
        if ($Obj->name == 'comment' && Config::get('noComments')) {
            $Obj->destroy();

            return false;
        }

        if (in_array('justGetObject', $Obj->options)) {
            return $Obj;
        }

        if (in_array('return', $Obj->options)) {
            ob_start();
        }
    }
1025881
public function renderAfterFeature($obj)
    {
        //list of results
        $print = '
            <div class="featureResult '.$obj->getCurrentFeature()->getPassedClass().'">Feature has '.$obj->getCurrentFeature()->getPassedClass();

        //percent only if failed scenarios
        if ($obj->getCurrentFeature()->getTotalAmountOfScenarios() > 0 && 'failed' === $obj->getCurrentFeature()->getPassedClass()) {
            $print .= '
                <span>Scenarios passed : '.round($obj->getCurrentFeature()->getPercentPassed(), 2).'%,
                Scenarios failed : '.round($obj->getCurrentFeature()->getPercentFailed(), 2).'%</span>';
        }

        $print .= '
            </div>
        </div>';

        return $print;
    }
1136107
protected function getBlobMeta($obj)
    {
        $date = $obj->uploadDate->toDateTime();
        $return = [
            'oid'            => (string)$obj->_id,
            'name'           => $obj->filename,
            'content_type'   => (isset($obj->contentType)) ? $obj->contentType : '',
            'content_length' => $obj->length,
            'last_modified'  => $date->format(\DateTime::ATOM),
            'path'           => $obj->filename,
        ];

        return $return;
    }
223638
public function renderBeforeOutline($obj)
    {
        $print = array();
        foreach ($this->rendererList as $name => $renderer) {
            $print[$name] = $renderer->renderBeforeOutline($obj);
        }

        return $print;
    }
84246
public function exportToObj($obj) {
		foreach($this->properties as $k=>$v) {
			if (!is_array($v) && !is_object($v))
			$obj->$k = $v;
		}
	}
624310
public function objectToXml($obj)
    {
        //====================================================================//
        // Create Transmition Object
        $tmp = new stdClass();
        $tmp->SPLASH = $obj;
        //====================================================================//
        // Convert Object to XML Recursively
        $this->objectToXmlCore(self::$xml, $tmp);
        //====================================================================//
        // Put End Element on Xml
        self::$xml->endElement();
        //====================================================================//
        // Output Result
        return self::$xml->outputMemory(true);
    }
235503
private function get_array_value( $obj ) {
		if ( $obj instanceof \stdClass ) {
			$obj = get_object_vars( $obj );
		} elseif ( ! is_array( $obj ) ) {
			if ( method_exists( $obj, 'to_array' ) ) {
				$obj = $obj->to_array();
			}
		}
		if ( ! is_array( $obj ) || empty( $obj ) ) {
			return [];
		}

		return $obj;
	}
719238
public function createAttributeValue($obj)
    {
        if ($obj && !is_object($obj)) {
            $obj = File::getByID($obj);
        }

        $value = new ImageFileValue();
        $value->setFileObject($obj);

        return $value;
    }
572140
public function dump($obj)
    {
        static $ident = 0;

        $str = '';

        if ($obj instanceof Node) {
            $str  .= get_class($obj) . '(' . PHP_EOL;
            $props = get_object_vars($obj);

            foreach ($props as $name => $prop) {
                $ident += 4;
                $str   .= str_repeat(' ', $ident) . '"' . $name . '": '
                      . $this->dump($prop) . ',' . PHP_EOL;
                $ident -= 4;
            }

            $str .= str_repeat(' ', $ident) . ')';
        } elseif (is_array($obj)) {
            $ident += 4;
            $str   .= 'array(';
            $some   = false;

            foreach ($obj as $k => $v) {
                $str .= PHP_EOL . str_repeat(' ', $ident) . '"'
                      . $k . '" => ' . $this->dump($v) . ',';
                $some = true;
            }

            $ident -= 4;
            $str   .= ($some ? PHP_EOL . str_repeat(' ', $ident) : '') . ')';
        } elseif (is_object($obj)) {
            $str .= 'instanceof(' . get_class($obj) . ')';
        } else {
            $str .= var_export($obj, true);
        }

        return $str;
    }
189592
@NullSafe
  public static Class<?> getClass(Object obj) {
    return obj != null ? obj.getClass() : null;
  }
56765
public function postCacheTranslateObject(ModelObject $obj)
    {
        if(strpos($obj->Path, $this->rootPath) === FALSE)
            $obj->setPath($this->rootPath.DIRECTORY_SEPARATOR.$obj->Path);
        return $obj;
    }
361574
public function Equals( $obj )
	{
		if ( ! $obj instanceof GDayValue )
		{
			return false;
		}

		/**
		 * @var DateTimeValueBase $other
		 */
		$other = $obj;
		return $this->ToString( null ) == $other->ToString( null );
	}
338303
public function preCacheTranslateObject(ModelObject $obj)
    {
        // merge aspects
        //$db = $this->getConnection();

//        $q = new Query();
//        $q->select('aspectid');
//        $q->from('elementaspectrel');
//        $q->where("elementid = {$db->quote($obj->{$obj->getPrimaryKey()})}");

//        $aspectIDs = $db->readCol($q);

//        $this->populateRels();

//        $aspectSlugs = array_key_exists($obj->Slug, $this->aspectrel)?$this->aspectrel[$obj->Slug]['Aspects']:array();

        $aspectSlugs = $obj->getAspectSlugs();

        $schema = new NodeSchema();

        if (!empty($aspectSlugs)) {

            $aspects = $this->AspectDAO->multiGetBySlug($aspectSlugs);

            $newAspects = array();
            foreach ($aspects as $aspect) {
//                $plugin = $this->PluginService->getByID($aspect['PluginID']);
//                if(empty($plugin) || !$plugin->isInstalled() || !$plugin->isEnabled())
//                    continue;


                $aspectSchema = $aspect->getSchema();
                foreach ($aspectSchema->getTagDefs() as $tagDef)
                    $schema->addTagDef($tagDef);
                foreach ($aspectSchema->getMetaDefs() as $metaDef)
                    $schema->addMetaDef($metaDef);

                $newAspects[] = $aspect;
            }

            $obj->setAspects($newAspects);

        }

        $obj->setSchema($schema);
        $obj->setAnchoredSite($this->SiteService->getAnchoredSite());
        $obj->setAnchoredSiteSlug($obj->getAnchoredSite()->getSlug());

        return $obj;
    }
11899
public function renderBeforeStep($obj)
    {
        $print = array();
        foreach ($this->rendererList as $name => $renderer) {
            $print[$name] = $renderer->renderBeforeStep($obj);
        }

        return $print;
    }
1324357
public function renderBeforeSuite($obj)
    {
        $print = array();
        foreach ($this->rendererList as $name => $renderer) {
            $print[$name] = $renderer->renderBeforeSuite($obj);
        }

        return $print;
    }
1075984
public static function getProperties($obj)
    {
        $properties = array();
        try {
            $rc = new ReflectionClass($obj);
            do {
                $rp = array();

                // Note that we will not include any properties in traits
                $traits = $rc->getTraits();
                $skipProperties = array();
                if (!empty($traits)) {
                    foreach ($traits as $trait) {
                        foreach ($trait->getProperties() as $traitProperty) {
                            $skipProperties[] = $traitProperty->getName();
                        }
                    }
                }
                /* @var $p \ReflectionProperty */
                foreach ($rc->getProperties() as $p) {
                    if (in_array($p->getName(), $skipProperties, true)) {
                        continue;
                    }
                    $p->setAccessible(true);
                    $rp[$p->getName()] = $p->getValue($obj);
                }
                $properties = array_merge($rp, $properties);
            } while ($rc = $rc->getParentClass());
        } catch (ReflectionException $e) {
            //
        }
        return $properties;
    }
372934
public function renderBeforeFeature($obj)
    {
        $print = array();
        foreach ($this->rendererList as $name => $renderer) {
            $print[$name] = $renderer->renderBeforeFeature($obj);
        }

        return $print;
    }