From 1ef448cd54db08b8a689e41211da5803a2020450 Mon Sep 17 00:00:00 2001 From: Andrii Vasyliev Date: Fri, 27 Jan 2017 16:49:04 +0000 Subject: [PATCH] removed `ActiveRecord::get()` --- src/ActiveRecord.php | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/src/ActiveRecord.php b/src/ActiveRecord.php index e9e0667..1c88c32 100644 --- a/src/ActiveRecord.php +++ b/src/ActiveRecord.php @@ -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. *