1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-18 09:04:35 +01:00
invoiceninja/app/models/Product.php
Hillel Coren 9dd1b54d4a bug fixes
2013-12-31 11:43:39 +02:00

17 lines
349 B
PHP
Executable File

<?php
class Product extends EntityModel
{
public static function findProductByKey($key)
{
return Product::scope()->where('product_key','=',$key)->first();
}
public static function getProductKeys($products)
{
$products = array_pluck($products, 'product_key');
$products = array_combine($products, $products);
return $products;
}
}