@inheritdoc

@SuppressWarnings(PHPMD.StaticAccess)
773745
public function apply()
    {
        Schema::create(Model::TABLE_NAME, function (Blueprint $table) {
            $table->unsignedInteger(Model::FIELD_ID);
            $table->string(Model::FIELD_NAME, Model::LENGTH_NAME);
            $table->timestamps();

            $table->primary(Model::FIELD_ID);
        });
    }
107062
function modify( $tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters, $placement )
    {
        $dom = $namedParameters['dom'];
        if ( $dom instanceof eZContentObjectAttribute )
        {
            $this->ObjectAttributeId = $dom->attribute( 'id' );
            $content = $dom->attribute( 'content' );
            $xmlData = $content->attribute( 'xml_data' );

            $domTree = new DOMDocument( '1.0', 'utf-8' );
            $domTree->preserveWhiteSpace = false;
            $success = $domTree->loadXML( $xmlData );

            $tocText = '';
            if ( $success )
            {
                $this->HeaderCounter = array();
                $this->LastHeaderLevel = 0;

                $rootNode = $domTree->documentElement;
                $tocText .= $this->handleSection( $rootNode );

                while ( $this->LastHeaderLevel > 0 )
                {
                    $tocText .= "</li>\n</ul>\n";
                    $this->LastHeaderLevel--;
                }
            }
        }
        $operatorValue = $tocText;
    }
653820
public function getFieldTypes()
    {
        static $cached = [];

        $class = static::class;

        if (!isset($cached[$class])) {
            if (!$doc = static::sample()) {

                if (!$docs = $this->getConnection()->fetchAll($this->getSource(), [], ['limit' => 1])) {
                    throw new RuntimeException(['`:collection` collection has none record', 'collection' => $this->getSource()]);
                }
                $doc = $docs[0];
            }

            $types = [];
            foreach ($doc as $field => $value) {
                $type = gettype($value);
                if ($type === 'integer') {
                    $types[$field] = 'int';
                } elseif ($type === 'string') {
                    $types[$field] = 'string';
                } elseif ($type === 'double') {
                    $types[$field] = 'float';
                } elseif ($type === 'boolean') {
                    $types[$field] = 'bool';
                } elseif ($type === 'array') {
                    $types[$field] = 'array';
                } elseif ($value instanceof ObjectID) {
                    if ($field === '_id') {
                        continue;
                    }
                    $types[$field] = 'objectid';
                } else {
                    throw new RuntimeException(['`:field` field value type can not be infered.', 'field' => $field]);
                }
            }

            $cached[$class] = $types;
        }

        return $cached[$class];
    }
761335
function &_allItems(&$rootDoc)
    {
        ob_start();

        echo '<body id="frame">', "\n\n";

        echo "<h1>All Items</h1>\n\n";

        $classes =& $rootDoc->classes();
        if ($classes) {
            ksort($classes);
            echo "<h2>Classes</h2>\n";
            echo "<ul>\n";
            foreach ($classes as $name => $class) {
                $package =& $classes[$name]->containingPackage();
                if ($class->isInterface()) {
                    echo '<li><em><a href="', $classes[$name]->asPath(), '" title="', $classes[$name]->packageName(),'" target="main">', $classes[$name]->name(), "</a></em></li>\n";
                } elseif ($class->isTrait()) {
                    echo '<li><em><a href="', $classes[$name]->asPath(), '" title="', $classes[$name]->packageName(),'" target="main">', $classes[$name]->name(), "</a></em></li>\n";
                } else {
                    echo '<li><a href="', $classes[$name]->asPath(), '" title="', $classes[$name]->packageName(),'" target="main">', $classes[$name]->name(), "</a></li>\n";
                }
            }
            echo "</ul>\n\n";
        }

        $functions =& $rootDoc->functions();
        if ($functions) {
            ksort($functions);
            echo "<h2>Functions</h2>\n";
            echo "<ul>\n";
            foreach ($functions as $name => $function) {
                $package =& $functions[$name]->containingPackage();
                echo '<li><a href="', $package->asPath(), '/package-functions.html#', $functions[$name]->name(), '()" title="', $functions[$name]->packageName(),'" target="main">', $functions[$name]->name(), "</a></li>\n";
            }
            echo "</ul>\n\n";
        }

        $globals =& $rootDoc->globals();
        if ($globals) {
            ksort($globals);
            echo "<h2>Globals</h2>\n";
            echo "<ul>\n";
            foreach ($globals as $name => $global) {
                $package =& $globals[$name]->containingPackage();
                echo '<li><a href="', $package->asPath(), '/package-globals.html#', $globals[$name]->name(), '" title="', $globals[$name]->packageName(),'" target="main">', $globals[$name]->name(), "</a></li>\n";
            }
            echo "</ul>\n\n";
        }

        echo '</body>', "\n\n";

        $output = ob_get_contents();
        ob_end_clean();

        return $output;
    }
38613
static function set() {
		$info = debug_backtrace();
		self::$data[] = [
			'time' => time(),
			'microtime' => microtime(true),
			'text' => (count($info[0]['args']) ? $info[0]['args'] : '' ),
			'file' => $info[0]['file'],
			'line' => $info[0]['line'],
		];
    }
992718
public function execute()
	{
		$this->connect();

		if (!is_resource($this->connection))
		{
			$this->log(
				Log\LogLevel::ERROR,
				'Database query failed (error #{code}): {message}',
				array('code' => $this->errorNum, 'message' => $this->errorMsg)
			);
			throw new \RuntimeException($this->errorMsg, $this->errorNum);
		}

		// Take a local copy so that we don't modify the original query and cause issues later
		$sql = $this->replacePrefix((string) $this->sql);

		if ($this->limit > 0 || $this->offset > 0)
		{
			$sql = $this->limit($sql, $this->limit, $this->offset);
		}

		// Increment the query counter.
		$this->count++;

		// If debugging is enabled then let's log the query.
		if ($this->debug)
		{
			// Add the query to the object queue.
			$this->log(
				Log\LogLevel::DEBUG,
				'{sql}',
				array('sql' => $sql, 'category' => 'databasequery', 'trace' => debug_backtrace())
			);
		}

		// Reset the error values.
		$this->errorNum = 0;
		$this->errorMsg = '';

		// SQLSrv_num_rows requires a static or keyset cursor.
		if (strncmp(ltrim(strtoupper($sql)), 'SELECT', strlen('SELECT')) == 0)
		{
			$array = array('Scrollable' => SQLSRV_CURSOR_KEYSET);
		}
		else
		{
			$array = array();
		}

		// Execute the query. Error suppression is used here to prevent warnings/notices that the connection has been lost.
		$this->cursor = @sqlsrv_query($this->connection, $sql, array(), $array);

		// If an error occurred handle it.
		if (!$this->cursor)
		{
			// Check if the server was disconnected.
			if (!$this->connected())
			{
				try
				{
					// Attempt to reconnect.
					$this->connection = null;
					$this->connect();
				}
				catch (\RuntimeException $e)
				// If connect fails, ignore that exception and throw the normal exception.
				{
					// Get the error number and message.
					$errors = sqlsrv_errors();
					$this->errorNum = $errors[0]['SQLSTATE'];
					$this->errorMsg = $errors[0]['message'] . 'SQL=' . $sql;

					// Throw the normal query exception.
					$this->log(
						Log\LogLevel::ERROR,
						'Database query failed (error #{code}): {message}',
						array('code' => $this->errorNum, 'message' => $this->errorMsg)
					);
					throw new \RuntimeException($this->errorMsg, $this->errorNum);
				}

				// Since we were able to reconnect, run the query again.
				return $this->execute();
			}
			else
			// The server was not disconnected.
			{
				// Get the error number and message.
				$errors = sqlsrv_errors();
				$this->errorNum = $errors[0]['SQLSTATE'];
				$this->errorMsg = $errors[0]['message'] . 'SQL=' . $sql;

				// Throw the normal query exception.
				$this->log(
					Log\LogLevel::ERROR,
					'Database query failed (error #{code}): {message}',
					array('code' => $this->errorNum, 'message' => $this->errorMsg)
				);
				throw new \RuntimeException($this->errorMsg, $this->errorNum);
			}
		}

		return $this->cursor;
	}
474253
public function getValueFromFieldDescription(
        $object,
        FieldDescriptionInterface $fieldDescription,
        array $params = []
    ) {
        if (isset($params['loop']) && $object instanceof \ArrayAccess) {
            throw new \RuntimeException('remove the loop requirement');
        }

        $value = null;

        try {
            $value = $fieldDescription->getValue($object);
        } catch (NoValueException $e) {
            if ($fieldDescription->getAssociationAdmin()) {
                $value = $fieldDescription->getAssociationAdmin()->getNewInstance();
            }
        }

        return $value;
    }
718494
public function indexAction()
    {
        $request = $this->getRequest();
        $type    = $request->getParam( 'type' );

        if ( ! $request instanceof ConsoleRequest )
        {
            throw new \RuntimeException( sprintf(
                '%s can only be used from a console.',
                __METHOD__
            ) );
        }

        $phpSelf = realpath( static::PHP_SELF );

        if ( empty( $phpSelf ) || ! is_file( $phpSelf ) )
        {
            throw new \RuntimeException( sprintf(
                '%s: php not found at "%s" (in "%s").',
                __METHOD__,
                static::PHP_SELF,
                getcwd()
            ) );
        }

        $result = 'Running ' . $type . ' cron(s) ...' . PHP_EOL . PHP_EOL;

        foreach ( $this->mimicSiteInfos() as $siteInfo )
        {
            $domain  = $siteInfo->getDomain();
            $process = new Process( array(
                'command'   => 'php',
                'arguments' => array(
                    $phpSelf,
                    'cron',
                    $domain,
                    $type,
                ),
                'environmentVariables'  => array(
                    'GRIDGUYZ_HOST'     => $domain,
                    'HTTP_HOST'         => $domain,
                ),
            ) );

            $result .= 'Calling process ...' . PHP_EOL .
                       $process->getRunCommand() . PHP_EOL;

            $output = tempnam( './data/', $domain );
            $descr  = array( Process::TYPE_FILE, $output, Process::MODE_APPEND );
            file_put_contents( $output, '' );

            $process->open( array(
                Process::STREAM_STDOUT => $descr,
                Process::STREAM_STDERR => $descr,
            ) );

            $return     = $process->close();
            $messages   = rtrim( file_get_contents( $output ), PHP_EOL );
            unlink( $output );

            if ( $messages )
            {
                $result .= static::PADDING . preg_replace(
                    '/[' . PHP_EOL . ']+/',
                    '$0' . static::PADDING,
                    $messages
                ) . PHP_EOL;
            }

            $result .= sprintf(
                'Process returned with #%d: %s' . PHP_EOL . PHP_EOL,
                $return,
                $return ? 'error!' : 'success.'
            );
        }

        $result .= 'Done.' . PHP_EOL;
        return $result;
    }
821186
public static function filter(&$object, array $fields, $mode = 'allow')
    {
        if('allow' === $mode)
        {
            $unsetKeys = [];
            foreach($object as $field => $value)
            {
                if(!in_array($field, $fields))
                {
                    $unsetKeys[] = $field;
                }
            }
            foreach($unsetKeys as $key)
            {
                static::remove($object, $key);
            }
        }
        else if('deny' === $mode)
        {
            foreach($fields as $field)
            {
                static::remove($object, $field);
            }
        }
        else
        {
            throw new \InvalidArgumentException(sprintf('Unknow mode %s', $mode));
        }
    }
1141681
public function when(/* see docblock */)
    {
        $arguments = func_get_args();
        if ($arguments[0] instanceof Antecedent) {
            $antecedent = $arguments[0];
        } elseif ($arguments[0] instanceof PHPUnit_Framework_Constraint) {
            $antecedent = Antecedent\IndependentConstraintsAntecedent::fromAll($arguments);
        } elseif ($arguments[0] instanceof Constraint) {
            $antecedent = Antecedent\IndependentConstraintsAntecedent::fromAll($arguments);
        } elseif ($arguments && count($arguments) == 1) {
            $antecedent = Antecedent\SingleCallbackAntecedent::from($arguments[0]);
        } else {
            throw new \InvalidArgumentException("Invalid call to when(): " . var_export($arguments, true));
        }
        $this->antecedents[] = $antecedent;
        return $this;
    }
466270
private function setObjectValue(&$object, FieldDefinition $fieldDefinition, $value): void
    {
        //using setter
        $accessor = new PropertyAccessor();
        $propertyName = $fieldDefinition->getOriginName();
        if (\is_array($object)) {
            $object[$propertyName ?? $fieldDefinition->getName()] = $value;
        } else {
            if ($accessor->isWritable($object, $propertyName)) {
                $accessor->setValue($object, $propertyName, $value);
            } else {
                //using reflection
                $refClass = new \ReflectionClass(\get_class($object));
                if ($refClass->hasProperty($object) && $property = $refClass->getProperty($object)) {
                    $property->setAccessible(true);
                    $property->setValue($object, $value);
                }
            }
        }
    }
499384
static function executeActions()
    {
        if ( empty( self::$actionList ) )
        {
            return;
        }

        $fileContentCache = array();
        $doneDestList = array();

        $ini = eZINI::instance( 'staticcache.ini');
        $clearByCronjob = ( $ini->variable( 'CacheSettings', 'CronjobCacheClear' ) == 'enabled' );

        if ( $clearByCronjob )
        {
            $db = eZDB::instance();
        }

        foreach ( self::$actionList as $action )
        {
            list( $action, $parameters ) = $action;

            switch( $action ) {
                case 'store':
                    list( $destination, $source ) = $parameters;

                    if ( isset( $doneDestList[$destination] ) )
                        continue 2;

                    if ( $clearByCronjob )
                    {
                        $param = $db->escapeString( $destination . ',' . $source );
                        $db->query( 'INSERT INTO ezpending_actions( action, param ) VALUES ( \'static_store\', \''. $param . '\' )' );
                        $doneDestList[$destination] = 1;
                    }
                    else
                    {
                        if ( !isset( $fileContentCache[$source] ) )
                        {
                            if ( eZHTTPTool::getDataByURL( $source, true, eZStaticCache::USER_AGENT ) )
                                $fileContentCache[$source] = eZHTTPTool::getDataByURL( $source, false, eZStaticCache::USER_AGENT );
                            else
                                $fileContentCache[$source] = false;
                        }
                        if ( $fileContentCache[$source] === false )
                        {
                            eZDebug::writeError( "Could not grab content (from $source), is the hostname correct and Apache running?", 'Static Cache' );
                        }
                        else
                        {
                            eZStaticCache::storeCachedFile( $destination, $fileContentCache[$source] );
                            $doneDestList[$destination] = 1;
                        }
                    }
                    break;
            }
        }
        self::$actionList = array();
    }
291012
public function run()
	{
		list($name,$id)=$this->resolveNameID();
		if(isset($this->htmlOptions['id']))
			$id=$this->htmlOptions['id'];
		else
			$this->htmlOptions['id']=$id;

		$isRange=isset($this->options['range']) && $this->options['range'] &&
			$this->options['range']!=='max' && $this->options['range']!=='min';

		if($this->hasModel())
		{
			$attribute=$this->attribute;
			if($isRange)
			{
				$options=$this->htmlOptions;
				echo CHtml::activeHiddenField($this->model,$this->attribute,$options);
				$options['id'].=$this->maxIdSuffix;
				echo CHtml::activeHiddenField($this->model,$this->maxAttribute,$options);
				$maxAttribute=$this->maxAttribute;
				$this->options['values']=array($this->model->$attribute,$this->model->$maxAttribute);
			}
			else
			{
				echo CHtml::activeHiddenField($this->model,$this->attribute,$this->htmlOptions);
				$this->options['value']=$this->model->$attribute;
			}
		}
		else
		{
			if($isRange)
			{
				list($maxName,$maxId)=$this->resolveNameID('maxName','maxAttribute');
				$options=$this->htmlOptions;
				echo CHtml::hiddenField($name,$this->value,$options);
				$options['id'].=$this->maxIdSuffix;
				echo CHtml::hiddenField($maxName,$this->maxValue,$options);
				$this->options['values']=array($this->value,$this->maxValue);
			}
			else
			{
				echo CHtml::hiddenField($name,$this->value,$this->htmlOptions);
				if($this->value!==null)
					$this->options['value']=$this->value;
			}
		}

		$idHidden=$this->htmlOptions['id'];
		$this->htmlOptions['id']=$idHidden.'_slider';
		echo CHtml::tag($this->tagName,$this->htmlOptions,'');

		$this->options[$this->event]=$isRange
			? new CJavaScriptExpression("function(e,ui){ v=ui.values; jQuery('#{$idHidden}').val(v[0]); jQuery('#{$idHidden}{$this->maxIdSuffix}').val(v[1]); }")
			: new CJavaScriptExpression("function(event, ui) { jQuery('#{$idHidden}').val(ui.value); }");

		$options=CJavaScript::encode($this->options);
		Yii::app()->getClientScript()->registerScript(__CLASS__.'#'.$id,"jQuery('#{$id}_slider').slider($options);");
	}
257926
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

        /** @var PaymentInterface $payment */
        $payment = $request->getSource();

        $model = ArrayObject::ensureArrayObject($payment->getDetails());

        if (false == $model['reference']) {
            $model['reference'] = $payment->getNumber();
        }
        if (false == $model['amount']) {
            $this->gateway->execute($currency = new GetCurrency($payment->getCurrencyCode()));
            $amount = (string)$payment->getTotalAmount();

            if (0 < $currency->exp) {
                $divisor = pow(10, $currency->exp);

                $amount = (string)round($amount / $divisor, $currency->exp);
                if (false !== $pos = strpos($amount, '.')) {
                    $amount = str_pad($amount, $pos + 1 + $currency->exp, '0', STR_PAD_RIGHT);
                }
            }

            $model['amount'] = $amount;
            $model['currency'] = (string)strtoupper($currency->code);
        }
        if (false == $model['email']) {
            $model['email'] = $payment->getClientEmail();
        }
        if (false == $model['comment']) {
            $model['comment'] = 'Customer: ' . $payment->getClientId();
        }

        $request->setResult((array)$model);
    }
638908
protected function execute()
    {
        $result = false;

        $service = $this->getSubmittedValue('service');
        $source = $this->submittedSource;
        switch ($service) {
            case 'invoice_add':
                $forceSend = (bool) $this->getSubmittedValue('value');
                $result = $this->invoiceManager->send1($source, $forceSend);
                break;

            case 'invoice_paymentstatus_set':
                $localEntryInfo = $this->acumulusEntryManager->getByInvoiceSource($source);
                if ($localEntryInfo) {
                    if ((int) $this->getSubmittedValue('value') === Api::PaymentStatus_Paid) {
                        $paymentStatus = Api::PaymentStatus_Paid;
                        $dateFieldName = $this->getIdPrefix($this->submittedSource) . 'payment_date';
                        $paymentDate = $this->submittedValues[$dateFieldName];
                    } else {
                        $paymentStatus = Api::PaymentStatus_Due;
                        $paymentDate = '';
                    }
                    $result = $this->service->setPaymentStatus($localEntryInfo->getToken(), $paymentStatus, $paymentDate);
                } else {
                    $this->addErrorMessages(sprintf($this->t('unknown_entry'),
                        strtolower($this->t($this->submittedSource->getType())),
                        $this->submittedSource->getId()
                    ));
                }
                break;

            case 'entry_deletestatus_set':
                $localEntryInfo = $this->acumulusEntryManager->getByInvoiceSource($source);
                if ($localEntryInfo) {
                    $deleteStatus = $this->getSubmittedValue('value') === Api::Entry_Delete ? Api::Entry_Delete : Api::Entry_UnDelete;
                    $result = $this->service->setDeleteStatus($localEntryInfo->getEntryId(), $deleteStatus);
                } else {
                    $this->addErrorMessages(sprintf($this->t('unknown_entry'),
                    strtolower($this->t($this->submittedSource->getType())),
                        $this->submittedSource->getId()
                    ));
                }
                break;

            default:
                $this->addErrorMessages(sprintf($this->t('unknown_action'), $service));
                break;
        }

        return $result;
    }
420324
function todoWriter(&$doclet) {

        parent::MDWriter($doclet);

        $rootDoc = & $this->_doclet->rootDoc();

        $todoClasses = array();
        $classes = & $rootDoc->classes();
        $todoFields = array();
        $todoMethods = array();
        if ($classes) {
            foreach ($classes as $class) {
                if ($class->tags("@todo")) {
                    $todoClasses[] = $class;
                }
                $fields = & $class->fields();
                if ($fields) {
                    foreach ($fields as $field) {
                        if ($field->tags("@todo")) {
                            $todoFields[] = $field;
                        }
                    }
                }
                $classes = & $class->methods();
                if ($classes) {
                    foreach ($classes as $method) {
                        if ($method->tags("@todo")) {
                            $todoMethods[] = $method;
                        }
                    }
                }
            }
        }
        $todoGlobals = array();
        $globals = & $rootDoc->globals();
        if ($globals) {
            foreach ($globals as $global) {
                if ($global->tags("@todo")) {
                    $todoGlobals[] = $global;
                }
            }
        }
        $todoFunctions = array();
        $functions = & $rootDoc->functions();
        if ($functions) {
            foreach ($functions as $function) {
                if ($function->tags("@todo")) {
                    $todoFunctions[] = $function;
                }
            }
        }

        ob_start();

        echo "- - -\n\n";

        echo "#Todo#";

        echo "\n\n- - -\n\n";

        if ($todoClasses || $todoFields || $todoMethods || $todoGlobals || $todoFunctions) {
            echo "##Contents##\n\n";

            echo "<ul>\n";
            if ($todoClasses) {
                echo "<li><a href=\"#todo_class\">Todo Classes</a></li>";
            }
            if ($todoFields) {
                echo "<li><a href=\"#todo_field\">Todo Fields</a></li>";
            }
            if ($todoMethods) {
                echo "<li><a href=\"#todo_method\">Todo Methods</a></li>";
            }
            if ($todoGlobals) {
                echo "<li><a href=\"#todo_global\">Todo Globals</a></li>";
            }
            if ($todoFunctions) {
                echo "<li><a href=\"#todo_function\">Todo Functions</a></li>";
            }
            echo "</ul>\n";
        }

        if ($todoClasses) {
            echo "<table id=\"todo_class\" class=\"detail\">", "\n";
            echo "<tr><th colspan=\"2\" class=\"title\">Todo Classes</th></tr>", "\n";
            foreach ($todoClasses as $class) {
                $todoTag = & $class->tags("@todo");
                echo "<tr><td class=\"name\"><a href=\"", $this->_asURL($class), "\">", $class->qualifiedName(), "</a></td>";
                echo "<td class=\"description\">";
                if ($todoTag)
                    echo strip_tags($this->_processInlineTags($todoTag, TRUE), "<a><b>**<u><em>");
                echo "</td></tr>\n";
            }
            echo "</table>\n\n";
        }

        if ($todoFields) {
            echo "<table id=\"todo_field\" class=\"detail\">", "\n";
            echo "<tr><th colspan=\"2\" class=\"title\">Todo Fields</th></tr>", "\n";
            foreach ($todoFields as $field) {
                $todoTag = & $field->tags("@todo");
                echo "<tr>\n";
                echo "<td class=\"name\"><a href=\"", $this->_asURL($field), "\">", $field->qualifiedName(), "</a></td>\n";
                echo "<td class=\"description\">";
                if ($todoTag)
                    echo strip_tags($this->_processInlineTags($todoTag, TRUE), "<a><b>**<u><em>");
                echo "</td>\n";
                echo "</tr>\n";
            }
            echo "</table>\n\n";
        }

        if ($todoMethods) {
            echo "<table id=\"todo_method\" class=\"detail\">", "\n";
            echo "<tr><th colspan=\"2\" class=\"title\">Todo Methods</th></tr>", "\n";
            foreach ($todoMethods as $method) {
                $todoTag = & $method->tags("@todo");
                echo "<tr>\n";
                echo "<td class=\"name\"><a href=\"", $this->_asURL($method), "\">", $method->qualifiedName(), "</a></td>\n";
                echo "<td class=\"description\">";
                if ($todoTag)
                    echo strip_tags($this->_processInlineTags($todoTag, TRUE), "<a><b>**<u><em>");
                echo "</td>\n";
                echo "</tr>\n";
            }
            echo "</table>\n\n";
        }

        if ($todoGlobals) {
            echo "<table id=\"todo_global\" class=\"detail\">", "\n";
            echo "<tr><th colspan=\"2\" class=\"title\">Todo Globals</th></tr>", "\n";
            foreach ($todoGlobals as $global) {
                $todoTag = & $global->tags("@todo");
                echo "<tr>\n";
                echo "<td class=\"name\"><a href=\"", $this->_asURL($global), "\">", $global->qualifiedName(), "</a></td>\n";
                echo "<td class=\"description\">";
                if ($todoTag)
                    echo strip_tags($this->_processInlineTags($todoTag, TRUE), "<a><b>**<u><em>");
                echo "</td>\n";
                echo "</tr>\n";
            }
            echo "</table>\n\n";
        }

        if ($todoFunctions) {
            echo "<table id=\"todo_function\" class=\"detail\">", "\n";
            echo "<tr><th colspan=\"2\" class=\"title\">Todo Functions</th></tr>", "\n";
            foreach ($todoFunctions as $function) {
                $todoTag = & $function->tags("@todo");
                echo "<tr>\n";
                echo "<td class=\"name\"><a href=\"", $this->_asURL($function), "\">", $function->qualifiedName(), "</a></td>\n";
                echo "<td class=\"description\">";
                if ($todoTag)
                    echo strip_tags($this->_processInlineTags($todoTag, TRUE), "<a><b>**<u><em>");
                echo "</td>\n";
                echo "</tr>\n";
            }
            echo "</table>\n\n";
        }

        $this->_output = ob_get_contents();
        ob_end_clean();

        $this->_write("todo-list.md");
    }
1318578
public function find($id = NULL)
    {
        if ($id !== NULL)
        {
            $data             = $this->getData();
            $this->currentId  = $id;
            $this->currentKey = $this->getRowKey($id);
            foreach ($data[$this->currentKey] as $field => $value)
            {
                $this->setField($field, $value);
            }
        }
        else
        {
            $this->limit(1)->findAll();
            $data = $this->data;
            if (count($data))
            {
                foreach ($data[0] as $field => $value)
                {
                    $this->setField($field, $value);
                }

                $this->currentId  = $this->getField('id');
                $this->currentKey = $this->getRowKey($this->currentId);
            }
        }
        return clone $this;
    }