PHP code example of omatech / lars

1. Go to this page and download the library: Download omatech/lars 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/ */

    

omatech / lars example snippets

 php
public function method()
{
    return $this->query()
                ->get();
}
 php
public class Criteria implements CriteriaInterface
{
    public function apply(Builder $q) : Builder
    {
        return $q->where('role', 'admin');
    }
}
 php
public function method()
{
    return $this->pushCriteria(new FooCriteria)
                ->query()
                ->get();
}
 php
public function method()
{
    return $this->getCriterias();
}
 php
public function method()
{
    return $this->pushCriteria(new FooCriteria)
                ->popCriteria(new FooCriteria)
                ->query()
                ->get();
}
 php
public function method()
{
    return $this->pushCriteria(new FooCriteria)
                ->pushCriteria(new BarCriteria)
                ->resetCriteria()
                ->query()
                ->get();
}
 php
public function __construct()
{
    $this->pushCriteria(new FooCriteria);
}