src/ngrest/base/Api.php
public function findModelClassObject($modelClass, $id, $relationContext)
    {
        $keys = $modelClass::primaryKey();
        if (count($keys) > 1) {
            $values = explode(',', $id);
            if (count($keys) === count($values)) {
                return $this->findModelFromCondition(array_combine($keys, $values), $keys, $modelClass, $relationContext);
            }
        } elseif ($id !== null) {
            return $this->findModelFromCondition($id, $keys, $modelClass, $relationContext);
        }

        return false;
    }
public function findModelClassObject($modelClass, $id, $relationContext)
    {
        $keys = $modelClass::primaryKey();
        if (count($keys) > 1) {
            $values = explode(',', $id);
            if (count($keys) === count($values)) {
                return $this->findModelFromCondition(array_combine($keys, $values), $keys, $modelClass, $relationContext);
            }
        } elseif ($id !== null) {
            return $this->findModelFromCondition($id, $keys, $modelClass, $relationContext);
        }

        return false;
    }
public function findModelClassObject ( $ modelClass , $ id , $ relationContext ) { $ keys = $ modelClass :: primaryKey ( ) ; if ( count ( $ keys ) > 1 ) { $ values = explode ( ',' , $ id ) ; if ( count ( $ keys ) === count ( $ values ) ) { return $ this -> findModelFromCondition ( array_combine ( $ keys , $ values ) , $ keys , $ modelClass , $ relationContext ) ; } } elseif ( $ id !== null ) { return $ this -> findModelFromCondition ( $ id , $ keys , $ modelClass , $ relationContext ) ; } return false ; }
Find the model for a given class and id.

@param [type] $modelClass
@param [type] $id
@return void
Find the model for a given class and id .