I got something "working" for my purposes, let me know if there is a better way.
1) Make the sql create a temporary table.
CREATE TEMPORARY TABLE IF NOT EXISTS temp_compiled_properties AS
(SELECT
item_id,
MAX(IF(property_name = 'color', value, NULL)) AS color,
MAX(IF(property_name = 'size', value, NULL)) AS size,
...
...
...
FROM
properties
GROUP BY
item_id);
2) Create a Model
//this is not a typical ORM model and cannot be accessed as such
//You must first run the init function before data can be accesses
//You can read data from the model, other methods may work, but not all ORM functions have been tested with this model.
class Model_Properties_Pivot extends \Orm\Model
{
//--------------------------------------
//Table Details
//--------------------------------------
protected static $_table_name = 'temp_compiled_properties';
protected static $_primary_key = array('item_id');
//dont define properties, ORM will automatically query the temp table to get these
//protected static $_properties = array();
public static function init($game_id)
{
$sql = "CREATE TEMPORARY TABLE IF NOT EXISTS temp_compiled_properties AS
(SELECT
item_id,
MAX(IF(property_name = 'color', value, NULL)) AS color,
MAX(IF(property_name = 'size', value, NULL)) AS size,
...
...
...
FROM
properties
GROUP BY
item_id)";
DB::query($sql)->execute();
}
3) Read the data in the Model
Model_Properties_Pivot::init(14);
$all_data = Model_Properties_Pivot::query()->get();
Also, I looked into EAV and got it working. Issue is my "attribute" field is actually another foreign key (auto increment number). That means I'm unable to use it since it's an auto increment number. Basically, I can't access it like this $properties->10