Skip to content

Commit

Permalink
removed ActiveRecord::get()
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Jan 27, 2017
1 parent 193dda0 commit 1ef448c
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions src/ActiveRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,33 +48,6 @@ public function isScenarioDefault()
return $this->scenario === static::SCENARIO_DEFAULT;
}

/**
* Gets a record by its primary key.
*
* @param mixed $primaryKey the primaryKey value
* @param array $options options given in this parameter are passed to API
*
* @return null|static the record instance or null if it was not found
*/
public static function get($primaryKey = null, $options = [])
{
if ($primaryKey === null) {
return null;
}
$command = static::getDb()->createCommand();
$result = $command->get(static::tableName(), $primaryKey, $options);

if ($result) {
$model = static::instantiate($result);
static::populateRecord($model, $result);
$model->afterFind();

return $model;
}

return null;
}

/**
* This method defines the attribute that uniquely identifies a record.
*
Expand Down

0 comments on commit 1ef448c

Please sign in to comment.