PHP code example of devgroup / yii2-tag-dependency-helper
1. Go to this page and download the library: Download devgroup/yii2-tag-dependency-helper library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
devgroup / yii2-tag-dependency-helper example snippets
/**
* Finds or creates new model using or not using cache(objectTag is applied, not commonTag!)
* @param string|int $id ID of model to find
* @param bool $createIfEmptyId Create new model instance(record) if id is empty
* @param bool $useCache Use cache
* @param int $cacheLifetime Cache lifetime in seconds
* @param bool|\Exception $throwException False or exception instance to throw if model not found or (empty id AND createIfEmptyId==false)
* @return \yii\db\ActiveRecord|null|self|TagDependencyTrait
* @throws \Exception
*/
public static function loadModel(
$id,
$createIfEmptyId = false,
$useCache = true,
$cacheLifetime = 86400,
$throwException = false
)
{
}