Why doesn't this code work? I'm more or lees newbie developing with drupal and now, specifically, I'm trying to create one new entity. I've seen the entity_example given in examples for developers and also I have read this post recomended in the Entity API docs. 

I have understood the basics things. I have created the table for the entity, I have defined de entity with the hook_entity_info(), the links for manage page and create one item of this new entity, etc. And it seems to be fine because when I add one item, i can see it on the database.

The problem is when I try to load the entity data. First of all, I have register the url in the hook_menu().

$items['issue/%gissues_issue'] = array(
'title callback' =&gt; 'gissues_issue_title',
'title arguments' =&gt; array(1),
'page callback' =&gt; 'gissues_issue_view',
'page arguments' =&gt; array(1),
'access arguments' =&gt; array('View Issues'),
'type' =&gt; MENU_CALLBACK,
);


Also, I have created the permissions in hook_permission() and two functions, as I have read in docs, for loading one item or multiple items. I show the code of that functions:

function gissues_issue_load($issue_id = NULL, $reset = FALSE) {
    $issue_ids = (isset($issue_id) ? array($issue_id) : array());
    $issue = gissues_issue_load_multiple($issue_ids, $reset);
    return $issue ? reset($issue) : FALSE;
}

function gissues_issue_load_multiple($issue_ids = array(), $conditions = array(), $reset = FALSE) {
    return entity_load('issue', $issue_ids, $conditions, $reset);
}


When I execute the code, I receive this error message:


  Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 173 of /home/user/public_html/formacion/includes/entity.inc).
  Recoverable fatal error: Object of class stdClass could not be converted to string in DatabaseStatementBase->execute() (line 2168 of /home/user/public_html/formacion/includes/database/database.inc).


I think the entity_load function is not receiving the correct data. The function needs an array with the IDs and it's receiving an array of array. This is what the dpm shows:

  (Array, 1 element)
  0 (Array, 1 element)
    2 (Object) stdClass
      issue_id (String, 1 characters ) 2
      bundle_type (String, 13 characters ) general_issue
      [

    entity data

      ]
      rdf_mapping (Array, 0 elements)


So that, I'm quite lost. May be its something simple or maybe not, but I can't figure out what I'm doing wrong o what i'm forgetting to do. 

Any help would be appreciated.
If your module name is

gissue_issue

Then you could have a hook namespace collision with 

hook_load

In which case the $nodes parameter is being passed to your load function as well.

Just a possibility to consider.