CloneSet49


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
62310.998class_member_list[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
162156
administrator/components/com_categories/models/category.php
261354
administrator/components/com_content/models/article.php
362206
administrator/components/com_menus/models/item.php
Clone Instance
1
Line Count
62
Source Line
156
Source File
administrator/components/com_categories/models/category.php

        /**
         * Method to checkin a row.
         *
         * @param       integer $pk The numeric id of a row
         * @return      boolean False on failure or error, true otherwise.
         */
        public

               function checkin($pk=  NULL) {

                // Initialize variables.
                $pk=      (!empty($pk))
                          ?               $pk
                          :                     (int) $this->getState('category.id');
                // Only attempt to check the row in if it exists.
                if ($pk)
                {
                        $user=    &JFactory::getUser();

                        // Get an instance of the row to checkin.
                        $table=  &$this->getTable();
                        if (!$table->load($pk)) {
                                $this->setError($table->getError());
                                return FALSE;
                              }

                        // Check if this is the user having previously checked out the row.
                        if ($table->checked_out > 0
                            &&                         $table->checked_out != $user->get('id')) {
                                $this->setError(JText::_('JError_Checkin_user_mismatch'));
                                return FALSE;
                              }
                        // Attempt to check the row in.
                        if (!$table->checkin($pk)) {
                                $this->setError($table->getError());
                                return FALSE;
                              }
                      }
                return TRUE;
              }
        /**
         * Method to check-out a row for editing.
         *
         * @param       int             $pk     The numeric id of the row to check-out.
         *
         * @return      boolean False on failure or error, true otherwise.
         */
        public

               function checkout($pk=  NULL) {

                // Initialize variables.
                $pk=  (!empty($pk))
                      ?               $pk
                      :                     (int) $this->getState('category.id');
                // Only attempt to check the row in if it exists.
                if ($pk)
                {
                        // Get a row instance.
                        $table=  &$this->getTable();

                        // Get the current user object.
                        $user=  &JFactory::getUser();

                        // Attempt to check the row out.
                        if (!$table->checkout($user->get('id'), $pk)) {
                                $this->setError($table->getError());
                                return FALSE;
                              }
                      }
                return TRUE;
              }


Clone Instance
2
Line Count
61
Source Line
354
Source File
administrator/components/com_content/models/article.php

        /**
         * Method to checkin a row.
         *
         * @param       integer $pk The numeric id of a row
         * @return      boolean False on failure or error, true otherwise.
         */
        public

               function checkin($pk=  NULL) {

                // Initialize variables.
                $pk=      (!empty($pk))
                          ?               $pk
                          :                     (int) $this->getState('article.id');
                // Only attempt to check the row in if it exists.
                if ($pk)
                {
                        $user=    &JFactory::getUser();

                        // Get an instance of the row to checkin.
                        $table=  &$this->getTable();
                        if (!$table->load($pk)) {
                                $this->setError($table->getError());
                                return FALSE;
                              }

                        // Check if this is the user having previously checked out the row.
                        if ($table->checked_out > 0
                            &&                         $table->checked_out != $user->get('id')) {
                                $this->setError(JText::_('JError_Checkin_user_mismatch'));
                                return FALSE;
                              }
                        // Attempt to check the row in.
                        if (!$table->checkin($pk)) {
                                $this->setError($table->getError());
                                return FALSE;
                              }
                      }
                return TRUE;
              }
        /**
         * Method to check-out a row for editing.
         *
         * @param       int             $pk     The numeric id of the row to check-out.
         * @return      boolean False on failure or error, true otherwise.
         */
        public

               function checkout($pk=  NULL) {

                // Initialize variables.
                $pk=              (!empty($pk))
                                  ?               $pk
                                  :                     (int) $this->getState('article.id');
                // Only attempt to check the row in if it exists.
                if ($pk)
                {
                        // Get a row instance.
                        $table=  &$this->getTable();

                        // Get the current user object.
                        $user=  &JFactory::getUser();

                        // Attempt to check the row out.
                        if (!$table->checkout($user->get('id'), $pk)) {
                                $this->setError($table->getError());
                                return FALSE;
                              }
                      }
                return TRUE;
              }


Clone Instance
3
Line Count
62
Source Line
206
Source File
administrator/components/com_menus/models/item.php

        /**
         * Method to checkin a row.
         *
         * @param       integer $pk The numeric id of a row
         * @return      boolean False on failure or error, true otherwise.
         */
        public

               function checkin($pk=  NULL) {

                // Initialize variables.
                $pk=      (!empty($pk))
                          ?               $pk
                          :                     (int) $this->getState('item.id');
                // Only attempt to check the row in if it exists.
                if ($pk)
                {
                        $user=    &JFactory::getUser();

                        // Get an instance of the row to checkin.
                        $table=  &$this->getTable();
                        if (!$table->load($pk)) {
                                $this->setError($table->getError());
                                return FALSE;
                              }

                        // Check if this is the user having previously checked out the row.
                        if ($table->checked_out > 0
                            &&                         $table->checked_out != $user->get('id')) {
                                $this->setError(JText::_('JError_Checkin_user_mismatch'));
                                return FALSE;
                              }
                        // Attempt to check the row in.
                        if (!$table->checkin($pk)) {
                                $this->setError($table->getError());
                                return FALSE;
                              }
                      }
                return TRUE;
              }
        /**
         * Method to check-out a row for editing.
         *
         * @param       int             $pk     The numeric id of the row to check-out.
         *
         * @return      boolean False on failure or error, true otherwise.
         */
        public

               function checkout($pk=  NULL) {

                // Initialize variables.
                $pk=  (!empty($pk))
                      ?               $pk
                      :                     (int) $this->getState('item.id');
                // Only attempt to check the row in if it exists.
                if ($pk)
                {
                        // Get a row instance.
                        $table=  &$this->getTable();

                        // Get the current user object.
                        $user=  &JFactory::getUser();

                        // Attempt to check the row out.
                        if (!$table->checkout($user->get('id'), $pk)) {
                                $this->setError($table->getError());
                                return FALSE;
                              }
                      }
                return TRUE;
              }


Clone AbstractionParameter Count: 1Parameter Bindings

/**
         * Method to checkin a row.
         *
         * @param       integer $pk The numeric id of a row
         * @return      boolean False on failure or error, true otherwise.
         */
public

      function checkin($pk=NULL) {
        // Initialize variables.
        $pk=(!empty($pk))
            ? $pk
            : (int) $this->getState( [[#variable51f9b440]]);
        // Only attempt to check the row in if it exists.
        if ($pk) {
          $user= &JFactory::getUser();
          // Get an instance of the row to checkin.
          $table= &$this->getTable();
          if (!$table->load($pk)) {
            $this->setError($table->getError());
            return FALSE;
          }
          // Check if this is the user having previously checked out the row.
          if ($table->checked_out >0
              && $table->checked_out != $user->get('id')) {
            $this->setError(JText::_('JError_Checkin_user_mismatch'));
            return FALSE;
          }
          // Attempt to check the row in.
          if (!$table->checkin($pk)) {
            $this->setError($table->getError());
            return FALSE;
          }
        }
        return TRUE;
      }
/**
         * Method to check-out a row for editing.
         *
         * @param       int             $pk     The numeric id of the row to check-out.
         *
         * @return      boolean False on failure or error, true otherwise.
         */
/**
         * Method to check-out a row for editing.
         *
         * @param       int             $pk     The numeric id of the row to check-out.
         * @return      boolean False on failure or error, true otherwise.
         */
public

      function checkout($pk=NULL) {
        // Initialize variables.
        $pk=(!empty($pk))
            ? $pk
            : (int) $this->getState( [[#variable51f9b440]]);
        // Only attempt to check the row in if it exists.
        if ($pk) {
          // Get a row instance.
          $table= &$this->getTable();
          // Get the current user object.
          $user= &JFactory::getUser();
          // Attempt to check the row out.
          if (!$table->checkout($user->get('id'),$pk)) {
            $this->setError($table->getError());
            return FALSE;
          }
        }
        return TRUE;
      }
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#51f9b440]]
'category.id' 
12[[#51f9b440]]
'article.id' 
13[[#51f9b440]]
'item.id'