Skip to content

Commit

Permalink
Add Post::findOneByGuid()
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitriBouteille committed Jan 29, 2024
1 parent 02869df commit a14ac66
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Models/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,17 @@ public static function findOneByName(?string $name): ?Post
return $model;
}

/**
* @param string $guid
* @return Post|null
*/
public static function findOneByGuid(string $guid): ?Post
{
/** @var Post|null $model */
$model = self::query()->firstWhere(self::GUID, $guid);
return $model;
}

/**
* @return MetaMappingConfig
*/
Expand Down

0 comments on commit a14ac66

Please sign in to comment.