id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
sequence
docstring
stringlengths
3
47.2k
docstring_tokens
sequence
sha
stringlengths
40
40
url
stringlengths
91
247
6,800
silverorange/Net_Notifier
Net/Notifier/WebSocket/Handshake.php
Net_Notifier_WebSocket_Handshake.receiveClientHandshake
protected function receiveClientHandshake( array $headers, array $supportedProtocols ) { if (!isset($headers['Host'])) { $response = "HTTP/1.1 400 Bad Request\r\n" . "X-WebSocket-Message: Client request Host header is " . "missing.\r\n"; } elseif ( !isset($headers['Upgrade']) || !in_array('websocket', $this->parseHeaderValue($headers['Upgrade'])) ) { $response = "HTTP/1.1 400 Bad Request\r\n" . "X-WebSocket-Message: Client request Upgrade header is " . "missing or does not contain the 'websocket' product.\r\n"; } elseif ( !isset($headers['Connection']) || !in_array('upgrade', $this->parseHeaderValue($headers['Connection'])) ) { $response = "HTTP/1.1 400 Bad Request\r\n" . "X-WebSocket-Message: Client request Connection header is " . "missing or does not contain the'Upgrade' token.\r\n"; } elseif (!isset($headers['Sec-WebSocket-Key'])) { $response = "HTTP/1.1 400 Bad Request\r\n" . "X-WebSocket-Message: Client request Sec-WebSocket-Key " . "header is missing.\r\n"; } elseif (!isset($headers['Sec-WebSocket-Version'])) { $response = "HTTP/1.1 400 Bad Request\r\n" . "X-WebSocket-Message: Client request Sec-WebSocket-Version " . "header is missing.\r\n"; } elseif ($headers['Sec-WebSocket-Version'] !== self::VERSION) { $response = "HTTP/1.1 426 Upgrade Required\r\n" . "Sec-WebSocket-Version: " . self::VERSION . "\r\n" . "X-WebSocket-Message: Client request protocol version is " . "unsupported.\r\n"; } else { $key = $headers['Sec-WebSocket-Key']; $accept = $this->getAccept($key); $version = $headers['Sec-WebSocket-Version']; $response = "HTTP/1.1 101 Switching Protocols\r\n" . "Upgrade: websocket\r\n" . "Connection: Upgrade\r\n" . "Sec-WebSocket-Accept: " . $accept . "\r\n"; if (isset($headers['Sec-WebSocket-Protocol'])) { $protocols = explode(',', $headers['Sec-WebSocket-Protocol']); $protocols = array_map('trim', $protocols); $supportedProtocol = $this->getSupportedProtocol( $supportedProtocols, $protocols ); // If no protocol is agreed upon, don't send a protocol header // in the response. It it up to the client to fail the // connection if no protocols are agreed upon. See RFC 6455 // Section 4.1 server response validation item 6 and Section // 4.2.2 /subprotocol/. if ($supportedProtocol !== null) { $response .= 'Sec-WebSocket-Protocol: ' . $supportedProtocol . "\r\n"; } } } $response .= "\r\n"; return $response; }
php
protected function receiveClientHandshake( array $headers, array $supportedProtocols ) { if (!isset($headers['Host'])) { $response = "HTTP/1.1 400 Bad Request\r\n" . "X-WebSocket-Message: Client request Host header is " . "missing.\r\n"; } elseif ( !isset($headers['Upgrade']) || !in_array('websocket', $this->parseHeaderValue($headers['Upgrade'])) ) { $response = "HTTP/1.1 400 Bad Request\r\n" . "X-WebSocket-Message: Client request Upgrade header is " . "missing or does not contain the 'websocket' product.\r\n"; } elseif ( !isset($headers['Connection']) || !in_array('upgrade', $this->parseHeaderValue($headers['Connection'])) ) { $response = "HTTP/1.1 400 Bad Request\r\n" . "X-WebSocket-Message: Client request Connection header is " . "missing or does not contain the'Upgrade' token.\r\n"; } elseif (!isset($headers['Sec-WebSocket-Key'])) { $response = "HTTP/1.1 400 Bad Request\r\n" . "X-WebSocket-Message: Client request Sec-WebSocket-Key " . "header is missing.\r\n"; } elseif (!isset($headers['Sec-WebSocket-Version'])) { $response = "HTTP/1.1 400 Bad Request\r\n" . "X-WebSocket-Message: Client request Sec-WebSocket-Version " . "header is missing.\r\n"; } elseif ($headers['Sec-WebSocket-Version'] !== self::VERSION) { $response = "HTTP/1.1 426 Upgrade Required\r\n" . "Sec-WebSocket-Version: " . self::VERSION . "\r\n" . "X-WebSocket-Message: Client request protocol version is " . "unsupported.\r\n"; } else { $key = $headers['Sec-WebSocket-Key']; $accept = $this->getAccept($key); $version = $headers['Sec-WebSocket-Version']; $response = "HTTP/1.1 101 Switching Protocols\r\n" . "Upgrade: websocket\r\n" . "Connection: Upgrade\r\n" . "Sec-WebSocket-Accept: " . $accept . "\r\n"; if (isset($headers['Sec-WebSocket-Protocol'])) { $protocols = explode(',', $headers['Sec-WebSocket-Protocol']); $protocols = array_map('trim', $protocols); $supportedProtocol = $this->getSupportedProtocol( $supportedProtocols, $protocols ); // If no protocol is agreed upon, don't send a protocol header // in the response. It it up to the client to fail the // connection if no protocols are agreed upon. See RFC 6455 // Section 4.1 server response validation item 6 and Section // 4.2.2 /subprotocol/. if ($supportedProtocol !== null) { $response .= 'Sec-WebSocket-Protocol: ' . $supportedProtocol . "\r\n"; } } } $response .= "\r\n"; return $response; }
[ "protected", "function", "receiveClientHandshake", "(", "array", "$", "headers", ",", "array", "$", "supportedProtocols", ")", "{", "if", "(", "!", "isset", "(", "$", "headers", "[", "'Host'", "]", ")", ")", "{", "$", "response", "=", "\"HTTP/1.1 400 Bad Request\\r\\n\"", ".", "\"X-WebSocket-Message: Client request Host header is \"", ".", "\"missing.\\r\\n\"", ";", "}", "elseif", "(", "!", "isset", "(", "$", "headers", "[", "'Upgrade'", "]", ")", "||", "!", "in_array", "(", "'websocket'", ",", "$", "this", "->", "parseHeaderValue", "(", "$", "headers", "[", "'Upgrade'", "]", ")", ")", ")", "{", "$", "response", "=", "\"HTTP/1.1 400 Bad Request\\r\\n\"", ".", "\"X-WebSocket-Message: Client request Upgrade header is \"", ".", "\"missing or does not contain the 'websocket' product.\\r\\n\"", ";", "}", "elseif", "(", "!", "isset", "(", "$", "headers", "[", "'Connection'", "]", ")", "||", "!", "in_array", "(", "'upgrade'", ",", "$", "this", "->", "parseHeaderValue", "(", "$", "headers", "[", "'Connection'", "]", ")", ")", ")", "{", "$", "response", "=", "\"HTTP/1.1 400 Bad Request\\r\\n\"", ".", "\"X-WebSocket-Message: Client request Connection header is \"", ".", "\"missing or does not contain the'Upgrade' token.\\r\\n\"", ";", "}", "elseif", "(", "!", "isset", "(", "$", "headers", "[", "'Sec-WebSocket-Key'", "]", ")", ")", "{", "$", "response", "=", "\"HTTP/1.1 400 Bad Request\\r\\n\"", ".", "\"X-WebSocket-Message: Client request Sec-WebSocket-Key \"", ".", "\"header is missing.\\r\\n\"", ";", "}", "elseif", "(", "!", "isset", "(", "$", "headers", "[", "'Sec-WebSocket-Version'", "]", ")", ")", "{", "$", "response", "=", "\"HTTP/1.1 400 Bad Request\\r\\n\"", ".", "\"X-WebSocket-Message: Client request Sec-WebSocket-Version \"", ".", "\"header is missing.\\r\\n\"", ";", "}", "elseif", "(", "$", "headers", "[", "'Sec-WebSocket-Version'", "]", "!==", "self", "::", "VERSION", ")", "{", "$", "response", "=", "\"HTTP/1.1 426 Upgrade Required\\r\\n\"", ".", "\"Sec-WebSocket-Version: \"", ".", "self", "::", "VERSION", ".", "\"\\r\\n\"", ".", "\"X-WebSocket-Message: Client request protocol version is \"", ".", "\"unsupported.\\r\\n\"", ";", "}", "else", "{", "$", "key", "=", "$", "headers", "[", "'Sec-WebSocket-Key'", "]", ";", "$", "accept", "=", "$", "this", "->", "getAccept", "(", "$", "key", ")", ";", "$", "version", "=", "$", "headers", "[", "'Sec-WebSocket-Version'", "]", ";", "$", "response", "=", "\"HTTP/1.1 101 Switching Protocols\\r\\n\"", ".", "\"Upgrade: websocket\\r\\n\"", ".", "\"Connection: Upgrade\\r\\n\"", ".", "\"Sec-WebSocket-Accept: \"", ".", "$", "accept", ".", "\"\\r\\n\"", ";", "if", "(", "isset", "(", "$", "headers", "[", "'Sec-WebSocket-Protocol'", "]", ")", ")", "{", "$", "protocols", "=", "explode", "(", "','", ",", "$", "headers", "[", "'Sec-WebSocket-Protocol'", "]", ")", ";", "$", "protocols", "=", "array_map", "(", "'trim'", ",", "$", "protocols", ")", ";", "$", "supportedProtocol", "=", "$", "this", "->", "getSupportedProtocol", "(", "$", "supportedProtocols", ",", "$", "protocols", ")", ";", "// If no protocol is agreed upon, don't send a protocol header", "// in the response. It it up to the client to fail the", "// connection if no protocols are agreed upon. See RFC 6455", "// Section 4.1 server response validation item 6 and Section", "// 4.2.2 /subprotocol/.", "if", "(", "$", "supportedProtocol", "!==", "null", ")", "{", "$", "response", ".=", "'Sec-WebSocket-Protocol: '", ".", "$", "supportedProtocol", ".", "\"\\r\\n\"", ";", "}", "}", "}", "$", "response", ".=", "\"\\r\\n\"", ";", "return", "$", "response", ";", "}" ]
Receives and validates a client handshake request and returns an appropriate server response @param array $headers the parsed request headers from the client. @param array $supportedProtocols optional. A list of sub-protocols supported by the server. @return string an appropriate HTTP response for the client handshake request. If there were errors in the client request, an appropriate HTTP 4XX response is returned. If the handshake response was successful, a HTTP 101 is returned.
[ "Receives", "and", "validates", "a", "client", "handshake", "request", "and", "returns", "an", "appropriate", "server", "response" ]
b446e27cd1bebd58ba89243cde1272c5d281d3fb
https://github.com/silverorange/Net_Notifier/blob/b446e27cd1bebd58ba89243cde1272c5d281d3fb/Net/Notifier/WebSocket/Handshake.php#L187-L276
6,801
silverorange/Net_Notifier
Net/Notifier/WebSocket/Handshake.php
Net_Notifier_WebSocket_Handshake.receiveServerHandshake
protected function receiveServerHandshake( array $headers, $nonce, array $protocols = array() ) { // Make sure required headers and values are present as per RFC 6455 // section 4.1 client validation of server response. if (!isset($headers['Sec-WebSocket-Accept'])) { throw new Net_Notifier_WebSocket_HandshakeFailureException( 'Sec-WebSocket-Accept header missing.' ); } if ( !isset($headers['Upgrade']) || mb_strtolower($headers['Upgrade']) !== 'websocket' ) { throw new Net_Notifier_WebSocket_HandshakeFailureException( 'Upgrade header missing or not set to "websocket".' ); } if ( !isset($headers['Connection']) || mb_strtolower($headers['Connection']) !== 'upgrade' ) { throw new Net_Notifier_WebSocket_HandshakeFailureException( 'Connection header missing or not set to "Upgrade".' ); } // Make sure server responded with appropriate Sec-WebSocket-Accept // header. Ignore leading and trailing whitespace as per RFC 6455 // section 4.1 client validation of server response item 4. $responseAccept = trim($headers['Sec-WebSocket-Accept']); $validAccept = $this->getAccept($nonce); if ($responseAccept !== $validAccept) { throw new Net_Notifier_WebSocket_HandshakeFailureException( sprintf( 'Sec-WebSocket-Accept header "%s" does not validate ' . 'against nonce "%s"', $responseAccept, $nonce ) ); } // If specific subprotocols were requested, verify the server supports // them. See RFC 6455 Section 4.1 server response validation item 6. if (count($protocols) > 0) { if (!isset($headers['Sec-WebSocket-Protocol'])) { throw new Net_Notifier_WebSocket_ProtocolException( sprintf( "Client requested '%s' sub-protocols but server does " . "not support any of them.", implode(' ', $protocols) ), 0, null, $protocols ); } if (!in_array($headers['Sec-WebSocket-Protocol'], $protocols)) { throw new Net_Notifier_WebSocket_ProtocolException( sprintf( "Client requested '%s' sub-protocols. Server " . "responded with unsupported sub-protocol: '%s'.", implode(' ', $protocols), $headers['Sec-WebSocket-Protocol'] ), 0, $headers['Sec-WebSocket-Protocol'], $protocols ); } } return null; }
php
protected function receiveServerHandshake( array $headers, $nonce, array $protocols = array() ) { // Make sure required headers and values are present as per RFC 6455 // section 4.1 client validation of server response. if (!isset($headers['Sec-WebSocket-Accept'])) { throw new Net_Notifier_WebSocket_HandshakeFailureException( 'Sec-WebSocket-Accept header missing.' ); } if ( !isset($headers['Upgrade']) || mb_strtolower($headers['Upgrade']) !== 'websocket' ) { throw new Net_Notifier_WebSocket_HandshakeFailureException( 'Upgrade header missing or not set to "websocket".' ); } if ( !isset($headers['Connection']) || mb_strtolower($headers['Connection']) !== 'upgrade' ) { throw new Net_Notifier_WebSocket_HandshakeFailureException( 'Connection header missing or not set to "Upgrade".' ); } // Make sure server responded with appropriate Sec-WebSocket-Accept // header. Ignore leading and trailing whitespace as per RFC 6455 // section 4.1 client validation of server response item 4. $responseAccept = trim($headers['Sec-WebSocket-Accept']); $validAccept = $this->getAccept($nonce); if ($responseAccept !== $validAccept) { throw new Net_Notifier_WebSocket_HandshakeFailureException( sprintf( 'Sec-WebSocket-Accept header "%s" does not validate ' . 'against nonce "%s"', $responseAccept, $nonce ) ); } // If specific subprotocols were requested, verify the server supports // them. See RFC 6455 Section 4.1 server response validation item 6. if (count($protocols) > 0) { if (!isset($headers['Sec-WebSocket-Protocol'])) { throw new Net_Notifier_WebSocket_ProtocolException( sprintf( "Client requested '%s' sub-protocols but server does " . "not support any of them.", implode(' ', $protocols) ), 0, null, $protocols ); } if (!in_array($headers['Sec-WebSocket-Protocol'], $protocols)) { throw new Net_Notifier_WebSocket_ProtocolException( sprintf( "Client requested '%s' sub-protocols. Server " . "responded with unsupported sub-protocol: '%s'.", implode(' ', $protocols), $headers['Sec-WebSocket-Protocol'] ), 0, $headers['Sec-WebSocket-Protocol'], $protocols ); } } return null; }
[ "protected", "function", "receiveServerHandshake", "(", "array", "$", "headers", ",", "$", "nonce", ",", "array", "$", "protocols", "=", "array", "(", ")", ")", "{", "// Make sure required headers and values are present as per RFC 6455", "// section 4.1 client validation of server response.", "if", "(", "!", "isset", "(", "$", "headers", "[", "'Sec-WebSocket-Accept'", "]", ")", ")", "{", "throw", "new", "Net_Notifier_WebSocket_HandshakeFailureException", "(", "'Sec-WebSocket-Accept header missing.'", ")", ";", "}", "if", "(", "!", "isset", "(", "$", "headers", "[", "'Upgrade'", "]", ")", "||", "mb_strtolower", "(", "$", "headers", "[", "'Upgrade'", "]", ")", "!==", "'websocket'", ")", "{", "throw", "new", "Net_Notifier_WebSocket_HandshakeFailureException", "(", "'Upgrade header missing or not set to \"websocket\".'", ")", ";", "}", "if", "(", "!", "isset", "(", "$", "headers", "[", "'Connection'", "]", ")", "||", "mb_strtolower", "(", "$", "headers", "[", "'Connection'", "]", ")", "!==", "'upgrade'", ")", "{", "throw", "new", "Net_Notifier_WebSocket_HandshakeFailureException", "(", "'Connection header missing or not set to \"Upgrade\".'", ")", ";", "}", "// Make sure server responded with appropriate Sec-WebSocket-Accept", "// header. Ignore leading and trailing whitespace as per RFC 6455", "// section 4.1 client validation of server response item 4.", "$", "responseAccept", "=", "trim", "(", "$", "headers", "[", "'Sec-WebSocket-Accept'", "]", ")", ";", "$", "validAccept", "=", "$", "this", "->", "getAccept", "(", "$", "nonce", ")", ";", "if", "(", "$", "responseAccept", "!==", "$", "validAccept", ")", "{", "throw", "new", "Net_Notifier_WebSocket_HandshakeFailureException", "(", "sprintf", "(", "'Sec-WebSocket-Accept header \"%s\" does not validate '", ".", "'against nonce \"%s\"'", ",", "$", "responseAccept", ",", "$", "nonce", ")", ")", ";", "}", "// If specific subprotocols were requested, verify the server supports", "// them. See RFC 6455 Section 4.1 server response validation item 6.", "if", "(", "count", "(", "$", "protocols", ")", ">", "0", ")", "{", "if", "(", "!", "isset", "(", "$", "headers", "[", "'Sec-WebSocket-Protocol'", "]", ")", ")", "{", "throw", "new", "Net_Notifier_WebSocket_ProtocolException", "(", "sprintf", "(", "\"Client requested '%s' sub-protocols but server does \"", ".", "\"not support any of them.\"", ",", "implode", "(", "' '", ",", "$", "protocols", ")", ")", ",", "0", ",", "null", ",", "$", "protocols", ")", ";", "}", "if", "(", "!", "in_array", "(", "$", "headers", "[", "'Sec-WebSocket-Protocol'", "]", ",", "$", "protocols", ")", ")", "{", "throw", "new", "Net_Notifier_WebSocket_ProtocolException", "(", "sprintf", "(", "\"Client requested '%s' sub-protocols. Server \"", ".", "\"responded with unsupported sub-protocol: '%s'.\"", ",", "implode", "(", "' '", ",", "$", "protocols", ")", ",", "$", "headers", "[", "'Sec-WebSocket-Protocol'", "]", ")", ",", "0", ",", "$", "headers", "[", "'Sec-WebSocket-Protocol'", "]", ",", "$", "protocols", ")", ";", "}", "}", "return", "null", ";", "}" ]
Receives and validates a server handshake response @param array $headers the parsed response headers from the server. @param string $nonce the nonce value used to validate this handshake. @param array $protocols optional. A list of requested application- specific sub-protocols. If the server handshake response does not contain one of the requested protocols, this handshake will fail. @return null @throws Net_Notifier_WebSocket_HandshakeFailureException if the handshake response is invalid according to RFC 6455.
[ "Receives", "and", "validates", "a", "server", "handshake", "response" ]
b446e27cd1bebd58ba89243cde1272c5d281d3fb
https://github.com/silverorange/Net_Notifier/blob/b446e27cd1bebd58ba89243cde1272c5d281d3fb/Net/Notifier/WebSocket/Handshake.php#L296-L373
6,802
silverorange/Net_Notifier
Net/Notifier/WebSocket/Handshake.php
Net_Notifier_WebSocket_Handshake.getSupportedProtocol
protected function getSupportedProtocol(array $supported, array $requested) { $supportedProtocol = null; foreach ($requested as $protocol) { if (in_array($protocol, $supported)) { $supportedProtocol = $protocol; break; } } return $supportedProtocol; }
php
protected function getSupportedProtocol(array $supported, array $requested) { $supportedProtocol = null; foreach ($requested as $protocol) { if (in_array($protocol, $supported)) { $supportedProtocol = $protocol; break; } } return $supportedProtocol; }
[ "protected", "function", "getSupportedProtocol", "(", "array", "$", "supported", ",", "array", "$", "requested", ")", "{", "$", "supportedProtocol", "=", "null", ";", "foreach", "(", "$", "requested", "as", "$", "protocol", ")", "{", "if", "(", "in_array", "(", "$", "protocol", ",", "$", "supported", ")", ")", "{", "$", "supportedProtocol", "=", "$", "protocol", ";", "break", ";", "}", "}", "return", "$", "supportedProtocol", ";", "}" ]
Gets the first supported protocol from a list of requested protocols @param array $supported the list of supported protocols. @param array $requested the list of requested protocols. @return string|null the first matching requested protocol in the list of supported protocols or null if no such protocol exists.
[ "Gets", "the", "first", "supported", "protocol", "from", "a", "list", "of", "requested", "protocols" ]
b446e27cd1bebd58ba89243cde1272c5d281d3fb
https://github.com/silverorange/Net_Notifier/blob/b446e27cd1bebd58ba89243cde1272c5d281d3fb/Net/Notifier/WebSocket/Handshake.php#L388-L400
6,803
silverorange/Net_Notifier
Net/Notifier/WebSocket/Handshake.php
Net_Notifier_WebSocket_Handshake.parseHeaders
protected function parseHeaders($header) { $parsedHeaders = array( 'status' => '', 'headers' => array() ); $headers = explode("\r\n", $header); $parsedHeaders['status'] = array_shift($headers); foreach ($headers as $header) { list($name, $value) = explode(':', $header, 2); $parsedHeaders['headers'][$name] = ltrim($value); } return $parsedHeaders; }
php
protected function parseHeaders($header) { $parsedHeaders = array( 'status' => '', 'headers' => array() ); $headers = explode("\r\n", $header); $parsedHeaders['status'] = array_shift($headers); foreach ($headers as $header) { list($name, $value) = explode(':', $header, 2); $parsedHeaders['headers'][$name] = ltrim($value); } return $parsedHeaders; }
[ "protected", "function", "parseHeaders", "(", "$", "header", ")", "{", "$", "parsedHeaders", "=", "array", "(", "'status'", "=>", "''", ",", "'headers'", "=>", "array", "(", ")", ")", ";", "$", "headers", "=", "explode", "(", "\"\\r\\n\"", ",", "$", "header", ")", ";", "$", "parsedHeaders", "[", "'status'", "]", "=", "array_shift", "(", "$", "headers", ")", ";", "foreach", "(", "$", "headers", "as", "$", "header", ")", "{", "list", "(", "$", "name", ",", "$", "value", ")", "=", "explode", "(", "':'", ",", "$", "header", ",", "2", ")", ";", "$", "parsedHeaders", "[", "'headers'", "]", "[", "$", "name", "]", "=", "ltrim", "(", "$", "value", ")", ";", "}", "return", "$", "parsedHeaders", ";", "}" ]
Parses the raw handshake header into an array of headers @param string $header the raw handshake header. @return array a structured array containing the following: - <kbd>status</kbd> - the handshake status line, and - <kbd>headers</kbd> - an array of headers. Array keys are the header names and array values are the values.
[ "Parses", "the", "raw", "handshake", "header", "into", "an", "array", "of", "headers" ]
b446e27cd1bebd58ba89243cde1272c5d281d3fb
https://github.com/silverorange/Net_Notifier/blob/b446e27cd1bebd58ba89243cde1272c5d281d3fb/Net/Notifier/WebSocket/Handshake.php#L416-L432
6,804
silverorange/Net_Notifier
Net/Notifier/WebSocket/Handshake.php
Net_Notifier_WebSocket_Handshake.parseHeaderValue
protected function parseHeaderValue($value) { $values = explode(',', $value); // remove leading/trailing whitespace $values = array_map('trim', $values); // ignore empty values $values = array_filter( $values, create_function('$value', 'return ($value != \'\');') ); // lowercase header values // remove leading/trailing whitespace $values = array_map('mb_strtolower', $values); return $values; }
php
protected function parseHeaderValue($value) { $values = explode(',', $value); // remove leading/trailing whitespace $values = array_map('trim', $values); // ignore empty values $values = array_filter( $values, create_function('$value', 'return ($value != \'\');') ); // lowercase header values // remove leading/trailing whitespace $values = array_map('mb_strtolower', $values); return $values; }
[ "protected", "function", "parseHeaderValue", "(", "$", "value", ")", "{", "$", "values", "=", "explode", "(", "','", ",", "$", "value", ")", ";", "// remove leading/trailing whitespace", "$", "values", "=", "array_map", "(", "'trim'", ",", "$", "values", ")", ";", "// ignore empty values", "$", "values", "=", "array_filter", "(", "$", "values", ",", "create_function", "(", "'$value'", ",", "'return ($value != \\'\\');'", ")", ")", ";", "// lowercase header values", "// remove leading/trailing whitespace", "$", "values", "=", "array_map", "(", "'mb_strtolower'", ",", "$", "values", ")", ";", "return", "$", "values", ";", "}" ]
Parses a HTTP header value containing one or more tokens separated by commas Empty values are ignored. Only tokens are parsed, which means quoted string values may not be parsed correctly. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.1 @param string $value the raw HTTP header value to parse @return array an array of parsed header values.
[ "Parses", "a", "HTTP", "header", "value", "containing", "one", "or", "more", "tokens", "separated", "by", "commas" ]
b446e27cd1bebd58ba89243cde1272c5d281d3fb
https://github.com/silverorange/Net_Notifier/blob/b446e27cd1bebd58ba89243cde1272c5d281d3fb/Net/Notifier/WebSocket/Handshake.php#L450-L468
6,805
silverorange/Net_Notifier
Net/Notifier/WebSocket/Handshake.php
Net_Notifier_WebSocket_Handshake.getAccept
protected function getAccept($key) { $accept = $key . self::GUID; $accept = sha1($accept, true); $accept = base64_encode($accept); return $accept; }
php
protected function getAccept($key) { $accept = $key . self::GUID; $accept = sha1($accept, true); $accept = base64_encode($accept); return $accept; }
[ "protected", "function", "getAccept", "(", "$", "key", ")", "{", "$", "accept", "=", "$", "key", ".", "self", "::", "GUID", ";", "$", "accept", "=", "sha1", "(", "$", "accept", ",", "true", ")", ";", "$", "accept", "=", "base64_encode", "(", "$", "accept", ")", ";", "return", "$", "accept", ";", "}" ]
Gets the accept header value for this handshake The 20-character string is derived through the following: 1. start with the key string 2. append the string 258EAFA5-E914-47DA-95CA-C5AB0DC85B11 3. take the sha1() of the resulting string 4. base-64 encode the sha1 result See section 4.2.2 item 5 subitem 4 of RFC 6455 for further details. @param string $key the key from which to generate the accept hash. @return string the accept hash.
[ "Gets", "the", "accept", "header", "value", "for", "this", "handshake" ]
b446e27cd1bebd58ba89243cde1272c5d281d3fb
https://github.com/silverorange/Net_Notifier/blob/b446e27cd1bebd58ba89243cde1272c5d281d3fb/Net/Notifier/WebSocket/Handshake.php#L489-L495
6,806
thecodingmachine/utils.i18n.fine
src/Mouf/Utils/I18n/Fine/Language/DomainLanguageDetection.php
DomainLanguageDetection.getLanguage
public function getLanguage() { if(isset($_SERVER["SERVER_NAME"])) { $domain = $_SERVER["SERVER_NAME"]; // Evol it's false, check subdomain www or without www if(isset($this->domains[$domain])) { return $this->domains[$domain]; } } return "default"; }
php
public function getLanguage() { if(isset($_SERVER["SERVER_NAME"])) { $domain = $_SERVER["SERVER_NAME"]; // Evol it's false, check subdomain www or without www if(isset($this->domains[$domain])) { return $this->domains[$domain]; } } return "default"; }
[ "public", "function", "getLanguage", "(", ")", "{", "if", "(", "isset", "(", "$", "_SERVER", "[", "\"SERVER_NAME\"", "]", ")", ")", "{", "$", "domain", "=", "$", "_SERVER", "[", "\"SERVER_NAME\"", "]", ";", "// Evol it's false, check subdomain www or without www\r", "if", "(", "isset", "(", "$", "this", "->", "domains", "[", "$", "domain", "]", ")", ")", "{", "return", "$", "this", "->", "domains", "[", "$", "domain", "]", ";", "}", "}", "return", "\"default\"", ";", "}" ]
Returns the language used for the domain name. Check if the value exit in keys array. If this value doesn't exist, the function return default. @see plugins/utils/i18n/fine/2.1/language/LanguageDetectionInterface::getLanguage() @return string Language code store in array
[ "Returns", "the", "language", "used", "for", "the", "domain", "name", ".", "Check", "if", "the", "value", "exit", "in", "keys", "array", ".", "If", "this", "value", "doesn", "t", "exist", "the", "function", "return", "default", "." ]
69c165497bc5c202892fdc8022591eddbb8e0e3b
https://github.com/thecodingmachine/utils.i18n.fine/blob/69c165497bc5c202892fdc8022591eddbb8e0e3b/src/Mouf/Utils/I18n/Fine/Language/DomainLanguageDetection.php#L26-L35
6,807
Silvestra/Locale
Helper/LocaleHelper.php
LocaleHelper.getDisplayLocales
public function getDisplayLocales() { $locales = array(); foreach ($this->allowedLocales as $locale) { $locales[$locale] = \Locale::getDisplayName($locale); } return $locales; }
php
public function getDisplayLocales() { $locales = array(); foreach ($this->allowedLocales as $locale) { $locales[$locale] = \Locale::getDisplayName($locale); } return $locales; }
[ "public", "function", "getDisplayLocales", "(", ")", "{", "$", "locales", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "allowedLocales", "as", "$", "locale", ")", "{", "$", "locales", "[", "$", "locale", "]", "=", "\\", "Locale", "::", "getDisplayName", "(", "$", "locale", ")", ";", "}", "return", "$", "locales", ";", "}" ]
Get display locales. @return array
[ "Get", "display", "locales", "." ]
beb60454c8e2d40cf41ef820c7c552a49184568a
https://github.com/Silvestra/Locale/blob/beb60454c8e2d40cf41ef820c7c552a49184568a/Helper/LocaleHelper.php#L41-L50
6,808
wisquimas/valleysofsorcery
admin/mf_custom_group.php
mf_custom_group.delete_custom_group
public function delete_custom_group(){ global $wpdb; //checking the nonce check_admin_referer('delete_custom_group'); if( isset($_GET['custom_group_id']) ){ $id = (int)$_GET['custom_group_id']; if( is_int($id) ){ $group = $this->get_group($id); $sql = $wpdb->prepare( "DELETE FROM ".MF_TABLE_CUSTOM_GROUPS." WHERE id = %d",$id ); $wpdb->query($sql); $sql_fields = $wpdb->prepare( "DELETE FROM ".MF_TABLE_CUSTOM_FIELDS." WHERE custom_group_id = %d",$id ); $wpdb->query($sql_fields); //ToDo: poner mensaje de que se borro correctamente $this->mf_redirect('mf_custom_fields','fields_list',array('message' => 'success','post_type' => $group['post_type'])); } } }
php
public function delete_custom_group(){ global $wpdb; //checking the nonce check_admin_referer('delete_custom_group'); if( isset($_GET['custom_group_id']) ){ $id = (int)$_GET['custom_group_id']; if( is_int($id) ){ $group = $this->get_group($id); $sql = $wpdb->prepare( "DELETE FROM ".MF_TABLE_CUSTOM_GROUPS." WHERE id = %d",$id ); $wpdb->query($sql); $sql_fields = $wpdb->prepare( "DELETE FROM ".MF_TABLE_CUSTOM_FIELDS." WHERE custom_group_id = %d",$id ); $wpdb->query($sql_fields); //ToDo: poner mensaje de que se borro correctamente $this->mf_redirect('mf_custom_fields','fields_list',array('message' => 'success','post_type' => $group['post_type'])); } } }
[ "public", "function", "delete_custom_group", "(", ")", "{", "global", "$", "wpdb", ";", "//checking the nonce", "check_admin_referer", "(", "'delete_custom_group'", ")", ";", "if", "(", "isset", "(", "$", "_GET", "[", "'custom_group_id'", "]", ")", ")", "{", "$", "id", "=", "(", "int", ")", "$", "_GET", "[", "'custom_group_id'", "]", ";", "if", "(", "is_int", "(", "$", "id", ")", ")", "{", "$", "group", "=", "$", "this", "->", "get_group", "(", "$", "id", ")", ";", "$", "sql", "=", "$", "wpdb", "->", "prepare", "(", "\"DELETE FROM \"", ".", "MF_TABLE_CUSTOM_GROUPS", ".", "\" WHERE id = %d\"", ",", "$", "id", ")", ";", "$", "wpdb", "->", "query", "(", "$", "sql", ")", ";", "$", "sql_fields", "=", "$", "wpdb", "->", "prepare", "(", "\"DELETE FROM \"", ".", "MF_TABLE_CUSTOM_FIELDS", ".", "\" WHERE custom_group_id = %d\"", ",", "$", "id", ")", ";", "$", "wpdb", "->", "query", "(", "$", "sql_fields", ")", ";", "//ToDo: poner mensaje de que se borro correctamente", "$", "this", "->", "mf_redirect", "(", "'mf_custom_fields'", ",", "'fields_list'", ",", "array", "(", "'message'", "=>", "'success'", ",", "'post_type'", "=>", "$", "group", "[", "'post_type'", "]", ")", ")", ";", "}", "}", "}" ]
Delete a custom group
[ "Delete", "a", "custom", "group" ]
78a8d8f1d1102c5043e2cf7c98762e63464d2d7a
https://github.com/wisquimas/valleysofsorcery/blob/78a8d8f1d1102c5043e2cf7c98762e63464d2d7a/admin/mf_custom_group.php#L41-L62
6,809
tenside/ui
src/Compiler/UiTask.php
UiTask.runProcess
private function runProcess(Process $process) { $process->setTimeout(null)->mustRun(); foreach (explode(PHP_EOL, $process->getOutput()) as $line) { $this->notice($line); } }
php
private function runProcess(Process $process) { $process->setTimeout(null)->mustRun(); foreach (explode(PHP_EOL, $process->getOutput()) as $line) { $this->notice($line); } }
[ "private", "function", "runProcess", "(", "Process", "$", "process", ")", "{", "$", "process", "->", "setTimeout", "(", "null", ")", "->", "mustRun", "(", ")", ";", "foreach", "(", "explode", "(", "PHP_EOL", ",", "$", "process", "->", "getOutput", "(", ")", ")", "as", "$", "line", ")", "{", "$", "this", "->", "notice", "(", "$", "line", ")", ";", "}", "}" ]
Run the passed process and add every line from the output to the log. @param Process $process The process to execute. @return void
[ "Run", "the", "passed", "process", "and", "add", "every", "line", "from", "the", "output", "to", "the", "log", "." ]
cfe14a665e82799c2687ee470d7d63d8d9188198
https://github.com/tenside/ui/blob/cfe14a665e82799c2687ee470d7d63d8d9188198/src/Compiler/UiTask.php#L42-L48
6,810
renegare/soauth
src/Controller/Access.php
Access.exchangeAction
public function exchangeAction(Request $request) { try { $authCode = $this->getAuthCode($request); $this->info('> Exchange request', ['method' => $request->getMethod(), 'auth_code' => $authCode]); $clientSecret = $this->getClientSecret($request); $credentials = $this->accessProvider->exchange($authCode, $clientSecret); $response = new JsonResponse([ 'access_code' => $credentials->getAccessCode(), 'refresh_code' => $credentials->getRefreshCode(), 'lifetime' => $credentials->getLifetime() ]); } catch (SoauthException $e) { $data = []; if($e instanceof BadDataException) { $data['errors'] = $e->getErrors(); } $response = new JsonResponse($data, Response::HTTP_BAD_REQUEST); } $this->info('< Response', ['status_code' => $response->getStatusCode()]); return $response; }
php
public function exchangeAction(Request $request) { try { $authCode = $this->getAuthCode($request); $this->info('> Exchange request', ['method' => $request->getMethod(), 'auth_code' => $authCode]); $clientSecret = $this->getClientSecret($request); $credentials = $this->accessProvider->exchange($authCode, $clientSecret); $response = new JsonResponse([ 'access_code' => $credentials->getAccessCode(), 'refresh_code' => $credentials->getRefreshCode(), 'lifetime' => $credentials->getLifetime() ]); } catch (SoauthException $e) { $data = []; if($e instanceof BadDataException) { $data['errors'] = $e->getErrors(); } $response = new JsonResponse($data, Response::HTTP_BAD_REQUEST); } $this->info('< Response', ['status_code' => $response->getStatusCode()]); return $response; }
[ "public", "function", "exchangeAction", "(", "Request", "$", "request", ")", "{", "try", "{", "$", "authCode", "=", "$", "this", "->", "getAuthCode", "(", "$", "request", ")", ";", "$", "this", "->", "info", "(", "'> Exchange request'", ",", "[", "'method'", "=>", "$", "request", "->", "getMethod", "(", ")", ",", "'auth_code'", "=>", "$", "authCode", "]", ")", ";", "$", "clientSecret", "=", "$", "this", "->", "getClientSecret", "(", "$", "request", ")", ";", "$", "credentials", "=", "$", "this", "->", "accessProvider", "->", "exchange", "(", "$", "authCode", ",", "$", "clientSecret", ")", ";", "$", "response", "=", "new", "JsonResponse", "(", "[", "'access_code'", "=>", "$", "credentials", "->", "getAccessCode", "(", ")", ",", "'refresh_code'", "=>", "$", "credentials", "->", "getRefreshCode", "(", ")", ",", "'lifetime'", "=>", "$", "credentials", "->", "getLifetime", "(", ")", "]", ")", ";", "}", "catch", "(", "SoauthException", "$", "e", ")", "{", "$", "data", "=", "[", "]", ";", "if", "(", "$", "e", "instanceof", "BadDataException", ")", "{", "$", "data", "[", "'errors'", "]", "=", "$", "e", "->", "getErrors", "(", ")", ";", "}", "$", "response", "=", "new", "JsonResponse", "(", "$", "data", ",", "Response", "::", "HTTP_BAD_REQUEST", ")", ";", "}", "$", "this", "->", "info", "(", "'< Response'", ",", "[", "'status_code'", "=>", "$", "response", "->", "getStatusCode", "(", ")", "]", ")", ";", "return", "$", "response", ";", "}" ]
exchange auth for an access code @param $request @return string|Response
[ "exchange", "auth", "for", "an", "access", "code" ]
c0141918740601b7cd0f03ad42d2e248ef2d6da0
https://github.com/renegare/soauth/blob/c0141918740601b7cd0f03ad42d2e248ef2d6da0/src/Controller/Access.php#L37-L62
6,811
renegare/soauth
src/Controller/Access.php
Access.refreshAction
public function refreshAction(Request $request) { try { $refreshCode = $this->getRefreshCode($request); $clientSecret = $this->getClientSecret($request); $credentials = $this->accessProvider->refresh($request, $refreshCode, $clientSecret); $response = new JsonResponse([ 'access_code' => $credentials->getAccessCode(), 'refresh_code' => $credentials->getRefreshCode(), 'lifetime' => $credentials->getLifetime() ]); } catch (SoauthException $e) { $data = []; if($e instanceof BadDataException) { $data['errors'] = $e->getErrors(); } $response = new JsonResponse($data, Response::HTTP_BAD_REQUEST); } $this->info('< Response', ['status_code' => $response->getStatusCode()]); return $response; }
php
public function refreshAction(Request $request) { try { $refreshCode = $this->getRefreshCode($request); $clientSecret = $this->getClientSecret($request); $credentials = $this->accessProvider->refresh($request, $refreshCode, $clientSecret); $response = new JsonResponse([ 'access_code' => $credentials->getAccessCode(), 'refresh_code' => $credentials->getRefreshCode(), 'lifetime' => $credentials->getLifetime() ]); } catch (SoauthException $e) { $data = []; if($e instanceof BadDataException) { $data['errors'] = $e->getErrors(); } $response = new JsonResponse($data, Response::HTTP_BAD_REQUEST); } $this->info('< Response', ['status_code' => $response->getStatusCode()]); return $response; }
[ "public", "function", "refreshAction", "(", "Request", "$", "request", ")", "{", "try", "{", "$", "refreshCode", "=", "$", "this", "->", "getRefreshCode", "(", "$", "request", ")", ";", "$", "clientSecret", "=", "$", "this", "->", "getClientSecret", "(", "$", "request", ")", ";", "$", "credentials", "=", "$", "this", "->", "accessProvider", "->", "refresh", "(", "$", "request", ",", "$", "refreshCode", ",", "$", "clientSecret", ")", ";", "$", "response", "=", "new", "JsonResponse", "(", "[", "'access_code'", "=>", "$", "credentials", "->", "getAccessCode", "(", ")", ",", "'refresh_code'", "=>", "$", "credentials", "->", "getRefreshCode", "(", ")", ",", "'lifetime'", "=>", "$", "credentials", "->", "getLifetime", "(", ")", "]", ")", ";", "}", "catch", "(", "SoauthException", "$", "e", ")", "{", "$", "data", "=", "[", "]", ";", "if", "(", "$", "e", "instanceof", "BadDataException", ")", "{", "$", "data", "[", "'errors'", "]", "=", "$", "e", "->", "getErrors", "(", ")", ";", "}", "$", "response", "=", "new", "JsonResponse", "(", "$", "data", ",", "Response", "::", "HTTP_BAD_REQUEST", ")", ";", "}", "$", "this", "->", "info", "(", "'< Response'", ",", "[", "'status_code'", "=>", "$", "response", "->", "getStatusCode", "(", ")", "]", ")", ";", "return", "$", "response", ";", "}" ]
refresh a given access credentials @param $request @return string|Response
[ "refresh", "a", "given", "access", "credentials" ]
c0141918740601b7cd0f03ad42d2e248ef2d6da0
https://github.com/renegare/soauth/blob/c0141918740601b7cd0f03ad42d2e248ef2d6da0/src/Controller/Access.php#L69-L94
6,812
tux-rampage/rampage-php
library/rampage/core/resources/StaticResourcePublishingStrategy.php
StaticResourcePublishingStrategy.publish
public function publish($targetDir = null, array $extensions = array()) { if (!$targetDir) { $targetDir = $this->targetDir; } $this->publishResources($targetDir, $extensions); $this->publishThemeFiles($targetDir, $extensions); return $this; }
php
public function publish($targetDir = null, array $extensions = array()) { if (!$targetDir) { $targetDir = $this->targetDir; } $this->publishResources($targetDir, $extensions); $this->publishThemeFiles($targetDir, $extensions); return $this; }
[ "public", "function", "publish", "(", "$", "targetDir", "=", "null", ",", "array", "$", "extensions", "=", "array", "(", ")", ")", "{", "if", "(", "!", "$", "targetDir", ")", "{", "$", "targetDir", "=", "$", "this", "->", "targetDir", ";", "}", "$", "this", "->", "publishResources", "(", "$", "targetDir", ",", "$", "extensions", ")", ";", "$", "this", "->", "publishThemeFiles", "(", "$", "targetDir", ",", "$", "extensions", ")", ";", "return", "$", "this", ";", "}" ]
Publish all module resources @param string $targetDir @param array $extensions
[ "Publish", "all", "module", "resources" ]
1c679b04a6d477e2f8fdb86135e1d9f0c128b1cf
https://github.com/tux-rampage/rampage-php/blob/1c679b04a6d477e2f8fdb86135e1d9f0c128b1cf/library/rampage/core/resources/StaticResourcePublishingStrategy.php#L330-L340
6,813
consolle/framework
src/Utils/Error.php
Error.create
public function create($msg) { // Verificar se mensagem pode ser traduzida pelo sistema da Lang do Laravel if (is_string($msg) && ($this->lang->has($msg))) $msg = $this->lang->get($msg); // Se msg for um objeto ou array deve fazer um print_r if (is_object($msg) || is_array($msg)) $msg = print_r($msg, true); $args = func_get_args(); $args[0] = $msg; $msg = trim(call_user_func_array('sprintf', $args)); $code = $args[count($args) - 1]; if (is_numeric($code)) return new \Exception($msg, $code); else return new \Exception($msg); }
php
public function create($msg) { // Verificar se mensagem pode ser traduzida pelo sistema da Lang do Laravel if (is_string($msg) && ($this->lang->has($msg))) $msg = $this->lang->get($msg); // Se msg for um objeto ou array deve fazer um print_r if (is_object($msg) || is_array($msg)) $msg = print_r($msg, true); $args = func_get_args(); $args[0] = $msg; $msg = trim(call_user_func_array('sprintf', $args)); $code = $args[count($args) - 1]; if (is_numeric($code)) return new \Exception($msg, $code); else return new \Exception($msg); }
[ "public", "function", "create", "(", "$", "msg", ")", "{", "// Verificar se mensagem pode ser traduzida pelo sistema da Lang do Laravel", "if", "(", "is_string", "(", "$", "msg", ")", "&&", "(", "$", "this", "->", "lang", "->", "has", "(", "$", "msg", ")", ")", ")", "$", "msg", "=", "$", "this", "->", "lang", "->", "get", "(", "$", "msg", ")", ";", "// Se msg for um objeto ou array deve fazer um print_r", "if", "(", "is_object", "(", "$", "msg", ")", "||", "is_array", "(", "$", "msg", ")", ")", "$", "msg", "=", "print_r", "(", "$", "msg", ",", "true", ")", ";", "$", "args", "=", "func_get_args", "(", ")", ";", "$", "args", "[", "0", "]", "=", "$", "msg", ";", "$", "msg", "=", "trim", "(", "call_user_func_array", "(", "'sprintf'", ",", "$", "args", ")", ")", ";", "$", "code", "=", "$", "args", "[", "count", "(", "$", "args", ")", "-", "1", "]", ";", "if", "(", "is_numeric", "(", "$", "code", ")", ")", "return", "new", "\\", "Exception", "(", "$", "msg", ",", "$", "code", ")", ";", "else", "return", "new", "\\", "Exception", "(", "$", "msg", ")", ";", "}" ]
Gera uma excecao e retorna o Exception @param $msg @return \Exception
[ "Gera", "uma", "excecao", "e", "retorna", "o", "Exception" ]
2799921d6983f31e775099eac116c337bbe29c74
https://github.com/consolle/framework/blob/2799921d6983f31e775099eac116c337bbe29c74/src/Utils/Error.php#L20-L40
6,814
netcore/module-category
Jobs/RegenerateCategoryFullSlugs.php
RegenerateCategoryFullSlugs.setCategoryFullSlug
private function setCategoryFullSlug(Category $category): void { static $languages; if (! $languages) { $languages = $this->language ? [$this->language] : TransHelper::getAllLanguages(); } foreach ($languages as $language) { $category->translations()->where('locale', $language->iso_code)->update([ 'full_slug' => $this->getSlugForCategory($category->id, $language->iso_code), ]); } foreach ($category->descendants()->get() as $descendant) { foreach ($languages as $language) { $descendant->translations()->where('locale', $language->iso_code)->update([ 'full_slug' => $this->getSlugForCategory($descendant->id, $language->iso_code), ]); } } }
php
private function setCategoryFullSlug(Category $category): void { static $languages; if (! $languages) { $languages = $this->language ? [$this->language] : TransHelper::getAllLanguages(); } foreach ($languages as $language) { $category->translations()->where('locale', $language->iso_code)->update([ 'full_slug' => $this->getSlugForCategory($category->id, $language->iso_code), ]); } foreach ($category->descendants()->get() as $descendant) { foreach ($languages as $language) { $descendant->translations()->where('locale', $language->iso_code)->update([ 'full_slug' => $this->getSlugForCategory($descendant->id, $language->iso_code), ]); } } }
[ "private", "function", "setCategoryFullSlug", "(", "Category", "$", "category", ")", ":", "void", "{", "static", "$", "languages", ";", "if", "(", "!", "$", "languages", ")", "{", "$", "languages", "=", "$", "this", "->", "language", "?", "[", "$", "this", "->", "language", "]", ":", "TransHelper", "::", "getAllLanguages", "(", ")", ";", "}", "foreach", "(", "$", "languages", "as", "$", "language", ")", "{", "$", "category", "->", "translations", "(", ")", "->", "where", "(", "'locale'", ",", "$", "language", "->", "iso_code", ")", "->", "update", "(", "[", "'full_slug'", "=>", "$", "this", "->", "getSlugForCategory", "(", "$", "category", "->", "id", ",", "$", "language", "->", "iso_code", ")", ",", "]", ")", ";", "}", "foreach", "(", "$", "category", "->", "descendants", "(", ")", "->", "get", "(", ")", "as", "$", "descendant", ")", "{", "foreach", "(", "$", "languages", "as", "$", "language", ")", "{", "$", "descendant", "->", "translations", "(", ")", "->", "where", "(", "'locale'", ",", "$", "language", "->", "iso_code", ")", "->", "update", "(", "[", "'full_slug'", "=>", "$", "this", "->", "getSlugForCategory", "(", "$", "descendant", "->", "id", ",", "$", "language", "->", "iso_code", ")", ",", "]", ")", ";", "}", "}", "}" ]
Generate full slug for category @param Category $category @return void
[ "Generate", "full", "slug", "for", "category" ]
61a4fc2525774f8ddea730ad9f6f06644552adf7
https://github.com/netcore/module-category/blob/61a4fc2525774f8ddea730ad9f6f06644552adf7/Jobs/RegenerateCategoryFullSlugs.php#L80-L101
6,815
netcore/module-category
Jobs/RegenerateCategoryFullSlugs.php
RegenerateCategoryFullSlugs.getSlugForCategory
private function getSlugForCategory(int $categoryId, string $locale): string { $reversed = array_reverse( $this->getSlugParts($categoryId, $locale) ); return implode('/', $reversed); }
php
private function getSlugForCategory(int $categoryId, string $locale): string { $reversed = array_reverse( $this->getSlugParts($categoryId, $locale) ); return implode('/', $reversed); }
[ "private", "function", "getSlugForCategory", "(", "int", "$", "categoryId", ",", "string", "$", "locale", ")", ":", "string", "{", "$", "reversed", "=", "array_reverse", "(", "$", "this", "->", "getSlugParts", "(", "$", "categoryId", ",", "$", "locale", ")", ")", ";", "return", "implode", "(", "'/'", ",", "$", "reversed", ")", ";", "}" ]
Build full slug for category @param int $categoryId @param string $locale @return string
[ "Build", "full", "slug", "for", "category" ]
61a4fc2525774f8ddea730ad9f6f06644552adf7
https://github.com/netcore/module-category/blob/61a4fc2525774f8ddea730ad9f6f06644552adf7/Jobs/RegenerateCategoryFullSlugs.php#L110-L117
6,816
netcore/module-category
Jobs/RegenerateCategoryFullSlugs.php
RegenerateCategoryFullSlugs.getSlugParts
private function getSlugParts(int $categoryId, string $locale): array { $category = $this->repo->getCategoriesPlain()->where('id', $categoryId)->first(); $slugParts = []; if (!$category) { // Try to fetch from DB $category = Category::find($categoryId); if (!$category) { return []; } $category = [ 'id' => $category->id, 'parent_id' => $category->parent_id, 'slugs' => $category->translations->pluck('slug', 'locale')->toArray(), ]; } $slugParts[] = array_get($category, 'slugs.' . $locale); if (isset($category['parent_id']) && $category['parent_id']) { $slugParts = array_merge($slugParts, $this->getSlugParts($category['parent_id'], $locale)); } return $slugParts; }
php
private function getSlugParts(int $categoryId, string $locale): array { $category = $this->repo->getCategoriesPlain()->where('id', $categoryId)->first(); $slugParts = []; if (!$category) { // Try to fetch from DB $category = Category::find($categoryId); if (!$category) { return []; } $category = [ 'id' => $category->id, 'parent_id' => $category->parent_id, 'slugs' => $category->translations->pluck('slug', 'locale')->toArray(), ]; } $slugParts[] = array_get($category, 'slugs.' . $locale); if (isset($category['parent_id']) && $category['parent_id']) { $slugParts = array_merge($slugParts, $this->getSlugParts($category['parent_id'], $locale)); } return $slugParts; }
[ "private", "function", "getSlugParts", "(", "int", "$", "categoryId", ",", "string", "$", "locale", ")", ":", "array", "{", "$", "category", "=", "$", "this", "->", "repo", "->", "getCategoriesPlain", "(", ")", "->", "where", "(", "'id'", ",", "$", "categoryId", ")", "->", "first", "(", ")", ";", "$", "slugParts", "=", "[", "]", ";", "if", "(", "!", "$", "category", ")", "{", "// Try to fetch from DB", "$", "category", "=", "Category", "::", "find", "(", "$", "categoryId", ")", ";", "if", "(", "!", "$", "category", ")", "{", "return", "[", "]", ";", "}", "$", "category", "=", "[", "'id'", "=>", "$", "category", "->", "id", ",", "'parent_id'", "=>", "$", "category", "->", "parent_id", ",", "'slugs'", "=>", "$", "category", "->", "translations", "->", "pluck", "(", "'slug'", ",", "'locale'", ")", "->", "toArray", "(", ")", ",", "]", ";", "}", "$", "slugParts", "[", "]", "=", "array_get", "(", "$", "category", ",", "'slugs.'", ".", "$", "locale", ")", ";", "if", "(", "isset", "(", "$", "category", "[", "'parent_id'", "]", ")", "&&", "$", "category", "[", "'parent_id'", "]", ")", "{", "$", "slugParts", "=", "array_merge", "(", "$", "slugParts", ",", "$", "this", "->", "getSlugParts", "(", "$", "category", "[", "'parent_id'", "]", ",", "$", "locale", ")", ")", ";", "}", "return", "$", "slugParts", ";", "}" ]
Get slug parts recursively without querying database @param int $categoryId @param string $locale @return array
[ "Get", "slug", "parts", "recursively", "without", "querying", "database" ]
61a4fc2525774f8ddea730ad9f6f06644552adf7
https://github.com/netcore/module-category/blob/61a4fc2525774f8ddea730ad9f6f06644552adf7/Jobs/RegenerateCategoryFullSlugs.php#L126-L153
6,817
anklimsk/cakephp-extended-test
Vendor/PHPHtmlParser/paquettg/php-html-parser/src/PHPHtmlParser/Dom.php
Dom.clean
protected function clean($str) { if ($this->options->get('cleanupInput') != true) { // skip entire cleanup step return $str; } // remove white space before closing tags $str = mb_eregi_replace("'\s+>", "'>", $str); $str = mb_eregi_replace('"\s+>', '">', $str); // clean out the \n\r $replace = ' '; if ($this->options->get('preserveLineBreaks')) { $replace = '&#10;'; } $str = str_replace(["\r\n", "\r", "\n"], $replace, $str); // strip the doctype $str = mb_eregi_replace("<!doctype(.*?)>", '', $str); // strip out comments $str = mb_eregi_replace("<!--(.*?)-->", '', $str); // strip out cdata $str = mb_eregi_replace("<!\[CDATA\[(.*?)\]\]>", '', $str); // strip out <script> tags if ($this->options->get('removeScripts') == true) { $str = mb_eregi_replace("<\s*script[^>]*[^/]>(.*?)<\s*/\s*script\s*>", '', $str); $str = mb_eregi_replace("<\s*script\s*>(.*?)<\s*/\s*script\s*>", '', $str); } // strip out <style> tags if ($this->options->get('removeStyles') == true) { $str = mb_eregi_replace("<\s*style[^>]*[^/]>(.*?)<\s*/\s*style\s*>", '', $str); $str = mb_eregi_replace("<\s*style\s*>(.*?)<\s*/\s*style\s*>", '', $str); } // strip out server side scripts $str = mb_eregi_replace("(<\?)(.*?)(\?>)", '', $str); // strip smarty scripts $str = mb_eregi_replace("(\{\w)(.*?)(\})", '', $str); return $str; }
php
protected function clean($str) { if ($this->options->get('cleanupInput') != true) { // skip entire cleanup step return $str; } // remove white space before closing tags $str = mb_eregi_replace("'\s+>", "'>", $str); $str = mb_eregi_replace('"\s+>', '">', $str); // clean out the \n\r $replace = ' '; if ($this->options->get('preserveLineBreaks')) { $replace = '&#10;'; } $str = str_replace(["\r\n", "\r", "\n"], $replace, $str); // strip the doctype $str = mb_eregi_replace("<!doctype(.*?)>", '', $str); // strip out comments $str = mb_eregi_replace("<!--(.*?)-->", '', $str); // strip out cdata $str = mb_eregi_replace("<!\[CDATA\[(.*?)\]\]>", '', $str); // strip out <script> tags if ($this->options->get('removeScripts') == true) { $str = mb_eregi_replace("<\s*script[^>]*[^/]>(.*?)<\s*/\s*script\s*>", '', $str); $str = mb_eregi_replace("<\s*script\s*>(.*?)<\s*/\s*script\s*>", '', $str); } // strip out <style> tags if ($this->options->get('removeStyles') == true) { $str = mb_eregi_replace("<\s*style[^>]*[^/]>(.*?)<\s*/\s*style\s*>", '', $str); $str = mb_eregi_replace("<\s*style\s*>(.*?)<\s*/\s*style\s*>", '', $str); } // strip out server side scripts $str = mb_eregi_replace("(<\?)(.*?)(\?>)", '', $str); // strip smarty scripts $str = mb_eregi_replace("(\{\w)(.*?)(\})", '', $str); return $str; }
[ "protected", "function", "clean", "(", "$", "str", ")", "{", "if", "(", "$", "this", "->", "options", "->", "get", "(", "'cleanupInput'", ")", "!=", "true", ")", "{", "// skip entire cleanup step", "return", "$", "str", ";", "}", "// remove white space before closing tags", "$", "str", "=", "mb_eregi_replace", "(", "\"'\\s+>\"", ",", "\"'>\"", ",", "$", "str", ")", ";", "$", "str", "=", "mb_eregi_replace", "(", "'\"\\s+>'", ",", "'\">'", ",", "$", "str", ")", ";", "// clean out the \\n\\r", "$", "replace", "=", "' '", ";", "if", "(", "$", "this", "->", "options", "->", "get", "(", "'preserveLineBreaks'", ")", ")", "{", "$", "replace", "=", "'&#10;'", ";", "}", "$", "str", "=", "str_replace", "(", "[", "\"\\r\\n\"", ",", "\"\\r\"", ",", "\"\\n\"", "]", ",", "$", "replace", ",", "$", "str", ")", ";", "// strip the doctype", "$", "str", "=", "mb_eregi_replace", "(", "\"<!doctype(.*?)>\"", ",", "''", ",", "$", "str", ")", ";", "// strip out comments", "$", "str", "=", "mb_eregi_replace", "(", "\"<!--(.*?)-->\"", ",", "''", ",", "$", "str", ")", ";", "// strip out cdata", "$", "str", "=", "mb_eregi_replace", "(", "\"<!\\[CDATA\\[(.*?)\\]\\]>\"", ",", "''", ",", "$", "str", ")", ";", "// strip out <script> tags", "if", "(", "$", "this", "->", "options", "->", "get", "(", "'removeScripts'", ")", "==", "true", ")", "{", "$", "str", "=", "mb_eregi_replace", "(", "\"<\\s*script[^>]*[^/]>(.*?)<\\s*/\\s*script\\s*>\"", ",", "''", ",", "$", "str", ")", ";", "$", "str", "=", "mb_eregi_replace", "(", "\"<\\s*script\\s*>(.*?)<\\s*/\\s*script\\s*>\"", ",", "''", ",", "$", "str", ")", ";", "}", "// strip out <style> tags", "if", "(", "$", "this", "->", "options", "->", "get", "(", "'removeStyles'", ")", "==", "true", ")", "{", "$", "str", "=", "mb_eregi_replace", "(", "\"<\\s*style[^>]*[^/]>(.*?)<\\s*/\\s*style\\s*>\"", ",", "''", ",", "$", "str", ")", ";", "$", "str", "=", "mb_eregi_replace", "(", "\"<\\s*style\\s*>(.*?)<\\s*/\\s*style\\s*>\"", ",", "''", ",", "$", "str", ")", ";", "}", "// strip out server side scripts", "$", "str", "=", "mb_eregi_replace", "(", "\"(<\\?)(.*?)(\\?>)\"", ",", "''", ",", "$", "str", ")", ";", "// strip smarty scripts", "$", "str", "=", "mb_eregi_replace", "(", "\"(\\{\\w)(.*?)(\\})\"", ",", "''", ",", "$", "str", ")", ";", "return", "$", "str", ";", "}" ]
Cleans the html of any none-html information. @param string $str @return string
[ "Cleans", "the", "html", "of", "any", "none", "-", "html", "information", "." ]
21691a3be8a198419feb92fb6ed3b35a14dc24b1
https://github.com/anklimsk/cakephp-extended-test/blob/21691a3be8a198419feb92fb6ed3b35a14dc24b1/Vendor/PHPHtmlParser/paquettg/php-html-parser/src/PHPHtmlParser/Dom.php#L354-L400
6,818
mtoolkit/mtoolkit-controller
src/MPageController.php
MPageController.renderCss
protected function renderCss() { $html = ""; foreach( $this->css as $item ) { $html .= sprintf( MPageController::CSS_TEMPLATE, $item["rel"], $item["href"], $item["media"] ) . "\n"; } $domQuery = $this->qp->find( "head" ); if( $domQuery->count() <= 0 ) { trigger_error( 'head tag not found in page', E_USER_WARNING ); } else { $domQuery->append( $html ); } }
php
protected function renderCss() { $html = ""; foreach( $this->css as $item ) { $html .= sprintf( MPageController::CSS_TEMPLATE, $item["rel"], $item["href"], $item["media"] ) . "\n"; } $domQuery = $this->qp->find( "head" ); if( $domQuery->count() <= 0 ) { trigger_error( 'head tag not found in page', E_USER_WARNING ); } else { $domQuery->append( $html ); } }
[ "protected", "function", "renderCss", "(", ")", "{", "$", "html", "=", "\"\"", ";", "foreach", "(", "$", "this", "->", "css", "as", "$", "item", ")", "{", "$", "html", ".=", "sprintf", "(", "MPageController", "::", "CSS_TEMPLATE", ",", "$", "item", "[", "\"rel\"", "]", ",", "$", "item", "[", "\"href\"", "]", ",", "$", "item", "[", "\"media\"", "]", ")", ".", "\"\\n\"", ";", "}", "$", "domQuery", "=", "$", "this", "->", "qp", "->", "find", "(", "\"head\"", ")", ";", "if", "(", "$", "domQuery", "->", "count", "(", ")", "<=", "0", ")", "{", "trigger_error", "(", "'head tag not found in page'", ",", "E_USER_WARNING", ")", ";", "}", "else", "{", "$", "domQuery", "->", "append", "(", "$", "html", ")", ";", "}", "}" ]
Render the link tag for CSS at the end of head tag.
[ "Render", "the", "link", "tag", "for", "CSS", "at", "the", "end", "of", "head", "tag", "." ]
519a40ad12d0835e45aefa5668936f15167ce07c
https://github.com/mtoolkit/mtoolkit-controller/blob/519a40ad12d0835e45aefa5668936f15167ce07c/src/MPageController.php#L109-L127
6,819
mtoolkit/mtoolkit-controller
src/MPageController.php
MPageController.renderJavascript
protected function renderJavascript() { $html = ""; foreach( $this->javascript as $item ) { $html .= sprintf( MPageController::JAVASCRIPT_TEMPLATE, $item["src"] ) . "\n"; } $domQuery = $this->qp->find( "head" ); if( $domQuery->count() <= 0 ) { trigger_error( 'head tag not found in page', E_USER_WARNING ); } else { $domQuery->append( $html ); } }
php
protected function renderJavascript() { $html = ""; foreach( $this->javascript as $item ) { $html .= sprintf( MPageController::JAVASCRIPT_TEMPLATE, $item["src"] ) . "\n"; } $domQuery = $this->qp->find( "head" ); if( $domQuery->count() <= 0 ) { trigger_error( 'head tag not found in page', E_USER_WARNING ); } else { $domQuery->append( $html ); } }
[ "protected", "function", "renderJavascript", "(", ")", "{", "$", "html", "=", "\"\"", ";", "foreach", "(", "$", "this", "->", "javascript", "as", "$", "item", ")", "{", "$", "html", ".=", "sprintf", "(", "MPageController", "::", "JAVASCRIPT_TEMPLATE", ",", "$", "item", "[", "\"src\"", "]", ")", ".", "\"\\n\"", ";", "}", "$", "domQuery", "=", "$", "this", "->", "qp", "->", "find", "(", "\"head\"", ")", ";", "if", "(", "$", "domQuery", "->", "count", "(", ")", "<=", "0", ")", "{", "trigger_error", "(", "'head tag not found in page'", ",", "E_USER_WARNING", ")", ";", "}", "else", "{", "$", "domQuery", "->", "append", "(", "$", "html", ")", ";", "}", "}" ]
Render the script tag for Javascript at the end of head tag.
[ "Render", "the", "script", "tag", "for", "Javascript", "at", "the", "end", "of", "head", "tag", "." ]
519a40ad12d0835e45aefa5668936f15167ce07c
https://github.com/mtoolkit/mtoolkit-controller/blob/519a40ad12d0835e45aefa5668936f15167ce07c/src/MPageController.php#L132-L150
6,820
mtoolkit/mtoolkit-controller
src/MPageController.php
MPageController.renderTitle
protected function renderTitle() { // Render page title if( $this->pageTitle != null ) { $title = mb_convert_encoding( $this->pageTitle, $this->getCharset(), 'auto' ); $domQuery = $this->qp->find( "title" ); if( $domQuery->count() <= 0 ) { trigger_error( 'title tag not found in page', E_USER_WARNING ); } else { $domQuery->append( $title ); } } }
php
protected function renderTitle() { // Render page title if( $this->pageTitle != null ) { $title = mb_convert_encoding( $this->pageTitle, $this->getCharset(), 'auto' ); $domQuery = $this->qp->find( "title" ); if( $domQuery->count() <= 0 ) { trigger_error( 'title tag not found in page', E_USER_WARNING ); } else { $domQuery->append( $title ); } } }
[ "protected", "function", "renderTitle", "(", ")", "{", "// Render page title", "if", "(", "$", "this", "->", "pageTitle", "!=", "null", ")", "{", "$", "title", "=", "mb_convert_encoding", "(", "$", "this", "->", "pageTitle", ",", "$", "this", "->", "getCharset", "(", ")", ",", "'auto'", ")", ";", "$", "domQuery", "=", "$", "this", "->", "qp", "->", "find", "(", "\"title\"", ")", ";", "if", "(", "$", "domQuery", "->", "count", "(", ")", "<=", "0", ")", "{", "trigger_error", "(", "'title tag not found in page'", ",", "E_USER_WARNING", ")", ";", "}", "else", "{", "$", "domQuery", "->", "append", "(", "$", "title", ")", ";", "}", "}", "}" ]
Write the title in the title tag of the page.
[ "Write", "the", "title", "in", "the", "title", "tag", "of", "the", "page", "." ]
519a40ad12d0835e45aefa5668936f15167ce07c
https://github.com/mtoolkit/mtoolkit-controller/blob/519a40ad12d0835e45aefa5668936f15167ce07c/src/MPageController.php#L246-L263
6,821
10usb/css-lib
src/values/Measurement.php
Measurement.convert
public static function convert($number, $from, $to, $ratio = 0.75){ switch($from){ case 'in': switch($to){ case 'in': return $number; case 'cm': return $number * 2.54; case 'mm': return $number * 25.4; case 'pt': return $number * 72; case 'pc': return $number * 6; case 'px': return $number * 72 * $ratio; } case 'cm': switch($to){ case 'in': return $number / 2.54; case 'cm': return $number; case 'mm': return $number / 10; case 'pt': return $number * 72 / 2.54; case 'pc': return $number * 6 / 2.54; case 'px': return $number * 72 * $ratio / 2.54; } case 'mm': switch($to){ case 'in': return $number / 25.4; case 'cm': return $number * 10; case 'mm': return $number; case 'pt': return $number * 72 / 25.4; case 'pc': return $number * 6 / 25.4; case 'px': return $number * 72 * $ratio / 25.4; } case 'pt': switch($to){ case 'in': return $number / 72; case 'cm': return $number * 2.54 / 72; case 'mm': return $number * 25.4 / 72; case 'pt': return $number; case 'pc': return $number * 12; case 'px': return $number * 72 * $ratio / 72; } case 'pc': switch($to){ case 'in': return $number / 6; case 'cm': return $number * 2.54 / 6; case 'mm': return $number * 25.4 / 6; case 'pt': return $number / 12; case 'pc': return $number; case 'px': return $number * 72 * $ratio / 6; } case 'px': switch($to){ case 'in': return $number / 72 * $ratio; case 'cm': return $number * 2.54 / 72 * $ratio; case 'mm': return $number * 25.4 / 72 * $ratio; case 'pt': return $number * $ratio; case 'pc': return $number * 6 / 72 * $ratio; case 'px': return $number; } } throw new \Exception("Invalid conversion from $from to $to with a value of $number"); }
php
public static function convert($number, $from, $to, $ratio = 0.75){ switch($from){ case 'in': switch($to){ case 'in': return $number; case 'cm': return $number * 2.54; case 'mm': return $number * 25.4; case 'pt': return $number * 72; case 'pc': return $number * 6; case 'px': return $number * 72 * $ratio; } case 'cm': switch($to){ case 'in': return $number / 2.54; case 'cm': return $number; case 'mm': return $number / 10; case 'pt': return $number * 72 / 2.54; case 'pc': return $number * 6 / 2.54; case 'px': return $number * 72 * $ratio / 2.54; } case 'mm': switch($to){ case 'in': return $number / 25.4; case 'cm': return $number * 10; case 'mm': return $number; case 'pt': return $number * 72 / 25.4; case 'pc': return $number * 6 / 25.4; case 'px': return $number * 72 * $ratio / 25.4; } case 'pt': switch($to){ case 'in': return $number / 72; case 'cm': return $number * 2.54 / 72; case 'mm': return $number * 25.4 / 72; case 'pt': return $number; case 'pc': return $number * 12; case 'px': return $number * 72 * $ratio / 72; } case 'pc': switch($to){ case 'in': return $number / 6; case 'cm': return $number * 2.54 / 6; case 'mm': return $number * 25.4 / 6; case 'pt': return $number / 12; case 'pc': return $number; case 'px': return $number * 72 * $ratio / 6; } case 'px': switch($to){ case 'in': return $number / 72 * $ratio; case 'cm': return $number * 2.54 / 72 * $ratio; case 'mm': return $number * 25.4 / 72 * $ratio; case 'pt': return $number * $ratio; case 'pc': return $number * 6 / 72 * $ratio; case 'px': return $number; } } throw new \Exception("Invalid conversion from $from to $to with a value of $number"); }
[ "public", "static", "function", "convert", "(", "$", "number", ",", "$", "from", ",", "$", "to", ",", "$", "ratio", "=", "0.75", ")", "{", "switch", "(", "$", "from", ")", "{", "case", "'in'", ":", "switch", "(", "$", "to", ")", "{", "case", "'in'", ":", "return", "$", "number", ";", "case", "'cm'", ":", "return", "$", "number", "*", "2.54", ";", "case", "'mm'", ":", "return", "$", "number", "*", "25.4", ";", "case", "'pt'", ":", "return", "$", "number", "*", "72", ";", "case", "'pc'", ":", "return", "$", "number", "*", "6", ";", "case", "'px'", ":", "return", "$", "number", "*", "72", "*", "$", "ratio", ";", "}", "case", "'cm'", ":", "switch", "(", "$", "to", ")", "{", "case", "'in'", ":", "return", "$", "number", "/", "2.54", ";", "case", "'cm'", ":", "return", "$", "number", ";", "case", "'mm'", ":", "return", "$", "number", "/", "10", ";", "case", "'pt'", ":", "return", "$", "number", "*", "72", "/", "2.54", ";", "case", "'pc'", ":", "return", "$", "number", "*", "6", "/", "2.54", ";", "case", "'px'", ":", "return", "$", "number", "*", "72", "*", "$", "ratio", "/", "2.54", ";", "}", "case", "'mm'", ":", "switch", "(", "$", "to", ")", "{", "case", "'in'", ":", "return", "$", "number", "/", "25.4", ";", "case", "'cm'", ":", "return", "$", "number", "*", "10", ";", "case", "'mm'", ":", "return", "$", "number", ";", "case", "'pt'", ":", "return", "$", "number", "*", "72", "/", "25.4", ";", "case", "'pc'", ":", "return", "$", "number", "*", "6", "/", "25.4", ";", "case", "'px'", ":", "return", "$", "number", "*", "72", "*", "$", "ratio", "/", "25.4", ";", "}", "case", "'pt'", ":", "switch", "(", "$", "to", ")", "{", "case", "'in'", ":", "return", "$", "number", "/", "72", ";", "case", "'cm'", ":", "return", "$", "number", "*", "2.54", "/", "72", ";", "case", "'mm'", ":", "return", "$", "number", "*", "25.4", "/", "72", ";", "case", "'pt'", ":", "return", "$", "number", ";", "case", "'pc'", ":", "return", "$", "number", "*", "12", ";", "case", "'px'", ":", "return", "$", "number", "*", "72", "*", "$", "ratio", "/", "72", ";", "}", "case", "'pc'", ":", "switch", "(", "$", "to", ")", "{", "case", "'in'", ":", "return", "$", "number", "/", "6", ";", "case", "'cm'", ":", "return", "$", "number", "*", "2.54", "/", "6", ";", "case", "'mm'", ":", "return", "$", "number", "*", "25.4", "/", "6", ";", "case", "'pt'", ":", "return", "$", "number", "/", "12", ";", "case", "'pc'", ":", "return", "$", "number", ";", "case", "'px'", ":", "return", "$", "number", "*", "72", "*", "$", "ratio", "/", "6", ";", "}", "case", "'px'", ":", "switch", "(", "$", "to", ")", "{", "case", "'in'", ":", "return", "$", "number", "/", "72", "*", "$", "ratio", ";", "case", "'cm'", ":", "return", "$", "number", "*", "2.54", "/", "72", "*", "$", "ratio", ";", "case", "'mm'", ":", "return", "$", "number", "*", "25.4", "/", "72", "*", "$", "ratio", ";", "case", "'pt'", ":", "return", "$", "number", "*", "$", "ratio", ";", "case", "'pc'", ":", "return", "$", "number", "*", "6", "/", "72", "*", "$", "ratio", ";", "case", "'px'", ":", "return", "$", "number", ";", "}", "}", "throw", "new", "\\", "Exception", "(", "\"Invalid conversion from $from to $to with a value of $number\"", ")", ";", "}" ]
Convert units from x to y @param number $number Value to convert @param string $from Unit the value it in @param string $to Unit the value need to be converted to @return number
[ "Convert", "units", "from", "x", "to", "y" ]
6370b1404bae3eecb44c214ed4eaaf33113858dd
https://github.com/10usb/css-lib/blob/6370b1404bae3eecb44c214ed4eaaf33113858dd/src/values/Measurement.php#L58-L111
6,822
covex-nn/vfs
src/Changes.php
Changes.get
public function get(string $path): ?EntityInterface { $entity = null; $name = null; $subtree = $this->subtree($path, $name); if (null !== $subtree && isset($subtree->ownData[$name])) { $entity = $subtree->ownData[$name]; } return $entity; }
php
public function get(string $path): ?EntityInterface { $entity = null; $name = null; $subtree = $this->subtree($path, $name); if (null !== $subtree && isset($subtree->ownData[$name])) { $entity = $subtree->ownData[$name]; } return $entity; }
[ "public", "function", "get", "(", "string", "$", "path", ")", ":", "?", "EntityInterface", "{", "$", "entity", "=", "null", ";", "$", "name", "=", "null", ";", "$", "subtree", "=", "$", "this", "->", "subtree", "(", "$", "path", ",", "$", "name", ")", ";", "if", "(", "null", "!==", "$", "subtree", "&&", "isset", "(", "$", "subtree", "->", "ownData", "[", "$", "name", "]", ")", ")", "{", "$", "entity", "=", "$", "subtree", "->", "ownData", "[", "$", "name", "]", ";", "}", "return", "$", "entity", ";", "}" ]
Get stream entity.
[ "Get", "stream", "entity", "." ]
77ee7406ab32508c4671adf1153dc5b67bdab599
https://github.com/covex-nn/vfs/blob/77ee7406ab32508c4671adf1153dc5b67bdab599/src/Changes.php#L40-L51
6,823
covex-nn/vfs
src/Changes.php
Changes.add
public function add(string $path, EntityInterface $entity): bool { $result = false; if (strlen($path)) { $name = null; $subtree = $this->subtree($path, $name, true); $subtree->ownData[$name] = $entity; $result = true; } return $result; }
php
public function add(string $path, EntityInterface $entity): bool { $result = false; if (strlen($path)) { $name = null; $subtree = $this->subtree($path, $name, true); $subtree->ownData[$name] = $entity; $result = true; } return $result; }
[ "public", "function", "add", "(", "string", "$", "path", ",", "EntityInterface", "$", "entity", ")", ":", "bool", "{", "$", "result", "=", "false", ";", "if", "(", "strlen", "(", "$", "path", ")", ")", "{", "$", "name", "=", "null", ";", "$", "subtree", "=", "$", "this", "->", "subtree", "(", "$", "path", ",", "$", "name", ",", "true", ")", ";", "$", "subtree", "->", "ownData", "[", "$", "name", "]", "=", "$", "entity", ";", "$", "result", "=", "true", ";", "}", "return", "$", "result", ";", "}" ]
Add stream entity to array.
[ "Add", "stream", "entity", "to", "array", "." ]
77ee7406ab32508c4671adf1153dc5b67bdab599
https://github.com/covex-nn/vfs/blob/77ee7406ab32508c4671adf1153dc5b67bdab599/src/Changes.php#L56-L69
6,824
covex-nn/vfs
src/Changes.php
Changes.delete
public function delete($path): bool { $result = false; $parts = $this->split($path); $name = array_shift($parts); if (!count($parts)) { if (isset($this->ownData[$name])) { unset($this->ownData[$name]); $result = true; } } elseif (isset($this->subTrees[$name])) { $subtree = $this->subTrees[$name]; $result = $subtree->delete($parts); if ($result && !$subtree->count()) { unset($this->subTrees[$name]); } } return $result; }
php
public function delete($path): bool { $result = false; $parts = $this->split($path); $name = array_shift($parts); if (!count($parts)) { if (isset($this->ownData[$name])) { unset($this->ownData[$name]); $result = true; } } elseif (isset($this->subTrees[$name])) { $subtree = $this->subTrees[$name]; $result = $subtree->delete($parts); if ($result && !$subtree->count()) { unset($this->subTrees[$name]); } } return $result; }
[ "public", "function", "delete", "(", "$", "path", ")", ":", "bool", "{", "$", "result", "=", "false", ";", "$", "parts", "=", "$", "this", "->", "split", "(", "$", "path", ")", ";", "$", "name", "=", "array_shift", "(", "$", "parts", ")", ";", "if", "(", "!", "count", "(", "$", "parts", ")", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "ownData", "[", "$", "name", "]", ")", ")", "{", "unset", "(", "$", "this", "->", "ownData", "[", "$", "name", "]", ")", ";", "$", "result", "=", "true", ";", "}", "}", "elseif", "(", "isset", "(", "$", "this", "->", "subTrees", "[", "$", "name", "]", ")", ")", "{", "$", "subtree", "=", "$", "this", "->", "subTrees", "[", "$", "name", "]", ";", "$", "result", "=", "$", "subtree", "->", "delete", "(", "$", "parts", ")", ";", "if", "(", "$", "result", "&&", "!", "$", "subtree", "->", "count", "(", ")", ")", "{", "unset", "(", "$", "this", "->", "subTrees", "[", "$", "name", "]", ")", ";", "}", "}", "return", "$", "result", ";", "}" ]
Delete stream entity from array. @param string|array $path
[ "Delete", "stream", "entity", "from", "array", "." ]
77ee7406ab32508c4671adf1153dc5b67bdab599
https://github.com/covex-nn/vfs/blob/77ee7406ab32508c4671adf1153dc5b67bdab599/src/Changes.php#L76-L96
6,825
covex-nn/vfs
src/Changes.php
Changes.own
public function own($path = ''): array { if ($path) { $parts = $this->split($path); $name = array_shift($parts); $own = []; if (isset($this->subTrees[$name])) { $subtree = $this->subTrees[$name]; $this->appendChildren( $own, $name, $subtree->own($parts) ); } } else { $own = $this->ownData; } return $own; }
php
public function own($path = ''): array { if ($path) { $parts = $this->split($path); $name = array_shift($parts); $own = []; if (isset($this->subTrees[$name])) { $subtree = $this->subTrees[$name]; $this->appendChildren( $own, $name, $subtree->own($parts) ); } } else { $own = $this->ownData; } return $own; }
[ "public", "function", "own", "(", "$", "path", "=", "''", ")", ":", "array", "{", "if", "(", "$", "path", ")", "{", "$", "parts", "=", "$", "this", "->", "split", "(", "$", "path", ")", ";", "$", "name", "=", "array_shift", "(", "$", "parts", ")", ";", "$", "own", "=", "[", "]", ";", "if", "(", "isset", "(", "$", "this", "->", "subTrees", "[", "$", "name", "]", ")", ")", "{", "$", "subtree", "=", "$", "this", "->", "subTrees", "[", "$", "name", "]", ";", "$", "this", "->", "appendChildren", "(", "$", "own", ",", "$", "name", ",", "$", "subtree", "->", "own", "(", "$", "parts", ")", ")", ";", "}", "}", "else", "{", "$", "own", "=", "$", "this", "->", "ownData", ";", "}", "return", "$", "own", ";", "}" ]
Get subtree's own changes. @param array|string $path @return EntityInterface[]
[ "Get", "subtree", "s", "own", "changes", "." ]
77ee7406ab32508c4671adf1153dc5b67bdab599
https://github.com/covex-nn/vfs/blob/77ee7406ab32508c4671adf1153dc5b67bdab599/src/Changes.php#L121-L139
6,826
covex-nn/vfs
src/Changes.php
Changes.subtree
public function subtree($path, string &$name = null, bool $create = false): ?self { $parts = $this->split($path); $dirOrFile = array_shift($parts); if (!count($parts)) { $name = $dirOrFile; $subtree = $this; } else { $exists = isset($this->subTrees[$dirOrFile]); if (!$exists && !$create) { $subtree = null; $name = null; } else { if (!$exists && $create) { $this->subTrees[$dirOrFile] = new self(); } $subtree = $this->subTrees[$dirOrFile]->subtree($parts, $name, $create); } } return $subtree; }
php
public function subtree($path, string &$name = null, bool $create = false): ?self { $parts = $this->split($path); $dirOrFile = array_shift($parts); if (!count($parts)) { $name = $dirOrFile; $subtree = $this; } else { $exists = isset($this->subTrees[$dirOrFile]); if (!$exists && !$create) { $subtree = null; $name = null; } else { if (!$exists && $create) { $this->subTrees[$dirOrFile] = new self(); } $subtree = $this->subTrees[$dirOrFile]->subtree($parts, $name, $create); } } return $subtree; }
[ "public", "function", "subtree", "(", "$", "path", ",", "string", "&", "$", "name", "=", "null", ",", "bool", "$", "create", "=", "false", ")", ":", "?", "self", "{", "$", "parts", "=", "$", "this", "->", "split", "(", "$", "path", ")", ";", "$", "dirOrFile", "=", "array_shift", "(", "$", "parts", ")", ";", "if", "(", "!", "count", "(", "$", "parts", ")", ")", "{", "$", "name", "=", "$", "dirOrFile", ";", "$", "subtree", "=", "$", "this", ";", "}", "else", "{", "$", "exists", "=", "isset", "(", "$", "this", "->", "subTrees", "[", "$", "dirOrFile", "]", ")", ";", "if", "(", "!", "$", "exists", "&&", "!", "$", "create", ")", "{", "$", "subtree", "=", "null", ";", "$", "name", "=", "null", ";", "}", "else", "{", "if", "(", "!", "$", "exists", "&&", "$", "create", ")", "{", "$", "this", "->", "subTrees", "[", "$", "dirOrFile", "]", "=", "new", "self", "(", ")", ";", "}", "$", "subtree", "=", "$", "this", "->", "subTrees", "[", "$", "dirOrFile", "]", "->", "subtree", "(", "$", "parts", ",", "$", "name", ",", "$", "create", ")", ";", "}", "}", "return", "$", "subtree", ";", "}" ]
Get subtree by path. @param string|array $path
[ "Get", "subtree", "by", "path", "." ]
77ee7406ab32508c4671adf1153dc5b67bdab599
https://github.com/covex-nn/vfs/blob/77ee7406ab32508c4671adf1153dc5b67bdab599/src/Changes.php#L176-L198
6,827
covex-nn/vfs
src/Changes.php
Changes.appendChildren
private function appendChildren(array &$children, string $name, array $new): void { foreach ($new as $key => $value) { $children[$name.'/'.$key] = $value; } }
php
private function appendChildren(array &$children, string $name, array $new): void { foreach ($new as $key => $value) { $children[$name.'/'.$key] = $value; } }
[ "private", "function", "appendChildren", "(", "array", "&", "$", "children", ",", "string", "$", "name", ",", "array", "$", "new", ")", ":", "void", "{", "foreach", "(", "$", "new", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "children", "[", "$", "name", ".", "'/'", ".", "$", "key", "]", "=", "$", "value", ";", "}", "}" ]
Add new children to array.
[ "Add", "new", "children", "to", "array", "." ]
77ee7406ab32508c4671adf1153dc5b67bdab599
https://github.com/covex-nn/vfs/blob/77ee7406ab32508c4671adf1153dc5b67bdab599/src/Changes.php#L229-L234
6,828
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.addChildren
public function addChildren($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass add to internal logic try { $this->doAddChildren($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_CHILDREN_ADD, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_CHILDREN_ADD, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function addChildren($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass add to internal logic try { $this->doAddChildren($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_CHILDREN_ADD, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_CHILDREN_ADD, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "addChildren", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass add to internal logic", "try", "{", "$", "this", "->", "doAddChildren", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_CHILDREN_ADD", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_CHILDREN_ADD", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Adds Children to Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Adds", "Children", "to", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L49-L76
6,829
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.addFunctionPhases
public function addFunctionPhases($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass add to internal logic try { $this->doAddFunctionPhases($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_FUNCTION_PHASES_ADD, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_FUNCTION_PHASES_ADD, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function addFunctionPhases($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass add to internal logic try { $this->doAddFunctionPhases($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_FUNCTION_PHASES_ADD, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_FUNCTION_PHASES_ADD, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "addFunctionPhases", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass add to internal logic", "try", "{", "$", "this", "->", "doAddFunctionPhases", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_FUNCTION_PHASES_ADD", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_FUNCTION_PHASES_ADD", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Adds FunctionPhases to Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Adds", "FunctionPhases", "to", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L121-L148
6,830
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.addGroups
public function addGroups($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass add to internal logic try { $this->doAddGroups($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_GROUPS_ADD, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_GROUPS_ADD, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function addGroups($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass add to internal logic try { $this->doAddGroups($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_GROUPS_ADD, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_GROUPS_ADD, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "addGroups", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass add to internal logic", "try", "{", "$", "this", "->", "doAddGroups", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_GROUPS_ADD", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_GROUPS_ADD", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Adds Groups to Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Adds", "Groups", "to", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L157-L184
6,831
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.addKstrukturs
public function addKstrukturs($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass add to internal logic try { $this->doAddKstrukturs($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_KSTRUKTURS_ADD, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_KSTRUKTURS_ADD, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function addKstrukturs($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass add to internal logic try { $this->doAddKstrukturs($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_KSTRUKTURS_ADD, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_KSTRUKTURS_ADD, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "addKstrukturs", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass add to internal logic", "try", "{", "$", "this", "->", "doAddKstrukturs", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_KSTRUKTURS_ADD", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_KSTRUKTURS_ADD", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Adds Kstrukturs to Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Adds", "Kstrukturs", "to", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L193-L220
6,832
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.addLineages
public function addLineages($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass add to internal logic try { $this->doAddLineages($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_LINEAGES_ADD, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_LINEAGES_ADD, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function addLineages($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass add to internal logic try { $this->doAddLineages($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_LINEAGES_ADD, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_LINEAGES_ADD, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "addLineages", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass add to internal logic", "try", "{", "$", "this", "->", "doAddLineages", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_LINEAGES_ADD", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_LINEAGES_ADD", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Adds Lineages to Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Adds", "Lineages", "to", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L229-L256
6,833
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.addMultiples
public function addMultiples($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass add to internal logic try { $this->doAddMultiples($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_MULTIPLES_ADD, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_MULTIPLES_ADD, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function addMultiples($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass add to internal logic try { $this->doAddMultiples($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_MULTIPLES_ADD, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_MULTIPLES_ADD, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "addMultiples", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass add to internal logic", "try", "{", "$", "this", "->", "doAddMultiples", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_MULTIPLES_ADD", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_MULTIPLES_ADD", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Adds Multiples to Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Adds", "Multiples", "to", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L265-L292
6,834
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.addParts
public function addParts($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass add to internal logic try { $this->doAddParts($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_PARTS_ADD, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_PARTS_ADD, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function addParts($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass add to internal logic try { $this->doAddParts($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_PARTS_ADD, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_PARTS_ADD, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "addParts", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass add to internal logic", "try", "{", "$", "this", "->", "doAddParts", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_PARTS_ADD", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_PARTS_ADD", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Adds Parts to Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Adds", "Parts", "to", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L337-L364
6,835
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.addPictures
public function addPictures($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass add to internal logic try { $this->doAddPictures($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_PICTURES_ADD, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_PICTURES_ADD, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function addPictures($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass add to internal logic try { $this->doAddPictures($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_PICTURES_ADD, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_PICTURES_ADD, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "addPictures", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass add to internal logic", "try", "{", "$", "this", "->", "doAddPictures", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_PICTURES_ADD", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_PICTURES_ADD", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Adds Pictures to Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Adds", "Pictures", "to", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L373-L400
6,836
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.addReferences
public function addReferences($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass add to internal logic try { $this->doAddReferences($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_REFERENCES_ADD, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_REFERENCES_ADD, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function addReferences($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass add to internal logic try { $this->doAddReferences($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_REFERENCES_ADD, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_REFERENCES_ADD, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "addReferences", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass add to internal logic", "try", "{", "$", "this", "->", "doAddReferences", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_REFERENCES_ADD", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_REFERENCES_ADD", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Adds References to Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Adds", "References", "to", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L409-L436
6,837
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.addVariations
public function addVariations($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass add to internal logic try { $this->doAddVariations($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_VARIATIONS_ADD, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_VARIATIONS_ADD, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function addVariations($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass add to internal logic try { $this->doAddVariations($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_VARIATIONS_ADD, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_VARIATIONS_ADD, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "addVariations", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass add to internal logic", "try", "{", "$", "this", "->", "doAddVariations", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_VARIATIONS_ADD", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_VARIATIONS_ADD", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Adds Variations to Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Adds", "Variations", "to", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L445-L472
6,838
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.read
public function read($id) { // read $model = $this->get($id); // check existence if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } return new Found(['model' => $model]); }
php
public function read($id) { // read $model = $this->get($id); // check existence if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } return new Found(['model' => $model]); }
[ "public", "function", "read", "(", "$", "id", ")", "{", "// read", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "// check existence", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "return", "new", "Found", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Returns one Skill with the given id @param mixed $id @return PayloadInterface
[ "Returns", "one", "Skill", "with", "the", "given", "id" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L612-L622
6,839
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.removeFunctionPhases
public function removeFunctionPhases($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass remove to internal logic try { $this->doRemoveFunctionPhases($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_FUNCTION_PHASES_REMOVE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_FUNCTION_PHASES_REMOVE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function removeFunctionPhases($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass remove to internal logic try { $this->doRemoveFunctionPhases($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_FUNCTION_PHASES_REMOVE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_FUNCTION_PHASES_REMOVE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "removeFunctionPhases", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass remove to internal logic", "try", "{", "$", "this", "->", "doRemoveFunctionPhases", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_FUNCTION_PHASES_REMOVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_FUNCTION_PHASES_REMOVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Removes FunctionPhases from Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Removes", "FunctionPhases", "from", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L703-L730
6,840
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.removeGroups
public function removeGroups($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass remove to internal logic try { $this->doRemoveGroups($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_GROUPS_REMOVE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_GROUPS_REMOVE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function removeGroups($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass remove to internal logic try { $this->doRemoveGroups($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_GROUPS_REMOVE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_GROUPS_REMOVE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "removeGroups", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass remove to internal logic", "try", "{", "$", "this", "->", "doRemoveGroups", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_GROUPS_REMOVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_GROUPS_REMOVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Removes Groups from Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Removes", "Groups", "from", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L739-L766
6,841
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.removeKstrukturs
public function removeKstrukturs($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass remove to internal logic try { $this->doRemoveKstrukturs($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_KSTRUKTURS_REMOVE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_KSTRUKTURS_REMOVE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function removeKstrukturs($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass remove to internal logic try { $this->doRemoveKstrukturs($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_KSTRUKTURS_REMOVE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_KSTRUKTURS_REMOVE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "removeKstrukturs", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass remove to internal logic", "try", "{", "$", "this", "->", "doRemoveKstrukturs", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_KSTRUKTURS_REMOVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_KSTRUKTURS_REMOVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Removes Kstrukturs from Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Removes", "Kstrukturs", "from", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L775-L802
6,842
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.removeLineages
public function removeLineages($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass remove to internal logic try { $this->doRemoveLineages($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_LINEAGES_REMOVE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_LINEAGES_REMOVE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function removeLineages($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass remove to internal logic try { $this->doRemoveLineages($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_LINEAGES_REMOVE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_LINEAGES_REMOVE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "removeLineages", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass remove to internal logic", "try", "{", "$", "this", "->", "doRemoveLineages", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_LINEAGES_REMOVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_LINEAGES_REMOVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Removes Lineages from Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Removes", "Lineages", "from", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L811-L838
6,843
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.removeMultiples
public function removeMultiples($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass remove to internal logic try { $this->doRemoveMultiples($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_MULTIPLES_REMOVE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_MULTIPLES_REMOVE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function removeMultiples($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass remove to internal logic try { $this->doRemoveMultiples($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_MULTIPLES_REMOVE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_MULTIPLES_REMOVE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "removeMultiples", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass remove to internal logic", "try", "{", "$", "this", "->", "doRemoveMultiples", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_MULTIPLES_REMOVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_MULTIPLES_REMOVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Removes Multiples from Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Removes", "Multiples", "from", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L847-L874
6,844
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.removeParents
public function removeParents($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass remove to internal logic try { $this->doRemoveParents($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_CHILDREN_REMOVE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_CHILDREN_REMOVE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function removeParents($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass remove to internal logic try { $this->doRemoveParents($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_CHILDREN_REMOVE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_CHILDREN_REMOVE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "removeParents", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass remove to internal logic", "try", "{", "$", "this", "->", "doRemoveParents", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_CHILDREN_REMOVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_CHILDREN_REMOVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Removes Parents from Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Removes", "Parents", "from", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L883-L910
6,845
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.removeParts
public function removeParts($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass remove to internal logic try { $this->doRemoveParts($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_PARTS_REMOVE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_PARTS_REMOVE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function removeParts($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass remove to internal logic try { $this->doRemoveParts($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_PARTS_REMOVE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_PARTS_REMOVE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "removeParts", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass remove to internal logic", "try", "{", "$", "this", "->", "doRemoveParts", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_PARTS_REMOVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_PARTS_REMOVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Removes Parts from Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Removes", "Parts", "from", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L919-L946
6,846
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.removePictures
public function removePictures($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass remove to internal logic try { $this->doRemovePictures($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_PICTURES_REMOVE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_PICTURES_REMOVE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function removePictures($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass remove to internal logic try { $this->doRemovePictures($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_PICTURES_REMOVE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_PICTURES_REMOVE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "removePictures", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass remove to internal logic", "try", "{", "$", "this", "->", "doRemovePictures", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_PICTURES_REMOVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_PICTURES_REMOVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Removes Pictures from Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Removes", "Pictures", "from", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L955-L982
6,847
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.removeReferences
public function removeReferences($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass remove to internal logic try { $this->doRemoveReferences($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_REFERENCES_REMOVE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_REFERENCES_REMOVE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function removeReferences($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass remove to internal logic try { $this->doRemoveReferences($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_REFERENCES_REMOVE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_REFERENCES_REMOVE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "removeReferences", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass remove to internal logic", "try", "{", "$", "this", "->", "doRemoveReferences", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_REFERENCES_REMOVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_REFERENCES_REMOVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Removes References from Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Removes", "References", "from", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L991-L1018
6,848
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.removeVariations
public function removeVariations($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass remove to internal logic try { $this->doRemoveVariations($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_VARIATIONS_REMOVE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_VARIATIONS_REMOVE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function removeVariations($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass remove to internal logic try { $this->doRemoveVariations($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_VARIATIONS_REMOVE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_VARIATIONS_REMOVE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "removeVariations", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass remove to internal logic", "try", "{", "$", "this", "->", "doRemoveVariations", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_VARIATIONS_REMOVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_VARIATIONS_REMOVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Removes Variations from Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Removes", "Variations", "from", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L1027-L1054
6,849
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.removeVideos
public function removeVideos($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass remove to internal logic try { $this->doRemoveVideos($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_VIDEOS_REMOVE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_VIDEOS_REMOVE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function removeVideos($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass remove to internal logic try { $this->doRemoveVideos($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_VIDEOS_REMOVE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_VIDEOS_REMOVE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "removeVideos", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass remove to internal logic", "try", "{", "$", "this", "->", "doRemoveVideos", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_VIDEOS_REMOVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_VIDEOS_REMOVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Removes Videos from Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Removes", "Videos", "from", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L1063-L1090
6,850
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.setEndPositionId
public function setEndPositionId($id, $relatedId) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // update if ($this->doSetEndPositionId($model, $relatedId)) { $this->dispatch(SkillEvent::PRE_END_POSITION_UPDATE, $model); $this->dispatch(SkillEvent::PRE_SAVE, $model); $model->save(); $this->dispatch(SkillEvent::POST_END_POSITION_UPDATE, $model); $this->dispatch(SkillEvent::POST_SAVE, $model); return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function setEndPositionId($id, $relatedId) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // update if ($this->doSetEndPositionId($model, $relatedId)) { $this->dispatch(SkillEvent::PRE_END_POSITION_UPDATE, $model); $this->dispatch(SkillEvent::PRE_SAVE, $model); $model->save(); $this->dispatch(SkillEvent::POST_END_POSITION_UPDATE, $model); $this->dispatch(SkillEvent::POST_SAVE, $model); return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "setEndPositionId", "(", "$", "id", ",", "$", "relatedId", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// update", "if", "(", "$", "this", "->", "doSetEndPositionId", "(", "$", "model", ",", "$", "relatedId", ")", ")", "{", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_END_POSITION_UPDATE", ",", "$", "model", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ")", ";", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_END_POSITION_UPDATE", ",", "$", "model", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ")", ";", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Sets the EndPosition id @param mixed $id @param mixed $relatedId @return PayloadInterface
[ "Sets", "the", "EndPosition", "id" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L1099-L1119
6,851
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.setFeaturedPictureId
public function setFeaturedPictureId($id, $relatedId) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // update if ($this->doSetFeaturedPictureId($model, $relatedId)) { $this->dispatch(SkillEvent::PRE_FEATURED_PICTURE_UPDATE, $model); $this->dispatch(SkillEvent::PRE_SAVE, $model); $model->save(); $this->dispatch(SkillEvent::POST_FEATURED_PICTURE_UPDATE, $model); $this->dispatch(SkillEvent::POST_SAVE, $model); return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function setFeaturedPictureId($id, $relatedId) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // update if ($this->doSetFeaturedPictureId($model, $relatedId)) { $this->dispatch(SkillEvent::PRE_FEATURED_PICTURE_UPDATE, $model); $this->dispatch(SkillEvent::PRE_SAVE, $model); $model->save(); $this->dispatch(SkillEvent::POST_FEATURED_PICTURE_UPDATE, $model); $this->dispatch(SkillEvent::POST_SAVE, $model); return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "setFeaturedPictureId", "(", "$", "id", ",", "$", "relatedId", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// update", "if", "(", "$", "this", "->", "doSetFeaturedPictureId", "(", "$", "model", ",", "$", "relatedId", ")", ")", "{", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_FEATURED_PICTURE_UPDATE", ",", "$", "model", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ")", ";", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_FEATURED_PICTURE_UPDATE", ",", "$", "model", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ")", ";", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Sets the FeaturedPicture id @param mixed $id @param mixed $relatedId @return PayloadInterface
[ "Sets", "the", "FeaturedPicture", "id" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L1128-L1148
6,852
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.setFeaturedTutorialId
public function setFeaturedTutorialId($id, $relatedId) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // update if ($this->doSetFeaturedTutorialId($model, $relatedId)) { $this->dispatch(SkillEvent::PRE_FEATURED_TUTORIAL_UPDATE, $model); $this->dispatch(SkillEvent::PRE_SAVE, $model); $model->save(); $this->dispatch(SkillEvent::POST_FEATURED_TUTORIAL_UPDATE, $model); $this->dispatch(SkillEvent::POST_SAVE, $model); return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function setFeaturedTutorialId($id, $relatedId) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // update if ($this->doSetFeaturedTutorialId($model, $relatedId)) { $this->dispatch(SkillEvent::PRE_FEATURED_TUTORIAL_UPDATE, $model); $this->dispatch(SkillEvent::PRE_SAVE, $model); $model->save(); $this->dispatch(SkillEvent::POST_FEATURED_TUTORIAL_UPDATE, $model); $this->dispatch(SkillEvent::POST_SAVE, $model); return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "setFeaturedTutorialId", "(", "$", "id", ",", "$", "relatedId", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// update", "if", "(", "$", "this", "->", "doSetFeaturedTutorialId", "(", "$", "model", ",", "$", "relatedId", ")", ")", "{", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_FEATURED_TUTORIAL_UPDATE", ",", "$", "model", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ")", ";", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_FEATURED_TUTORIAL_UPDATE", ",", "$", "model", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ")", ";", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Sets the FeaturedTutorial id @param mixed $id @param mixed $relatedId @return PayloadInterface
[ "Sets", "the", "FeaturedTutorial", "id" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L1157-L1177
6,853
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.setFeaturedVideoId
public function setFeaturedVideoId($id, $relatedId) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // update if ($this->doSetFeaturedVideoId($model, $relatedId)) { $this->dispatch(SkillEvent::PRE_FEATURED_VIDEO_UPDATE, $model); $this->dispatch(SkillEvent::PRE_SAVE, $model); $model->save(); $this->dispatch(SkillEvent::POST_FEATURED_VIDEO_UPDATE, $model); $this->dispatch(SkillEvent::POST_SAVE, $model); return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function setFeaturedVideoId($id, $relatedId) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // update if ($this->doSetFeaturedVideoId($model, $relatedId)) { $this->dispatch(SkillEvent::PRE_FEATURED_VIDEO_UPDATE, $model); $this->dispatch(SkillEvent::PRE_SAVE, $model); $model->save(); $this->dispatch(SkillEvent::POST_FEATURED_VIDEO_UPDATE, $model); $this->dispatch(SkillEvent::POST_SAVE, $model); return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "setFeaturedVideoId", "(", "$", "id", ",", "$", "relatedId", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// update", "if", "(", "$", "this", "->", "doSetFeaturedVideoId", "(", "$", "model", ",", "$", "relatedId", ")", ")", "{", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_FEATURED_VIDEO_UPDATE", ",", "$", "model", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ")", ";", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_FEATURED_VIDEO_UPDATE", ",", "$", "model", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ")", ";", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Sets the FeaturedVideo id @param mixed $id @param mixed $relatedId @return PayloadInterface
[ "Sets", "the", "FeaturedVideo", "id" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L1186-L1206
6,854
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.setFunctionPhaseRootId
public function setFunctionPhaseRootId($id, $relatedId) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // update if ($this->doSetFunctionPhaseRootId($model, $relatedId)) { $this->dispatch(SkillEvent::PRE_FUNCTION_PHASE_ROOT_UPDATE, $model); $this->dispatch(SkillEvent::PRE_SAVE, $model); $model->save(); $this->dispatch(SkillEvent::POST_FUNCTION_PHASE_ROOT_UPDATE, $model); $this->dispatch(SkillEvent::POST_SAVE, $model); return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function setFunctionPhaseRootId($id, $relatedId) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // update if ($this->doSetFunctionPhaseRootId($model, $relatedId)) { $this->dispatch(SkillEvent::PRE_FUNCTION_PHASE_ROOT_UPDATE, $model); $this->dispatch(SkillEvent::PRE_SAVE, $model); $model->save(); $this->dispatch(SkillEvent::POST_FUNCTION_PHASE_ROOT_UPDATE, $model); $this->dispatch(SkillEvent::POST_SAVE, $model); return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "setFunctionPhaseRootId", "(", "$", "id", ",", "$", "relatedId", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// update", "if", "(", "$", "this", "->", "doSetFunctionPhaseRootId", "(", "$", "model", ",", "$", "relatedId", ")", ")", "{", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_FUNCTION_PHASE_ROOT_UPDATE", ",", "$", "model", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ")", ";", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_FUNCTION_PHASE_ROOT_UPDATE", ",", "$", "model", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ")", ";", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Sets the FunctionPhaseRoot id @param mixed $id @param mixed $relatedId @return PayloadInterface
[ "Sets", "the", "FunctionPhaseRoot", "id" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L1215-L1235
6,855
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.setKstrukturRootId
public function setKstrukturRootId($id, $relatedId) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // update if ($this->doSetKstrukturRootId($model, $relatedId)) { $this->dispatch(SkillEvent::PRE_KSTRUKTUR_ROOT_UPDATE, $model); $this->dispatch(SkillEvent::PRE_SAVE, $model); $model->save(); $this->dispatch(SkillEvent::POST_KSTRUKTUR_ROOT_UPDATE, $model); $this->dispatch(SkillEvent::POST_SAVE, $model); return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function setKstrukturRootId($id, $relatedId) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // update if ($this->doSetKstrukturRootId($model, $relatedId)) { $this->dispatch(SkillEvent::PRE_KSTRUKTUR_ROOT_UPDATE, $model); $this->dispatch(SkillEvent::PRE_SAVE, $model); $model->save(); $this->dispatch(SkillEvent::POST_KSTRUKTUR_ROOT_UPDATE, $model); $this->dispatch(SkillEvent::POST_SAVE, $model); return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "setKstrukturRootId", "(", "$", "id", ",", "$", "relatedId", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// update", "if", "(", "$", "this", "->", "doSetKstrukturRootId", "(", "$", "model", ",", "$", "relatedId", ")", ")", "{", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_KSTRUKTUR_ROOT_UPDATE", ",", "$", "model", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ")", ";", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_KSTRUKTUR_ROOT_UPDATE", ",", "$", "model", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ")", ";", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Sets the KstrukturRoot id @param mixed $id @param mixed $relatedId @return PayloadInterface
[ "Sets", "the", "KstrukturRoot", "id" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L1244-L1264
6,856
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.setMultipleOfId
public function setMultipleOfId($id, $relatedId) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // update if ($this->doSetMultipleOfId($model, $relatedId)) { $this->dispatch(SkillEvent::PRE_MULTIPLE_OF_UPDATE, $model); $this->dispatch(SkillEvent::PRE_SAVE, $model); $model->save(); $this->dispatch(SkillEvent::POST_MULTIPLE_OF_UPDATE, $model); $this->dispatch(SkillEvent::POST_SAVE, $model); return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function setMultipleOfId($id, $relatedId) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // update if ($this->doSetMultipleOfId($model, $relatedId)) { $this->dispatch(SkillEvent::PRE_MULTIPLE_OF_UPDATE, $model); $this->dispatch(SkillEvent::PRE_SAVE, $model); $model->save(); $this->dispatch(SkillEvent::POST_MULTIPLE_OF_UPDATE, $model); $this->dispatch(SkillEvent::POST_SAVE, $model); return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "setMultipleOfId", "(", "$", "id", ",", "$", "relatedId", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// update", "if", "(", "$", "this", "->", "doSetMultipleOfId", "(", "$", "model", ",", "$", "relatedId", ")", ")", "{", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_MULTIPLE_OF_UPDATE", ",", "$", "model", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ")", ";", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_MULTIPLE_OF_UPDATE", ",", "$", "model", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ")", ";", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Sets the MultipleOf id @param mixed $id @param mixed $relatedId @return PayloadInterface
[ "Sets", "the", "MultipleOf", "id" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L1273-L1293
6,857
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.setObjectId
public function setObjectId($id, $relatedId) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // update if ($this->doSetObjectId($model, $relatedId)) { $this->dispatch(SkillEvent::PRE_OBJECT_UPDATE, $model); $this->dispatch(SkillEvent::PRE_SAVE, $model); $model->save(); $this->dispatch(SkillEvent::POST_OBJECT_UPDATE, $model); $this->dispatch(SkillEvent::POST_SAVE, $model); return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function setObjectId($id, $relatedId) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // update if ($this->doSetObjectId($model, $relatedId)) { $this->dispatch(SkillEvent::PRE_OBJECT_UPDATE, $model); $this->dispatch(SkillEvent::PRE_SAVE, $model); $model->save(); $this->dispatch(SkillEvent::POST_OBJECT_UPDATE, $model); $this->dispatch(SkillEvent::POST_SAVE, $model); return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "setObjectId", "(", "$", "id", ",", "$", "relatedId", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// update", "if", "(", "$", "this", "->", "doSetObjectId", "(", "$", "model", ",", "$", "relatedId", ")", ")", "{", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_OBJECT_UPDATE", ",", "$", "model", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ")", ";", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_OBJECT_UPDATE", ",", "$", "model", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ")", ";", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Sets the Object id @param mixed $id @param mixed $relatedId @return PayloadInterface
[ "Sets", "the", "Object", "id" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L1302-L1322
6,858
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.setStartPositionId
public function setStartPositionId($id, $relatedId) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // update if ($this->doSetStartPositionId($model, $relatedId)) { $this->dispatch(SkillEvent::PRE_START_POSITION_UPDATE, $model); $this->dispatch(SkillEvent::PRE_SAVE, $model); $model->save(); $this->dispatch(SkillEvent::POST_START_POSITION_UPDATE, $model); $this->dispatch(SkillEvent::POST_SAVE, $model); return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function setStartPositionId($id, $relatedId) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // update if ($this->doSetStartPositionId($model, $relatedId)) { $this->dispatch(SkillEvent::PRE_START_POSITION_UPDATE, $model); $this->dispatch(SkillEvent::PRE_SAVE, $model); $model->save(); $this->dispatch(SkillEvent::POST_START_POSITION_UPDATE, $model); $this->dispatch(SkillEvent::POST_SAVE, $model); return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "setStartPositionId", "(", "$", "id", ",", "$", "relatedId", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// update", "if", "(", "$", "this", "->", "doSetStartPositionId", "(", "$", "model", ",", "$", "relatedId", ")", ")", "{", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_START_POSITION_UPDATE", ",", "$", "model", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ")", ";", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_START_POSITION_UPDATE", ",", "$", "model", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ")", ";", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Sets the StartPosition id @param mixed $id @param mixed $relatedId @return PayloadInterface
[ "Sets", "the", "StartPosition", "id" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L1360-L1380
6,859
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.setVariationOfId
public function setVariationOfId($id, $relatedId) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // update if ($this->doSetVariationOfId($model, $relatedId)) { $this->dispatch(SkillEvent::PRE_VARIATION_OF_UPDATE, $model); $this->dispatch(SkillEvent::PRE_SAVE, $model); $model->save(); $this->dispatch(SkillEvent::POST_VARIATION_OF_UPDATE, $model); $this->dispatch(SkillEvent::POST_SAVE, $model); return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function setVariationOfId($id, $relatedId) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // update if ($this->doSetVariationOfId($model, $relatedId)) { $this->dispatch(SkillEvent::PRE_VARIATION_OF_UPDATE, $model); $this->dispatch(SkillEvent::PRE_SAVE, $model); $model->save(); $this->dispatch(SkillEvent::POST_VARIATION_OF_UPDATE, $model); $this->dispatch(SkillEvent::POST_SAVE, $model); return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "setVariationOfId", "(", "$", "id", ",", "$", "relatedId", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// update", "if", "(", "$", "this", "->", "doSetVariationOfId", "(", "$", "model", ",", "$", "relatedId", ")", ")", "{", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_VARIATION_OF_UPDATE", ",", "$", "model", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ")", ";", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_VARIATION_OF_UPDATE", ",", "$", "model", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ")", ";", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Sets the VariationOf id @param mixed $id @param mixed $relatedId @return PayloadInterface
[ "Sets", "the", "VariationOf", "id" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L1389-L1409
6,860
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.updateFunctionPhases
public function updateFunctionPhases($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass update to internal logic try { $this->doUpdateFunctionPhases($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_FUNCTION_PHASES_UPDATE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_FUNCTION_PHASES_UPDATE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function updateFunctionPhases($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass update to internal logic try { $this->doUpdateFunctionPhases($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_FUNCTION_PHASES_UPDATE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_FUNCTION_PHASES_UPDATE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "updateFunctionPhases", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass update to internal logic", "try", "{", "$", "this", "->", "doUpdateFunctionPhases", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_FUNCTION_PHASES_UPDATE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_FUNCTION_PHASES_UPDATE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Updates FunctionPhases on Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Updates", "FunctionPhases", "on", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L1536-L1563
6,861
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.updateKstrukturs
public function updateKstrukturs($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass update to internal logic try { $this->doUpdateKstrukturs($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_KSTRUKTURS_UPDATE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_KSTRUKTURS_UPDATE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function updateKstrukturs($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass update to internal logic try { $this->doUpdateKstrukturs($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_KSTRUKTURS_UPDATE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_KSTRUKTURS_UPDATE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "updateKstrukturs", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass update to internal logic", "try", "{", "$", "this", "->", "doUpdateKstrukturs", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_KSTRUKTURS_UPDATE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_KSTRUKTURS_UPDATE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Updates Kstrukturs on Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Updates", "Kstrukturs", "on", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L1608-L1635
6,862
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.updateLineages
public function updateLineages($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass update to internal logic try { $this->doUpdateLineages($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_LINEAGES_UPDATE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_LINEAGES_UPDATE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function updateLineages($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass update to internal logic try { $this->doUpdateLineages($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_LINEAGES_UPDATE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_LINEAGES_UPDATE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "updateLineages", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass update to internal logic", "try", "{", "$", "this", "->", "doUpdateLineages", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_LINEAGES_UPDATE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_LINEAGES_UPDATE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Updates Lineages on Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Updates", "Lineages", "on", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L1644-L1671
6,863
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.updateMultiples
public function updateMultiples($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass update to internal logic try { $this->doUpdateMultiples($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_MULTIPLES_UPDATE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_MULTIPLES_UPDATE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function updateMultiples($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass update to internal logic try { $this->doUpdateMultiples($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_MULTIPLES_UPDATE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_MULTIPLES_UPDATE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "updateMultiples", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass update to internal logic", "try", "{", "$", "this", "->", "doUpdateMultiples", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_MULTIPLES_UPDATE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_MULTIPLES_UPDATE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Updates Multiples on Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Updates", "Multiples", "on", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L1680-L1707
6,864
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.updateParents
public function updateParents($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass update to internal logic try { $this->doUpdateParent($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_CHILDREN_UPDATE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_CHILDREN_UPDATE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function updateParents($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass update to internal logic try { $this->doUpdateParent($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_CHILDREN_UPDATE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_CHILDREN_UPDATE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "updateParents", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass update to internal logic", "try", "{", "$", "this", "->", "doUpdateParent", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_CHILDREN_UPDATE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_CHILDREN_UPDATE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Updates Parents on Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Updates", "Parents", "on", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L1716-L1743
6,865
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.updateParts
public function updateParts($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass update to internal logic try { $this->doUpdateParts($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_PARTS_UPDATE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_PARTS_UPDATE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function updateParts($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass update to internal logic try { $this->doUpdateParts($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_PARTS_UPDATE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_PARTS_UPDATE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "updateParts", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass update to internal logic", "try", "{", "$", "this", "->", "doUpdateParts", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_PARTS_UPDATE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_PARTS_UPDATE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Updates Parts on Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Updates", "Parts", "on", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L1752-L1779
6,866
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.updatePictures
public function updatePictures($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass update to internal logic try { $this->doUpdatePictures($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_PICTURES_UPDATE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_PICTURES_UPDATE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function updatePictures($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass update to internal logic try { $this->doUpdatePictures($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_PICTURES_UPDATE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_PICTURES_UPDATE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "updatePictures", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass update to internal logic", "try", "{", "$", "this", "->", "doUpdatePictures", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_PICTURES_UPDATE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_PICTURES_UPDATE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Updates Pictures on Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Updates", "Pictures", "on", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L1788-L1815
6,867
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.updateReferences
public function updateReferences($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass update to internal logic try { $this->doUpdateReferences($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_REFERENCES_UPDATE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_REFERENCES_UPDATE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function updateReferences($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass update to internal logic try { $this->doUpdateReferences($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_REFERENCES_UPDATE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_REFERENCES_UPDATE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "updateReferences", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass update to internal logic", "try", "{", "$", "this", "->", "doUpdateReferences", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_REFERENCES_UPDATE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_REFERENCES_UPDATE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Updates References on Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Updates", "References", "on", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L1824-L1851
6,868
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.updateVariations
public function updateVariations($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass update to internal logic try { $this->doUpdateVariations($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_VARIATIONS_UPDATE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_VARIATIONS_UPDATE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
php
public function updateVariations($id, $data) { // find $model = $this->get($id); if ($model === null) { return new NotFound(['message' => 'Skill not found.']); } // pass update to internal logic try { $this->doUpdateVariations($model, $data); } catch (ErrorsException $e) { return new NotValid(['errors' => $e->getErrors()]); } // save and dispatch events $this->dispatch(SkillEvent::PRE_VARIATIONS_UPDATE, $model, $data); $this->dispatch(SkillEvent::PRE_SAVE, $model, $data); $rows = $model->save(); $this->dispatch(SkillEvent::POST_VARIATIONS_UPDATE, $model, $data); $this->dispatch(SkillEvent::POST_SAVE, $model, $data); if ($rows > 0) { return Updated(['model' => $model]); } return NotUpdated(['model' => $model]); }
[ "public", "function", "updateVariations", "(", "$", "id", ",", "$", "data", ")", "{", "// find", "$", "model", "=", "$", "this", "->", "get", "(", "$", "id", ")", ";", "if", "(", "$", "model", "===", "null", ")", "{", "return", "new", "NotFound", "(", "[", "'message'", "=>", "'Skill not found.'", "]", ")", ";", "}", "// pass update to internal logic", "try", "{", "$", "this", "->", "doUpdateVariations", "(", "$", "model", ",", "$", "data", ")", ";", "}", "catch", "(", "ErrorsException", "$", "e", ")", "{", "return", "new", "NotValid", "(", "[", "'errors'", "=>", "$", "e", "->", "getErrors", "(", ")", "]", ")", ";", "}", "// save and dispatch events", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_VARIATIONS_UPDATE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "PRE_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "rows", "=", "$", "model", "->", "save", "(", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_VARIATIONS_UPDATE", ",", "$", "model", ",", "$", "data", ")", ";", "$", "this", "->", "dispatch", "(", "SkillEvent", "::", "POST_SAVE", ",", "$", "model", ",", "$", "data", ")", ";", "if", "(", "$", "rows", ">", "0", ")", "{", "return", "Updated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}", "return", "NotUpdated", "(", "[", "'model'", "=>", "$", "model", "]", ")", ";", "}" ]
Updates Variations on Skill @param mixed $id @param mixed $data @return PayloadInterface
[ "Updates", "Variations", "on", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L1860-L1887
6,869
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doAddChildren
protected function doAddChildren(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Skill'; } else { $related = SkillQuery::create()->findOneById($entry['id']); $model->addSkillRelatedByDependencyId($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doAddChildren(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Skill'; } else { $related = SkillQuery::create()->findOneById($entry['id']); $model->addSkillRelatedByDependencyId($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doAddChildren", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for Skill'", ";", "}", "else", "{", "$", "related", "=", "SkillQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "addSkillRelatedByDependencyId", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to add Children to Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "add", "Children", "to", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2003-L2017
6,870
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doAddComposites
protected function doAddComposites(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Skill'; } else { $related = SkillQuery::create()->findOneById($entry['id']); $model->addSkillRelatedByCompositeId($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doAddComposites(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Skill'; } else { $related = SkillQuery::create()->findOneById($entry['id']); $model->addSkillRelatedByCompositeId($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doAddComposites", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for Skill'", ";", "}", "else", "{", "$", "related", "=", "SkillQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "addSkillRelatedByCompositeId", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to add Composites to Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "add", "Composites", "to", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2025-L2039
6,871
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doAddFunctionPhases
protected function doAddFunctionPhases(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for FunctionPhase'; } else { $related = FunctionPhaseQuery::create()->findOneById($entry['id']); $model->addFunctionPhase($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doAddFunctionPhases(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for FunctionPhase'; } else { $related = FunctionPhaseQuery::create()->findOneById($entry['id']); $model->addFunctionPhase($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doAddFunctionPhases", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for FunctionPhase'", ";", "}", "else", "{", "$", "related", "=", "FunctionPhaseQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "addFunctionPhase", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to add FunctionPhases to Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "add", "FunctionPhases", "to", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2047-L2061
6,872
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doAddGroups
protected function doAddGroups(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Group'; } else { $related = GroupQuery::create()->findOneById($entry['id']); $model->addGroup($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doAddGroups(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Group'; } else { $related = GroupQuery::create()->findOneById($entry['id']); $model->addGroup($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doAddGroups", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for Group'", ";", "}", "else", "{", "$", "related", "=", "GroupQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "addGroup", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to add Groups to Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "add", "Groups", "to", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2069-L2083
6,873
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doAddKstrukturs
protected function doAddKstrukturs(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Kstruktur'; } else { $related = KstrukturQuery::create()->findOneById($entry['id']); $model->addKstruktur($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doAddKstrukturs(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Kstruktur'; } else { $related = KstrukturQuery::create()->findOneById($entry['id']); $model->addKstruktur($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doAddKstrukturs", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for Kstruktur'", ";", "}", "else", "{", "$", "related", "=", "KstrukturQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "addKstruktur", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to add Kstrukturs to Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "add", "Kstrukturs", "to", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2091-L2105
6,874
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doAddLineages
protected function doAddLineages(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Lineage'; } else { $related = LineageQuery::create()->findOneById($entry['id']); $model->addLineage($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doAddLineages(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Lineage'; } else { $related = LineageQuery::create()->findOneById($entry['id']); $model->addLineage($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doAddLineages", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for Lineage'", ";", "}", "else", "{", "$", "related", "=", "LineageQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "addLineage", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to add Lineages to Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "add", "Lineages", "to", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2113-L2127
6,875
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doAddMultiples
protected function doAddMultiples(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Skill'; } else { $related = SkillQuery::create()->findOneById($entry['id']); $model->addMultiple($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doAddMultiples(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Skill'; } else { $related = SkillQuery::create()->findOneById($entry['id']); $model->addMultiple($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doAddMultiples", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for Skill'", ";", "}", "else", "{", "$", "related", "=", "SkillQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "addMultiple", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to add Multiples to Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "add", "Multiples", "to", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2135-L2149
6,876
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doAddParents
protected function doAddParents(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Skill'; } else { $related = SkillQuery::create()->findOneById($entry['id']); $model->addSkillRelatedByParentId($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doAddParents(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Skill'; } else { $related = SkillQuery::create()->findOneById($entry['id']); $model->addSkillRelatedByParentId($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doAddParents", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for Skill'", ";", "}", "else", "{", "$", "related", "=", "SkillQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "addSkillRelatedByParentId", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to add Parents to Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "add", "Parents", "to", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2157-L2171
6,877
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doAddParts
protected function doAddParts(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Skill'; } else { $related = SkillQuery::create()->findOneById($entry['id']); $model->addSkillRelatedByPartId($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doAddParts(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Skill'; } else { $related = SkillQuery::create()->findOneById($entry['id']); $model->addSkillRelatedByPartId($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doAddParts", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for Skill'", ";", "}", "else", "{", "$", "related", "=", "SkillQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "addSkillRelatedByPartId", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to add Parts to Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "add", "Parts", "to", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2179-L2193
6,878
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doAddPictures
protected function doAddPictures(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Picture'; } else { $related = PictureQuery::create()->findOneById($entry['id']); $model->addPicture($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doAddPictures(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Picture'; } else { $related = PictureQuery::create()->findOneById($entry['id']); $model->addPicture($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doAddPictures", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for Picture'", ";", "}", "else", "{", "$", "related", "=", "PictureQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "addPicture", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to add Pictures to Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "add", "Pictures", "to", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2201-L2215
6,879
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doAddReferences
protected function doAddReferences(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Reference'; } else { $related = ReferenceQuery::create()->findOneById($entry['id']); $model->addReference($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doAddReferences(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Reference'; } else { $related = ReferenceQuery::create()->findOneById($entry['id']); $model->addReference($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doAddReferences", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for Reference'", ";", "}", "else", "{", "$", "related", "=", "ReferenceQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "addReference", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to add References to Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "add", "References", "to", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2223-L2237
6,880
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doAddVariations
protected function doAddVariations(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Skill'; } else { $related = SkillQuery::create()->findOneById($entry['id']); $model->addVariation($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doAddVariations(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Skill'; } else { $related = SkillQuery::create()->findOneById($entry['id']); $model->addVariation($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doAddVariations", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for Skill'", ";", "}", "else", "{", "$", "related", "=", "SkillQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "addVariation", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to add Variations to Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "add", "Variations", "to", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2245-L2259
6,881
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doRemoveFunctionPhases
protected function doRemoveFunctionPhases(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for FunctionPhase'; } else { $related = FunctionPhaseQuery::create()->findOneById($entry['id']); $model->removeFunctionPhase($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doRemoveFunctionPhases(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for FunctionPhase'; } else { $related = FunctionPhaseQuery::create()->findOneById($entry['id']); $model->removeFunctionPhase($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doRemoveFunctionPhases", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for FunctionPhase'", ";", "}", "else", "{", "$", "related", "=", "FunctionPhaseQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "removeFunctionPhase", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to remove FunctionPhases from Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "remove", "FunctionPhases", "from", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2333-L2347
6,882
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doRemoveGroups
protected function doRemoveGroups(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Group'; } else { $related = GroupQuery::create()->findOneById($entry['id']); $model->removeGroup($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doRemoveGroups(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Group'; } else { $related = GroupQuery::create()->findOneById($entry['id']); $model->removeGroup($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doRemoveGroups", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for Group'", ";", "}", "else", "{", "$", "related", "=", "GroupQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "removeGroup", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to remove Groups from Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "remove", "Groups", "from", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2355-L2369
6,883
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doRemoveKstrukturs
protected function doRemoveKstrukturs(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Kstruktur'; } else { $related = KstrukturQuery::create()->findOneById($entry['id']); $model->removeKstruktur($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doRemoveKstrukturs(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Kstruktur'; } else { $related = KstrukturQuery::create()->findOneById($entry['id']); $model->removeKstruktur($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doRemoveKstrukturs", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for Kstruktur'", ";", "}", "else", "{", "$", "related", "=", "KstrukturQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "removeKstruktur", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to remove Kstrukturs from Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "remove", "Kstrukturs", "from", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2377-L2391
6,884
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doRemoveLineages
protected function doRemoveLineages(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Lineage'; } else { $related = LineageQuery::create()->findOneById($entry['id']); $model->removeLineage($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doRemoveLineages(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Lineage'; } else { $related = LineageQuery::create()->findOneById($entry['id']); $model->removeLineage($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doRemoveLineages", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for Lineage'", ";", "}", "else", "{", "$", "related", "=", "LineageQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "removeLineage", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to remove Lineages from Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "remove", "Lineages", "from", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2399-L2413
6,885
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doRemoveMultiples
protected function doRemoveMultiples(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Skill'; } else { $related = SkillQuery::create()->findOneById($entry['id']); $model->removeMultiple($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doRemoveMultiples(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Skill'; } else { $related = SkillQuery::create()->findOneById($entry['id']); $model->removeMultiple($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doRemoveMultiples", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for Skill'", ";", "}", "else", "{", "$", "related", "=", "SkillQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "removeMultiple", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to remove Multiples from Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "remove", "Multiples", "from", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2421-L2435
6,886
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doRemoveParents
protected function doRemoveParents(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Skill'; } else { $related = SkillQuery::create()->findOneById($entry['id']); $model->removeSkillRelatedByDependencyId($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doRemoveParents(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Skill'; } else { $related = SkillQuery::create()->findOneById($entry['id']); $model->removeSkillRelatedByDependencyId($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doRemoveParents", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for Skill'", ";", "}", "else", "{", "$", "related", "=", "SkillQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "removeSkillRelatedByDependencyId", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to remove Parents from Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "remove", "Parents", "from", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2443-L2457
6,887
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doRemoveParts
protected function doRemoveParts(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Skill'; } else { $related = SkillQuery::create()->findOneById($entry['id']); $model->removeSkillRelatedByPartId($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doRemoveParts(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Skill'; } else { $related = SkillQuery::create()->findOneById($entry['id']); $model->removeSkillRelatedByPartId($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doRemoveParts", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for Skill'", ";", "}", "else", "{", "$", "related", "=", "SkillQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "removeSkillRelatedByPartId", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to remove Parts from Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "remove", "Parts", "from", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2465-L2479
6,888
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doRemovePictures
protected function doRemovePictures(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Picture'; } else { $related = PictureQuery::create()->findOneById($entry['id']); $model->removePicture($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doRemovePictures(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Picture'; } else { $related = PictureQuery::create()->findOneById($entry['id']); $model->removePicture($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doRemovePictures", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for Picture'", ";", "}", "else", "{", "$", "related", "=", "PictureQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "removePicture", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to remove Pictures from Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "remove", "Pictures", "from", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2487-L2501
6,889
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doRemoveReferences
protected function doRemoveReferences(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Reference'; } else { $related = ReferenceQuery::create()->findOneById($entry['id']); $model->removeReference($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doRemoveReferences(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Reference'; } else { $related = ReferenceQuery::create()->findOneById($entry['id']); $model->removeReference($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doRemoveReferences", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for Reference'", ";", "}", "else", "{", "$", "related", "=", "ReferenceQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "removeReference", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to remove References from Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "remove", "References", "from", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2509-L2523
6,890
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doRemoveVariations
protected function doRemoveVariations(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Skill'; } else { $related = SkillQuery::create()->findOneById($entry['id']); $model->removeVariation($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doRemoveVariations(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Skill'; } else { $related = SkillQuery::create()->findOneById($entry['id']); $model->removeVariation($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doRemoveVariations", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for Skill'", ";", "}", "else", "{", "$", "related", "=", "SkillQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "removeVariation", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to remove Variations from Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "remove", "Variations", "from", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2531-L2545
6,891
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doRemoveVideos
protected function doRemoveVideos(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Video'; } else { $related = VideoQuery::create()->findOneById($entry['id']); $model->removeVideo($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
php
protected function doRemoveVideos(Skill $model, $data) { $errors = []; foreach ($data as $entry) { if (!isset($entry['id'])) { $errors[] = 'Missing id for Video'; } else { $related = VideoQuery::create()->findOneById($entry['id']); $model->removeVideo($related); } } if (count($errors) > 0) { return new ErrorsException($errors); } }
[ "protected", "function", "doRemoveVideos", "(", "Skill", "$", "model", ",", "$", "data", ")", "{", "$", "errors", "=", "[", "]", ";", "foreach", "(", "$", "data", "as", "$", "entry", ")", "{", "if", "(", "!", "isset", "(", "$", "entry", "[", "'id'", "]", ")", ")", "{", "$", "errors", "[", "]", "=", "'Missing id for Video'", ";", "}", "else", "{", "$", "related", "=", "VideoQuery", "::", "create", "(", ")", "->", "findOneById", "(", "$", "entry", "[", "'id'", "]", ")", ";", "$", "model", "->", "removeVideo", "(", "$", "related", ")", ";", "}", "}", "if", "(", "count", "(", "$", "errors", ")", ">", "0", ")", "{", "return", "new", "ErrorsException", "(", "$", "errors", ")", ";", "}", "}" ]
Interal mechanism to remove Videos from Skill @param Skill $model @param mixed $data
[ "Interal", "mechanism", "to", "remove", "Videos", "from", "Skill" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2553-L2567
6,892
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doSetEndPositionId
protected function doSetEndPositionId(Skill $model, $relatedId) { if ($model->getEndPositionId() !== $relatedId) { $model->setEndPositionId($relatedId); return true; } return false; }
php
protected function doSetEndPositionId(Skill $model, $relatedId) { if ($model->getEndPositionId() !== $relatedId) { $model->setEndPositionId($relatedId); return true; } return false; }
[ "protected", "function", "doSetEndPositionId", "(", "Skill", "$", "model", ",", "$", "relatedId", ")", "{", "if", "(", "$", "model", "->", "getEndPositionId", "(", ")", "!==", "$", "relatedId", ")", "{", "$", "model", "->", "setEndPositionId", "(", "$", "relatedId", ")", ";", "return", "true", ";", "}", "return", "false", ";", "}" ]
Internal mechanism to set the EndPosition id @param Skill $model @param mixed $relatedId
[ "Internal", "mechanism", "to", "set", "the", "EndPosition", "id" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2575-L2583
6,893
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doSetFeaturedPictureId
protected function doSetFeaturedPictureId(Skill $model, $relatedId) { if ($model->getPictureId() !== $relatedId) { $model->setPictureId($relatedId); return true; } return false; }
php
protected function doSetFeaturedPictureId(Skill $model, $relatedId) { if ($model->getPictureId() !== $relatedId) { $model->setPictureId($relatedId); return true; } return false; }
[ "protected", "function", "doSetFeaturedPictureId", "(", "Skill", "$", "model", ",", "$", "relatedId", ")", "{", "if", "(", "$", "model", "->", "getPictureId", "(", ")", "!==", "$", "relatedId", ")", "{", "$", "model", "->", "setPictureId", "(", "$", "relatedId", ")", ";", "return", "true", ";", "}", "return", "false", ";", "}" ]
Internal mechanism to set the FeaturedPicture id @param Skill $model @param mixed $relatedId
[ "Internal", "mechanism", "to", "set", "the", "FeaturedPicture", "id" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2591-L2599
6,894
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doSetFeaturedTutorialId
protected function doSetFeaturedTutorialId(Skill $model, $relatedId) { if ($model->getTutorialId() !== $relatedId) { $model->setTutorialId($relatedId); return true; } return false; }
php
protected function doSetFeaturedTutorialId(Skill $model, $relatedId) { if ($model->getTutorialId() !== $relatedId) { $model->setTutorialId($relatedId); return true; } return false; }
[ "protected", "function", "doSetFeaturedTutorialId", "(", "Skill", "$", "model", ",", "$", "relatedId", ")", "{", "if", "(", "$", "model", "->", "getTutorialId", "(", ")", "!==", "$", "relatedId", ")", "{", "$", "model", "->", "setTutorialId", "(", "$", "relatedId", ")", ";", "return", "true", ";", "}", "return", "false", ";", "}" ]
Internal mechanism to set the FeaturedTutorial id @param Skill $model @param mixed $relatedId
[ "Internal", "mechanism", "to", "set", "the", "FeaturedTutorial", "id" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2607-L2615
6,895
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doSetFeaturedVideoId
protected function doSetFeaturedVideoId(Skill $model, $relatedId) { if ($model->getVideoId() !== $relatedId) { $model->setVideoId($relatedId); return true; } return false; }
php
protected function doSetFeaturedVideoId(Skill $model, $relatedId) { if ($model->getVideoId() !== $relatedId) { $model->setVideoId($relatedId); return true; } return false; }
[ "protected", "function", "doSetFeaturedVideoId", "(", "Skill", "$", "model", ",", "$", "relatedId", ")", "{", "if", "(", "$", "model", "->", "getVideoId", "(", ")", "!==", "$", "relatedId", ")", "{", "$", "model", "->", "setVideoId", "(", "$", "relatedId", ")", ";", "return", "true", ";", "}", "return", "false", ";", "}" ]
Internal mechanism to set the FeaturedVideo id @param Skill $model @param mixed $relatedId
[ "Internal", "mechanism", "to", "set", "the", "FeaturedVideo", "id" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2623-L2631
6,896
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doSetFunctionPhaseRootId
protected function doSetFunctionPhaseRootId(Skill $model, $relatedId) { if ($model->getFunctionPhaseId() !== $relatedId) { $model->setFunctionPhaseId($relatedId); return true; } return false; }
php
protected function doSetFunctionPhaseRootId(Skill $model, $relatedId) { if ($model->getFunctionPhaseId() !== $relatedId) { $model->setFunctionPhaseId($relatedId); return true; } return false; }
[ "protected", "function", "doSetFunctionPhaseRootId", "(", "Skill", "$", "model", ",", "$", "relatedId", ")", "{", "if", "(", "$", "model", "->", "getFunctionPhaseId", "(", ")", "!==", "$", "relatedId", ")", "{", "$", "model", "->", "setFunctionPhaseId", "(", "$", "relatedId", ")", ";", "return", "true", ";", "}", "return", "false", ";", "}" ]
Internal mechanism to set the FunctionPhaseRoot id @param Skill $model @param mixed $relatedId
[ "Internal", "mechanism", "to", "set", "the", "FunctionPhaseRoot", "id" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2639-L2647
6,897
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doSetKstrukturRootId
protected function doSetKstrukturRootId(Skill $model, $relatedId) { if ($model->getKstrukturId() !== $relatedId) { $model->setKstrukturId($relatedId); return true; } return false; }
php
protected function doSetKstrukturRootId(Skill $model, $relatedId) { if ($model->getKstrukturId() !== $relatedId) { $model->setKstrukturId($relatedId); return true; } return false; }
[ "protected", "function", "doSetKstrukturRootId", "(", "Skill", "$", "model", ",", "$", "relatedId", ")", "{", "if", "(", "$", "model", "->", "getKstrukturId", "(", ")", "!==", "$", "relatedId", ")", "{", "$", "model", "->", "setKstrukturId", "(", "$", "relatedId", ")", ";", "return", "true", ";", "}", "return", "false", ";", "}" ]
Internal mechanism to set the KstrukturRoot id @param Skill $model @param mixed $relatedId
[ "Internal", "mechanism", "to", "set", "the", "KstrukturRoot", "id" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2655-L2663
6,898
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doSetMultipleOfId
protected function doSetMultipleOfId(Skill $model, $relatedId) { if ($model->getMultipleOfId() !== $relatedId) { $model->setMultipleOfId($relatedId); return true; } return false; }
php
protected function doSetMultipleOfId(Skill $model, $relatedId) { if ($model->getMultipleOfId() !== $relatedId) { $model->setMultipleOfId($relatedId); return true; } return false; }
[ "protected", "function", "doSetMultipleOfId", "(", "Skill", "$", "model", ",", "$", "relatedId", ")", "{", "if", "(", "$", "model", "->", "getMultipleOfId", "(", ")", "!==", "$", "relatedId", ")", "{", "$", "model", "->", "setMultipleOfId", "(", "$", "relatedId", ")", ";", "return", "true", ";", "}", "return", "false", ";", "}" ]
Internal mechanism to set the MultipleOf id @param Skill $model @param mixed $relatedId
[ "Internal", "mechanism", "to", "set", "the", "MultipleOf", "id" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2671-L2679
6,899
gossi/trixionary
src/domain/base/SkillDomainTrait.php
SkillDomainTrait.doSetObjectId
protected function doSetObjectId(Skill $model, $relatedId) { if ($model->getObjectId() !== $relatedId) { $model->setObjectId($relatedId); return true; } return false; }
php
protected function doSetObjectId(Skill $model, $relatedId) { if ($model->getObjectId() !== $relatedId) { $model->setObjectId($relatedId); return true; } return false; }
[ "protected", "function", "doSetObjectId", "(", "Skill", "$", "model", ",", "$", "relatedId", ")", "{", "if", "(", "$", "model", "->", "getObjectId", "(", ")", "!==", "$", "relatedId", ")", "{", "$", "model", "->", "setObjectId", "(", "$", "relatedId", ")", ";", "return", "true", ";", "}", "return", "false", ";", "}" ]
Internal mechanism to set the Object id @param Skill $model @param mixed $relatedId
[ "Internal", "mechanism", "to", "set", "the", "Object", "id" ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/domain/base/SkillDomainTrait.php#L2687-L2695