original_string: public static function findPk($pk)
      {
          if (empty($pk)) {
              return false;
          }
          if (is_array($pk)) {
              $conditions = '';
              $sep = '';
              foreach ($pk as $name => $value) {
                  $conditions .= $sep . "$name=:$name:";
                  $sep = ' AND ';
              }
              $pk = array(
                  'conditions' => $conditions,
                  'bind' => $pk
              );
          } elseif ($pk instanceof Criteria) {
              $pk = $pk->getParams();
          }
          return static::findFirst($pk);
      }
code: public static function findPk($pk)
      {
          if (empty($pk)) {
              return false;
          }
          if (is_array($pk)) {
              $conditions = '';
              $sep = '';
              foreach ($pk as $name => $value) {
                  $conditions .= $sep . "$name=:$name:";
                  $sep = ' AND ';
              }
              $pk = array(
                  'conditions' => $conditions,
                  'bind' => $pk
              );
          } elseif ($pk instanceof Criteria) {
              $pk = $pk->getParams();
          }
          return static::findFirst($pk);
      }
code_tokens: public static function findPk ( $ pk ) { if ( empty ( $ pk ) ) { return false ; } if ( is_array ( $ pk ) ) { $ conditions = '' ; $ sep = '' ; foreach ( $ pk as $ name => $ value ) { $ conditions .= $ sep . "$name=:$name:" ; $ sep = ' AND ' ; } $ pk = array ( 'conditions' => $ conditions , 'bind' => $ pk ) ; } elseif ( $ pk instanceof Criteria ) { $ pk = $ pk -> getParams ( ) ; } return static :: findFirst ( $ pk ) ; }
docstring: Finds model by primary key
  
  @param string|array
docstring_tokens: Finds model by primary key