Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan-Hendrik Willms
Stud.IP
Commits
30a916c2
Commit
30a916c2
authored
2 years ago
by
Jan-Hendrik Willms
Committed by
David Siegfried
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
improve SORM docblocks, fixes #2514
Closes #2514 Merge request
studip/studip!1703
parent
b1144a98
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/models/SimpleORMap.class.php
+5
-6
5 additions, 6 deletions
lib/models/SimpleORMap.class.php
lib/models/SimpleORMapCollection.class.php
+9
-7
9 additions, 7 deletions
lib/models/SimpleORMapCollection.class.php
with
14 additions
and
13 deletions
lib/models/SimpleORMap.class.php
+
5
−
6
View file @
30a916c2
...
...
@@ -473,7 +473,7 @@ class SimpleORMap implements ArrayAccess, Countable, IteratorAggregate
/**
* Returns true if given key exists in the database.
*
* @param string $id primary key
* @param string
|array
$id primary key
* @return boolean
*/
public
static
function
exists
(
$id
)
...
...
@@ -621,7 +621,7 @@ class SimpleORMap implements ArrayAccess, Countable, IteratorAggregate
* returns array of instances of given class filtered by given sql
* @param string $sql sql clause to use on the right side of WHERE
* @param ?array $params parameters for query
* @return
array
array of "self" objects
* @return
static[]
array of "self" objects
*/
public
static
function
findBySQL
(
$sql
,
$params
=
[])
{
...
...
@@ -672,7 +672,7 @@ class SimpleORMap implements ArrayAccess, Countable, IteratorAggregate
*
* @param string $foreign_key_value value of foreign key to find related records
* @param array $options relation options from other side of relation
* @return array of "self" objects
* @return
static[]
array of "self" objects
*/
public
static
function
findThru
(
$foreign_key_value
,
$options
)
{
...
...
@@ -754,7 +754,7 @@ class SimpleORMap implements ArrayAccess, Countable, IteratorAggregate
* @param ?array $pks array of primary keys
* @param ?string $order order by clause
* @param ?array $order_params
* @return
array
* @return
static[]
*/
public
static
function
findMany
(
$pks
=
[],
$order
=
''
,
$order_params
=
[])
{
...
...
@@ -888,7 +888,7 @@ class SimpleORMap implements ArrayAccess, Countable, IteratorAggregate
* @param string $name
* @param array $arguments
* @throws BadMethodCallException
* @return
mixed
* @return
int|static|static[]
*/
public
static
function
__callStatic
(
$name
,
$arguments
)
{
...
...
@@ -1243,7 +1243,6 @@ class SimpleORMap implements ArrayAccess, Countable, IteratorAggregate
}
return
true
;
}
return
false
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
lib/models/SimpleORMapCollection.class.php
+
9
−
7
View file @
30a916c2
...
...
@@ -14,6 +14,8 @@
* @category Stud.IP
*
* @extends SimpleCollection<SimpleORMap>
*
* @template T of SimpleORMap
*/
class
SimpleORMapCollection
extends
SimpleCollection
{
...
...
@@ -45,9 +47,9 @@ class SimpleORMapCollection extends SimpleCollection
* all objects should be of the same type
*
* @throws InvalidArgumentException if first entry is not SimpleOrMap
* @param
array<?SimpleORMap>
$data array with SimpleORMap objects
* @param
T[]
$data array with SimpleORMap objects
* @param bool $strict check every element for correct type and unique pk
* @return SimpleORMapCollection
* @return SimpleORMapCollection
<T>
*/
public
static
function
createFromArray
(
array
$data
,
$strict
=
true
)
{
...
...
@@ -73,9 +75,9 @@ class SimpleORMapCollection extends SimpleCollection
/**
* Constructor
*
* @param ?Closure $finder callable to fill collection
* @param ?array $options relationship options
* @param
?
SimpleORMap $record related record
* @param ?Closure
$finder
callable to fill collection
* @param ?array
$options relationship options
* @param SimpleORMap
|null
$record
related record
*/
public
function
__construct
(
Closure
$finder
=
null
,
array
$options
=
null
,
SimpleORMap
$record
=
null
)
{
...
...
@@ -175,7 +177,7 @@ class SimpleORMapCollection extends SimpleCollection
* returns element with given primary key value
*
* @param string $value primary key value to search for
* @return ?
SimpleORMap
* @return ?
T
*/
public
function
find
(
$value
)
{
...
...
@@ -217,7 +219,7 @@ class SimpleORMapCollection extends SimpleCollection
* internal deleted collection
*
* @param string $id primary key of element
* @return number of unsetted elements
* @return
int
number of unsetted elements
*/
public
function
unsetByPk
(
$id
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment