src/Collection.php
public function get_model( $pk ) {

		$i = $this->get_model_index( $pk );

		if ( $i === - 1 ) {
			return null;
		}

		return $this->elements[ $i ];
	}
public function get_model( $pk ) {

		$i = $this->get_model_index( $pk );

		if ( $i === - 1 ) {
			return null;
		}

		return $this->elements[ $i ];
	}
Retrieve a model by its primary key.

@since 2.0

@param string|int $pk

@return Model|mixed|null