コード例 #1
0
ファイル: Meta.php プロジェクト: thruthesky/backend
 /**
  * Load an item by 'code'
  * @param $id - is the code
  * @param string $fields
  * @return $this|bool - returns FALSE If there is no record matching.
  * - returns FALSE If there is no record matching.
  * @warning If the key is numeric, then you must use loadBy('code', 123);
  *
  * @code 메타키 삭제 방법
  *      meta('table-name')->load('key')->delete();
  *      meta('table-name')->load(1)->delete();
  * @endcode
  * @Attention $id 가 숫자이면, 필드의 id 값을 바탕으로 로드한다.
  */
 public function load($id, $fields = '*')
 {
     if (is_numeric($id)) {
         return parent::load($id);
     } else {
         return parent::load("code='{$id}'");
     }
 }