i have two values. one represents a number of objects
$a = $product->count_all();
and the other represents a value from the database:
$first = Model::factory('product')->sale($sale_id)->find();
i need the sum between the two. the second returns the first id that satsfies the query conditions. how can i convert the $first variable to int in kohana or how can i make this sum?? thank you!
Use
$_ignored_columnsfor it:So, you can initialize it
(
$first->count = $a;) and get as amodel column (
$count =).$first->count;
Create special method
get_count()in yourmodel: