PluginProbe
ERP: Complete HR, Accounting & CRM Suite Built for WooCommerce / 1.3.13
ERP: Complete HR, Accounting & CRM Suite Built for WooCommerce v1.3.13
1.17.9 1.17.8 1.17.7 1.17.6 1.17.5 1.17.4 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.3.0 1.3.1 1.3.11 1.3.12 1.3.13 1.3.14 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 All 143 releases
erp / modules / hrm / includes / class-designation.php

class-designation.php in ERP: Complete HR, Accounting & CRM Suite Built for WooCommerce 1.3.13, at modules/hrm/includes/class-designation.php

30 lines 725 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace WeDevs\ERP\HRM;
3
4 /**
5 * The designation class
6 */
7 class Designation extends \WeDevs\ERP\Item {
8
9 /**
10 * Get a company by ID
11 *
12 * @param int company id
13 *
14 * @return object wpdb object
15 */
16 protected function get_by_id( $designation_id ) {
17 global $wpdb;
18
19 return $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}erp_hr_designations WHERE id = %d", $designation_id ) );
20 }
21
22 /**
23 * Get number of employee belongs to this department
24 *
25 * @return int
26 */
27 public function num_of_employees() {
28 return \WeDevs\ERP\HRM\Models\Employee::where( array( 'status' => 'active', 'designation' => $this->id ) )->count();
29 }
30 }