PHP code example of basel / repository-pipeline
1. Go to this page and download the library: Download basel/repository-pipeline 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/ */
basel / repository-pipeline example snippets
use Basel\RepositoryPipeline\Repository;
$filters = ['id'=>3,'active'=>true];
$products = Repository::get(Product::class, $filters, $perPage = 1);
$product= Repository::find(Product::class, $filters);
$new_product = Repository::create(Product::class, ['name'=>'product','description'=>'description']);
$isUpdated = Repository::update($product,['name'=>'new name','description'=>'new description']);
$isDeleted = Repository::delete($product);