src/Mvc/Model.php
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);
    }
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);
    }
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 ) ; }
Finds model by primary key

@param string|array
Finds model by primary key